Changeset 63384
- Timestamp:
- 08/28/2026 04:57:25 AM (less than one hour ago)
- Location:
- trunk
- Files:
-
- 1 deleted
- 2 edited
-
phpstan.neon.dist (modified) (1 diff)
-
src/wp-includes/class-wp-theme-json.php (modified) (24 diffs)
-
tests/phpstan/baselines/staticClassAccess.privateMethod.neon (deleted)
Legend:
- Unmodified
- Added
- Removed
-
trunk/phpstan.neon.dist
r63381 r63384 79 79 - tests/phpstan/baselines/return.unusedType.neon 80 80 - tests/phpstan/baselines/smallerOrEqual.alwaysTrue.neon 81 - tests/phpstan/baselines/staticClassAccess.privateMethod.neon82 81 - tests/phpstan/baselines/ternary.alwaysTrue.neon 83 82 - tests/phpstan/baselines/varTag.noVariable.neon -
trunk/src/wp-includes/class-wp-theme-json.php
r63171 r63384 719 719 */ 720 720 public static function get_viewport_media_queries( $viewport_settings = null, $options = array() ) { 721 $breakpoints = s tatic::sanitize_viewport_settings( $viewport_settings );721 $breakpoints = self::sanitize_viewport_settings( $viewport_settings ); 722 722 723 723 $responsive_media_queries = array(); … … 789 789 */ 790 790 private static function get_viewport_breakpoint_value_in_pixels( $value ) { 791 if ( ! s tatic::is_valid_viewport_breakpoint_size( $value ) ) {791 if ( ! self::is_valid_viewport_breakpoint_size( $value ) ) { 792 792 return null; 793 793 } … … 832 832 foreach ( array_keys( static::DEFAULT_VIEWPORT_BREAKPOINTS ) as $breakpoint ) { 833 833 $value = $viewport_settings[ $breakpoint ] ?? null; 834 $px = s tatic::get_viewport_breakpoint_value_in_pixels( $value );834 $px = self::get_viewport_breakpoint_value_in_pixels( $value ); 835 835 if ( null !== $px ) { 836 836 $breakpoints[ $breakpoint ] = array( … … 990 990 if ( is_array( $block_metadata ) ) { 991 991 $feature_declarations = $this->get_feature_declarations_for_node( $block_metadata, $pseudo_node ); 992 $feature_declarations = s tatic::update_paragraph_text_indent_selector( $feature_declarations, $settings, $block_name );993 $feature_declarations = s tatic::update_button_width_declarations( $feature_declarations, $settings );992 $feature_declarations = self::update_paragraph_text_indent_selector( $feature_declarations, $settings, $block_name ); 993 $feature_declarations = self::update_button_width_declarations( $feature_declarations, $settings ); 994 994 995 995 foreach ( $feature_declarations as $feature_selector => $declarations ) { … … 1099 1099 $valid_element_names = array_keys( static::ELEMENTS ); 1100 1100 $valid_variations = static::get_valid_block_style_variations( $blocks_metadata ); 1101 $this->theme_json = s tatic::unwrap_shared_block_style_variations( $this->theme_json, $valid_variations );1101 $this->theme_json = self::unwrap_shared_block_style_variations( $this->theme_json, $valid_variations ); 1102 1102 $this->theme_json = static::sanitize( $this->theme_json, $valid_block_names, $valid_element_names, $valid_variations ); 1103 1103 $this->theme_json = static::maybe_opt_in_into_settings( $this->theme_json ); … … 1137 1137 $sizes_path = array( 'settings', 'spacing', 'spacingSizes', $origin ); 1138 1138 $spacing_sizes = _wp_array_get( $this->theme_json, $sizes_path, array() ); 1139 $spacing_scale_sizes = s tatic::compute_spacing_sizes( $spacing_scale );1140 $merged_spacing_sizes = s tatic::merge_spacing_sizes( $spacing_scale_sizes, $spacing_sizes );1139 $spacing_scale_sizes = self::compute_spacing_sizes( $spacing_scale ); 1140 $merged_spacing_sizes = self::merge_spacing_sizes( $spacing_scale_sizes, $spacing_sizes ); 1141 1141 _wp_array_set( $this->theme_json, $sizes_path, $merged_spacing_sizes ); 1142 1142 } … … 1458 1458 1459 1459 if ( 'settings' === $subtree && array_key_exists( 'viewport', $input[ $subtree ] ) ) { 1460 $result['viewport'] = s tatic::sanitize_viewport_settings( $input[ $subtree ]['viewport'] );1460 $result['viewport'] = self::sanitize_viewport_settings( $input[ $subtree ]['viewport'] ); 1461 1461 } 1462 1462 … … 1464 1464 unset( $output[ $subtree ] ); 1465 1465 } else { 1466 $output[ $subtree ] = s tatic::resolve_custom_css_format( $result );1466 $output[ $subtree ] = self::resolve_custom_css_format( $result ); 1467 1467 } 1468 1468 } … … 2510 2510 } 2511 2511 2512 $target = s tatic::get_feature_selector( $feature_selectors, $preset_metadata['path'][0], $selector );2512 $target = self::get_feature_selector( $feature_selectors, $preset_metadata['path'][0], $selector ); 2513 2513 2514 2514 if ( ! isset( $vars_by_selector[ $target ] ) ) { … … 3308 3308 } 3309 3309 3310 $block_nodes = s tatic::get_block_nodes( $theme_json, $selectors, $options );3310 $block_nodes = self::get_block_nodes( $theme_json, $selectors, $options ); 3311 3311 foreach ( $block_nodes as $block_node ) { 3312 3312 $nodes[] = $block_node; … … 3333 3333 */ 3334 3334 public function get_styles_block_nodes() { 3335 return s tatic::get_block_nodes( $this->theme_json );3335 return self::get_block_nodes( $this->theme_json ); 3336 3336 } 3337 3337 … … 3825 3825 // Update text indent selector for paragraph blocks based on the textIndent setting. 3826 3826 $block_name = $block_metadata['name'] ?? null; 3827 $feature_declarations = s tatic::update_paragraph_text_indent_selector( $feature_declarations, $settings, $block_name );3827 $feature_declarations = self::update_paragraph_text_indent_selector( $feature_declarations, $settings, $block_name ); 3828 3828 $block_elements = $block_metadata['elements'] ?? array(); 3829 3829 3830 3830 // Update button width declarations for percentage values to use calc() with block gap. 3831 $feature_declarations = s tatic::update_button_width_declarations( $feature_declarations, $settings );3831 $feature_declarations = self::update_button_width_declarations( $feature_declarations, $settings ); 3832 3832 3833 3833 // If there are style variations, generate the declarations for them, including any feature selectors the block may have. … … 3845 3845 3846 3846 // Update text indent selector for paragraph blocks based on the textIndent setting. 3847 $variation_declarations = s tatic::update_paragraph_text_indent_selector( $variation_declarations, $settings, $block_name );3847 $variation_declarations = self::update_paragraph_text_indent_selector( $variation_declarations, $settings, $block_name ); 3848 3848 3849 3849 // Update button width declarations for percentage values to use calc() with block gap. 3850 $variation_declarations = s tatic::update_button_width_declarations( $variation_declarations, $settings );3850 $variation_declarations = self::update_button_width_declarations( $variation_declarations, $settings ); 3851 3851 3852 3852 // Combine selectors with style variation's selector and add to overall style variation declarations. … … 3865 3865 $block_name = $block_metadata['name']; 3866 3866 } elseif ( in_array( 'blocks', $block_metadata['path'], true ) && count( $block_metadata['path'] ) >= 3 ) { 3867 $block_name = s tatic::get_block_name_from_metadata_path( $block_metadata );3867 $block_name = self::get_block_name_from_metadata_path( $block_metadata ); 3868 3868 } else { 3869 3869 $block_name = null; … … 3903 3903 // Process feature-level declarations for this breakpoint. 3904 3904 $breakpoint_feature_declarations = static::get_feature_declarations_for_node( $block_metadata, $breakpoint_node ); 3905 $breakpoint_feature_declarations = s tatic::update_paragraph_text_indent_selector( $breakpoint_feature_declarations, $settings, $block_name );3906 $breakpoint_feature_declarations = s tatic::update_button_width_declarations( $breakpoint_feature_declarations, $settings );3905 $breakpoint_feature_declarations = self::update_paragraph_text_indent_selector( $breakpoint_feature_declarations, $settings, $block_name ); 3906 $breakpoint_feature_declarations = self::update_button_width_declarations( $breakpoint_feature_declarations, $settings ); 3907 3907 foreach ( $breakpoint_feature_declarations as $feature_selector => $feature_decl ) { 3908 3908 $combined_selectors = static::get_block_style_variation_feature_selector( $style_variation, $feature_selector ); … … 4102 4102 // Update declarations if there are separators with only background color defined. 4103 4103 if ( '.wp-block-separator' === $selector ) { 4104 $declarations = s tatic::update_separator_declarations( $declarations );4104 $declarations = self::update_separator_declarations( $declarations ); 4105 4105 } 4106 4106 … … 4344 4344 $sizes_path = array( 'settings', 'spacing', 'spacingSizes', $origin ); 4345 4345 $spacing_sizes = _wp_array_get( $incoming_data, $sizes_path, array() ); 4346 $spacing_scale_sizes = s tatic::compute_spacing_sizes( $flattened_spacing_scale );4347 $merged_spacing_sizes = s tatic::merge_spacing_sizes( $spacing_scale_sizes, $spacing_sizes );4346 $spacing_scale_sizes = self::compute_spacing_sizes( $flattened_spacing_scale ); 4347 $merged_spacing_sizes = self::merge_spacing_sizes( $spacing_scale_sizes, $spacing_sizes ); 4348 4348 4349 4349 _wp_array_set( $incoming_data, $sizes_path, $merged_spacing_sizes ); … … 4442 4442 * objects and represent unique definitions for the style. 4443 4443 */ 4444 $style_nodes = s tatic::get_block_nodes(4444 $style_nodes = self::get_block_nodes( 4445 4445 $this->theme_json, 4446 4446 array(), … … 4682 4682 4683 4683 $block_name = in_array( 'blocks', $metadata['path'], true ) 4684 ? s tatic::get_block_name_from_metadata_path( $metadata )4684 ? self::get_block_name_from_metadata_path( $metadata ) 4685 4685 : null; 4686 4686 … … 5009 5009 5010 5010 // Ensure indirect properties not included in any `PRESETS_METADATA` value are allowed. 5011 s tatic::remove_indirect_properties( $input, $output );5011 self::remove_indirect_properties( $input, $output ); 5012 5012 5013 5013 // Preserve all valid settings that have type markers in VALID_SETTINGS. … … 5015 5015 5016 5016 if ( $is_root && array_key_exists( 'viewport', $input ) ) { 5017 $output['viewport'] = s tatic::sanitize_viewport_settings( $input['viewport'] );5017 $output['viewport'] = self::sanitize_viewport_settings( $input['viewport'] ); 5018 5018 } 5019 5019 … … 5050 5050 5051 5051 // Ensure indirect properties not handled by `compute_style_properties` are allowed. 5052 s tatic::remove_indirect_properties( $input, $output );5052 self::remove_indirect_properties( $input, $output ); 5053 5053 5054 5054 return $output; … … 5383 5383 } 5384 5384 5385 $spacing_sizes = s tatic::compute_spacing_sizes( $spacing_scale );5385 $spacing_sizes = self::compute_spacing_sizes( $spacing_scale ); 5386 5386 5387 5387 // If there are 7 or fewer steps in the scale revert to numbers for labels instead of t-shirt sizes. … … 5435 5435 * 'increment' => 2, 5436 5436 * ); 5437 * $spacing_sizes = s tatic::compute_spacing_sizes( $spacing_scale );5437 * $spacing_sizes = self::compute_spacing_sizes( $spacing_scale ); 5438 5438 * // -> array( 5439 5439 * // array( 'name' => 'Small', 'slug' => '40', 'size' => '14px' ),
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)