Skip to content

Commit 3263d1d

Browse files
authored
Merge branch 'WordPress:trunk' into trunk
2 parents 1d7d6a5 + 4a8a86b commit 3263d1d

3 files changed

Lines changed: 30 additions & 121 deletions

File tree

phpstan.neon.dist

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ includes:
7878
- tests/phpstan/baselines/return.type.neon
7979
- tests/phpstan/baselines/return.unusedType.neon
8080
- tests/phpstan/baselines/smallerOrEqual.alwaysTrue.neon
81-
- tests/phpstan/baselines/staticClassAccess.privateMethod.neon
8281
- tests/phpstan/baselines/ternary.alwaysTrue.neon
8382
- tests/phpstan/baselines/varTag.noVariable.neon
8483
- tests/phpstan/baselines/variable.undefined.neon

src/wp-includes/class-wp-theme-json.php

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,7 @@ class WP_Theme_JSON {
718718
* @return array Responsive media queries.
719719
*/
720720
public static function get_viewport_media_queries( $viewport_settings = null, $options = array() ) {
721-
$breakpoints = static::sanitize_viewport_settings( $viewport_settings );
721+
$breakpoints = self::sanitize_viewport_settings( $viewport_settings );
722722

723723
$responsive_media_queries = array();
724724

@@ -788,7 +788,7 @@ private static function is_valid_viewport_breakpoint_size( $value ) {
788788
* @return float|null Viewport breakpoint size in pixels, or null when invalid.
789789
*/
790790
private static function get_viewport_breakpoint_value_in_pixels( $value ) {
791-
if ( ! static::is_valid_viewport_breakpoint_size( $value ) ) {
791+
if ( ! self::is_valid_viewport_breakpoint_size( $value ) ) {
792792
return null;
793793
}
794794

@@ -831,7 +831,7 @@ private static function sanitize_viewport_settings( $viewport_settings ) {
831831
$breakpoints = array();
832832
foreach ( array_keys( static::DEFAULT_VIEWPORT_BREAKPOINTS ) as $breakpoint ) {
833833
$value = $viewport_settings[ $breakpoint ] ?? null;
834-
$px = static::get_viewport_breakpoint_value_in_pixels( $value );
834+
$px = self::get_viewport_breakpoint_value_in_pixels( $value );
835835
if ( null !== $px ) {
836836
$breakpoints[ $breakpoint ] = array(
837837
'value' => trim( $value ),
@@ -989,8 +989,8 @@ private function process_pseudo_selectors( $node, $base_selector, $settings, $bl
989989

990990
if ( is_array( $block_metadata ) ) {
991991
$feature_declarations = $this->get_feature_declarations_for_node( $block_metadata, $pseudo_node );
992-
$feature_declarations = static::update_paragraph_text_indent_selector( $feature_declarations, $settings, $block_name );
993-
$feature_declarations = static::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 );
994994

995995
foreach ( $feature_declarations as $feature_selector => $declarations ) {
996996
$target_selector = is_array( $style_variation )
@@ -1098,7 +1098,7 @@ public function __construct( $theme_json = array( 'version' => self::LATEST_SCHE
10981098
$valid_block_names = array_keys( $blocks_metadata );
10991099
$valid_element_names = array_keys( static::ELEMENTS );
11001100
$valid_variations = static::get_valid_block_style_variations( $blocks_metadata );
1101-
$this->theme_json = static::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 );
11021102
$this->theme_json = static::sanitize( $this->theme_json, $valid_block_names, $valid_element_names, $valid_variations );
11031103
$this->theme_json = static::maybe_opt_in_into_settings( $this->theme_json );
11041104

@@ -1136,8 +1136,8 @@ public function __construct( $theme_json = array( 'version' => self::LATEST_SCHE
11361136
if ( isset( $spacing_scale ) ) {
11371137
$sizes_path = array( 'settings', 'spacing', 'spacingSizes', $origin );
11381138
$spacing_sizes = _wp_array_get( $this->theme_json, $sizes_path, array() );
1139-
$spacing_scale_sizes = static::compute_spacing_sizes( $spacing_scale );
1140-
$merged_spacing_sizes = static::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 );
11411141
_wp_array_set( $this->theme_json, $sizes_path, $merged_spacing_sizes );
11421142
}
11431143
}
@@ -1457,13 +1457,13 @@ protected static function sanitize( $input, $valid_block_names, $valid_element_n
14571457
$result = static::remove_keys_not_in_schema( $input[ $subtree ], $schema[ $subtree ] );
14581458

14591459
if ( 'settings' === $subtree && array_key_exists( 'viewport', $input[ $subtree ] ) ) {
1460-
$result['viewport'] = static::sanitize_viewport_settings( $input[ $subtree ]['viewport'] );
1460+
$result['viewport'] = self::sanitize_viewport_settings( $input[ $subtree ]['viewport'] );
14611461
}
14621462

14631463
if ( empty( $result ) ) {
14641464
unset( $output[ $subtree ] );
14651465
} else {
1466-
$output[ $subtree ] = static::resolve_custom_css_format( $result );
1466+
$output[ $subtree ] = self::resolve_custom_css_format( $result );
14671467
}
14681468
}
14691469

@@ -2509,7 +2509,7 @@ protected function get_css_variables( $nodes, $origins ) {
25092509
continue;
25102510
}
25112511

2512-
$target = static::get_feature_selector( $feature_selectors, $preset_metadata['path'][0], $selector );
2512+
$target = self::get_feature_selector( $feature_selectors, $preset_metadata['path'][0], $selector );
25132513

25142514
if ( ! isset( $vars_by_selector[ $target ] ) ) {
25152515
$vars_by_selector[ $target ] = array();
@@ -3307,7 +3307,7 @@ protected static function get_style_nodes( $theme_json, $selectors = array(), $o
33073307
return $nodes;
33083308
}
33093309

3310-
$block_nodes = static::get_block_nodes( $theme_json, $selectors, $options );
3310+
$block_nodes = self::get_block_nodes( $theme_json, $selectors, $options );
33113311
foreach ( $block_nodes as $block_node ) {
33123312
$nodes[] = $block_node;
33133313
}
@@ -3332,7 +3332,7 @@ protected static function get_style_nodes( $theme_json, $selectors = array(), $o
33323332
* @return array The block nodes in theme.json.
33333333
*/
33343334
public function get_styles_block_nodes() {
3335-
return static::get_block_nodes( $this->theme_json );
3335+
return self::get_block_nodes( $this->theme_json );
33363336
}
33373337

33383338
/**
@@ -3824,11 +3824,11 @@ public function get_styles_for_block( $block_metadata ) {
38243824

38253825
// Update text indent selector for paragraph blocks based on the textIndent setting.
38263826
$block_name = $block_metadata['name'] ?? null;
3827-
$feature_declarations = static::update_paragraph_text_indent_selector( $feature_declarations, $settings, $block_name );
3827+
$feature_declarations = self::update_paragraph_text_indent_selector( $feature_declarations, $settings, $block_name );
38283828
$block_elements = $block_metadata['elements'] ?? array();
38293829

38303830
// Update button width declarations for percentage values to use calc() with block gap.
3831-
$feature_declarations = static::update_button_width_declarations( $feature_declarations, $settings );
3831+
$feature_declarations = self::update_button_width_declarations( $feature_declarations, $settings );
38323832

38333833
// If there are style variations, generate the declarations for them, including any feature selectors the block may have.
38343834
$style_variation_declarations = array();
@@ -3844,10 +3844,10 @@ public function get_styles_for_block( $block_metadata ) {
38443844
$variation_declarations = static::get_feature_declarations_for_node( $block_metadata, $style_variation_node );
38453845

38463846
// Update text indent selector for paragraph blocks based on the textIndent setting.
3847-
$variation_declarations = static::update_paragraph_text_indent_selector( $variation_declarations, $settings, $block_name );
3847+
$variation_declarations = self::update_paragraph_text_indent_selector( $variation_declarations, $settings, $block_name );
38483848

38493849
// Update button width declarations for percentage values to use calc() with block gap.
3850-
$variation_declarations = static::update_button_width_declarations( $variation_declarations, $settings );
3850+
$variation_declarations = self::update_button_width_declarations( $variation_declarations, $settings );
38513851

38523852
// Combine selectors with style variation's selector and add to overall style variation declarations.
38533853
foreach ( $variation_declarations as $current_selector => $new_declarations ) {
@@ -3864,7 +3864,7 @@ public function get_styles_for_block( $block_metadata ) {
38643864
if ( isset( $block_metadata['name'] ) ) {
38653865
$block_name = $block_metadata['name'];
38663866
} elseif ( in_array( 'blocks', $block_metadata['path'], true ) && count( $block_metadata['path'] ) >= 3 ) {
3867-
$block_name = static::get_block_name_from_metadata_path( $block_metadata );
3867+
$block_name = self::get_block_name_from_metadata_path( $block_metadata );
38683868
} else {
38693869
$block_name = null;
38703870
}
@@ -3902,8 +3902,8 @@ public function get_styles_for_block( $block_metadata ) {
39023902
$breakpoint_media = $responsive_media_queries[ $breakpoint ];
39033903
// Process feature-level declarations for this breakpoint.
39043904
$breakpoint_feature_declarations = static::get_feature_declarations_for_node( $block_metadata, $breakpoint_node );
3905-
$breakpoint_feature_declarations = static::update_paragraph_text_indent_selector( $breakpoint_feature_declarations, $settings, $block_name );
3906-
$breakpoint_feature_declarations = static::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 );
39073907
foreach ( $breakpoint_feature_declarations as $feature_selector => $feature_decl ) {
39083908
$combined_selectors = static::get_block_style_variation_feature_selector( $style_variation, $feature_selector );
39093909

@@ -4101,7 +4101,7 @@ static function ( $pseudo_selector ) use ( $selector ) {
41014101

41024102
// Update declarations if there are separators with only background color defined.
41034103
if ( '.wp-block-separator' === $selector ) {
4104-
$declarations = static::update_separator_declarations( $declarations );
4104+
$declarations = self::update_separator_declarations( $declarations );
41054105
}
41064106

41074107
/*
@@ -4343,8 +4343,8 @@ public function merge( $incoming ) {
43434343
// Generate and merge the scales for this layer.
43444344
$sizes_path = array( 'settings', 'spacing', 'spacingSizes', $origin );
43454345
$spacing_sizes = _wp_array_get( $incoming_data, $sizes_path, array() );
4346-
$spacing_scale_sizes = static::compute_spacing_sizes( $flattened_spacing_scale );
4347-
$merged_spacing_sizes = static::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 );
43484348

43494349
_wp_array_set( $incoming_data, $sizes_path, $merged_spacing_sizes );
43504350
}
@@ -4441,7 +4441,7 @@ public function merge( $incoming ) {
44414441
* some values provide exceptions, namely style values that are
44424442
* objects and represent unique definitions for the style.
44434443
*/
4444-
$style_nodes = static::get_block_nodes(
4444+
$style_nodes = self::get_block_nodes(
44454445
$this->theme_json,
44464446
array(),
44474447
array( 'include_node_paths_only' => true )
@@ -4681,7 +4681,7 @@ public static function remove_insecure_properties( $theme_json, $origin = 'theme
46814681
}
46824682

46834683
$block_name = in_array( 'blocks', $metadata['path'], true )
4684-
? static::get_block_name_from_metadata_path( $metadata )
4684+
? self::get_block_name_from_metadata_path( $metadata )
46854685
: null;
46864686

46874687
// The global styles custom CSS is not sanitized, but can only be edited by users with 'edit_css' capability.
@@ -5008,13 +5008,13 @@ protected static function remove_insecure_settings( $input, $is_root = false ) {
50085008
}
50095009

50105010
// Ensure indirect properties not included in any `PRESETS_METADATA` value are allowed.
5011-
static::remove_indirect_properties( $input, $output );
5011+
self::remove_indirect_properties( $input, $output );
50125012

50135013
// Preserve all valid settings that have type markers in VALID_SETTINGS.
50145014
self::preserve_valid_typed_settings( $input, $output, static::VALID_SETTINGS );
50155015

50165016
if ( $is_root && array_key_exists( 'viewport', $input ) ) {
5017-
$output['viewport'] = static::sanitize_viewport_settings( $input['viewport'] );
5017+
$output['viewport'] = self::sanitize_viewport_settings( $input['viewport'] );
50185018
}
50195019

50205020
return $output;
@@ -5049,7 +5049,7 @@ protected static function remove_insecure_styles( $input ) {
50495049
}
50505050

50515051
// Ensure indirect properties not handled by `compute_style_properties` are allowed.
5052-
static::remove_indirect_properties( $input, $output );
5052+
self::remove_indirect_properties( $input, $output );
50535053

50545054
return $output;
50555055
}
@@ -5382,7 +5382,7 @@ public function set_spacing_sizes() {
53825382
return;
53835383
}
53845384

5385-
$spacing_sizes = static::compute_spacing_sizes( $spacing_scale );
5385+
$spacing_sizes = self::compute_spacing_sizes( $spacing_scale );
53865386

53875387
// If there are 7 or fewer steps in the scale revert to numbers for labels instead of t-shirt sizes.
53885388
if ( $spacing_scale['steps'] <= 7 ) {
@@ -5434,7 +5434,7 @@ private static function merge_spacing_sizes( $base, $incoming ) {
54345434
* 'operator' => '+',
54355435
* 'increment' => 2,
54365436
* );
5437-
* $spacing_sizes = static::compute_spacing_sizes( $spacing_scale );
5437+
* $spacing_sizes = self::compute_spacing_sizes( $spacing_scale );
54385438
* // -> array(
54395439
* // array( 'name' => 'Small', 'slug' => '40', 'size' => '14px' ),
54405440
* // array( 'name' => 'Medium', 'slug' => '50', 'size' => '16px' ),

tests/phpstan/baselines/staticClassAccess.privateMethod.neon

Lines changed: 0 additions & 90 deletions
This file was deleted.

0 commit comments

Comments
 (0)