Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions backport-changelog/7.2/15823.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
https://github.com/WordPress/wordpress-develop/pull/15823

* https://github.com/WordPress/gutenberg/pull/86105
4 changes: 3 additions & 1 deletion packages/block-library/src/navigation/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -1879,7 +1879,7 @@ function block_core_navigation_parse_blocks_from_menu_items( $menu_items, $menu_
*
* @deprecated 6.3.0 Use WP_Navigation_Fallback::get_classic_menu_fallback() instead.
*
* @return object WP_Term The classic navigation.
* @return WP_Term|null The classic navigation, or null if there are no classic menus.
*/
function block_core_navigation_get_classic_menu_fallback() {

Expand Down Expand Up @@ -1916,6 +1916,8 @@ static function ( $a, $b ) {
);
return $classic_nav_menus[0];
}

return null;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
/**
* Holds, sanitizes, processes and prints CSS declarations for the Style Engine.
*
* @phpstan-consistent-constructor
*
* @access private
*/
class WP_Style_Engine_CSS_Rules_Store {
Expand Down
15 changes: 9 additions & 6 deletions packages/style-engine/src/class-wp-style-engine.php
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ final class WP_Style_Engine {
/**
* Util: Extracts the slug in kebab case from a preset string, e.g., "heavenly-blue" from 'var:preset|color|heavenlyBlue'.
*
* @param string $style_value A single CSS preset value.
* @param mixed $style_value A single CSS preset value.
* @param string $property_key The CSS property that is the second element of the preset string. Used for matching.
*
* @return string The slug, or empty string if not found.
Expand Down Expand Up @@ -418,7 +418,7 @@ protected static function get_css_var_value( $style_value, $css_vars ) {
/**
* Util: Checks whether an incoming block style value is valid.
*
* @param string $style_value A single CSS preset value.
* @param mixed $style_value A single raw style value.
*
* @return bool
*/
Expand Down Expand Up @@ -544,10 +544,13 @@ protected static function has_box_background( $background_styles ) {
/**
* Returns classnames, and generates classname(s) from a CSS preset property pattern, e.g., '`var:preset|<PRESET_TYPE>|<PRESET_SLUG>`'.
*
* @param array $style_value A single raw style value or css preset property from the $block_styles array.
* @param array $style_definition A single style definition from BLOCK_STYLE_DEFINITIONS_METADATA.
* @param mixed $style_value A single raw style value or CSS preset property from the $block_styles array.
* @param array $style_definition A single style definition from BLOCK_STYLE_DEFINITIONS_METADATA.
*
* @return array|string[] An array of CSS classnames, or empty array.
* @return string[] An array of CSS classnames, or empty array.
*
* @phpstan-param array{ classnames?: array<string, string|true>, ... } $style_definition
* @phpstan-return list<string>
*/
protected static function get_classnames( $style_value, $style_definition ) {
if ( empty( $style_value ) ) {
Expand Down Expand Up @@ -584,7 +587,7 @@ protected static function get_classnames( $style_value, $style_definition ) {
*
* @since 6.1.0
*
* @param array $style_value A single raw style value from $block_styles array.
* @param mixed $style_value A single raw style value from $block_styles array.
* @param array $style_definition A single style definition from BLOCK_STYLE_DEFINITIONS_METADATA.
* @param array $options {
* Optional. An array of options. Default empty array.
Expand Down
17 changes: 0 additions & 17 deletions tools/phpstan/baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -42,26 +42,9 @@ parameters:
count: 1
path: ../../lib/experimental/navigation-theme-opt-in.php

-
message: '#^Function block_core_navigation_get_classic_menu_fallback\(\) should return object but return statement is missing\.$#'
identifier: return.missing
count: 1
path: ../../packages/block-library/src/navigation/index.php

-
message: '#^Right side of \|\| is always true\.$#'
identifier: booleanOr.rightAlwaysTrue
count: 1
path: ../../packages/block-library/src/template-part/index.php

-
message: '#^Unsafe usage of new static\(\)\.$#'
identifier: new.static
count: 1
path: ../../packages/style-engine/src/class-wp-style-engine-css-rules-store.php

-
message: '#^Parameter \#1 \$style_value of static method WP_Style_Engine\:\:get_slug_from_preset_value\(\) expects string, array given\.$#'
identifier: argument.type
count: 1
path: ../../packages/style-engine/src/class-wp-style-engine.php
Loading