Skip to content

Commit c501d97

Browse files
authored
Update function map with WP 7.0 updates (#465)
1 parent d74b963 commit c501d97

5 files changed

Lines changed: 7 additions & 8 deletions

File tree

functionMap.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,12 @@
7878
'block_core_navigation_build_css_font_sizes' => ['array{css_classes: list<string>, inline_styles: string}'],
7979
'block_core_navigation_link_build_css_colors' => ['array{css_classes: list<string>, inline_styles: string}'],
8080
'block_core_navigation_link_build_css_font_sizes' => ['array{css_classes: list<string>, inline_styles: string}'],
81-
'block_core_navigation_link_render_submenu_icon' => ['non-falsy-string'],
8281
'block_core_navigation_render_submenu_icon' => ['non-falsy-string'],
8382
'block_core_navigation_submenu_build_css_font_sizes' => ['array{css_classes: list<string>, inline_styles: string}'],
84-
'block_core_navigation_submenu_render_submenu_icon' => ['non-falsy-string'],
8583
'block_core_page_list_build_css_colors' => ['array{css_classes: list<string>, inline_styles: string, overlay_css_classes: list<string>, overlay_inline_styles: string}'],
8684
'block_core_page_list_build_css_font_sizes' => ['array{css_classes: list<string>, inline_styles: string}'],
8785
'block_core_post_time_to_read_word_count' => ['int<0, max>'],
86+
'block_core_shared_navigation_render_submenu_icon' => ['non-falsy-string'],
8887
'block_version' => ["(\$content is '' ? 0 : 0|1)", '@phpstan-pure' => ''],
8988
'bool_from_yn' => ["(\$yn is 'y' ? true : false)", '@phpstan-pure' => ''],
9089
'build_dropdown_script_block_core_categories' => ['non-falsy-string'],

src/Visitor.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ private function getAdditionalTagsFromMap(string $symbolName): array
457457

458458
foreach ($parameters as $paramName => $paramType) {
459459
if (str_starts_with($paramName, '@')) {
460-
$format = ( $paramType === '' ) ? '%s' : '%s %s';
460+
$format = ($paramType === '') ? '%s' : '%s %s';
461461
$additions[] = sprintf(
462462
$format,
463463
$paramName,
@@ -684,8 +684,8 @@ private static function getTypeNameFromString(string $tagVariable): ?string
684684

685685
$tagVariableType = str_replace(
686686
[
687-
'stdClass',
688-
'\\object',
687+
'stdClass',
688+
'\\object',
689689
],
690690
'object',
691691
$tagVariableType

tests/data/assert/wp-is-numeric-array.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
// Check with mixed keys constant array
6565
$data = [1 => 'intKey', 'key' => 'stringKey'];
6666
if (wp_is_numeric_array($data)) {
67-
assertType("non-empty-array<1, 'intKey'|'stringKey'>", $data);
67+
assertType("array{1: 'intKey'}", $data);
6868
}
6969
if (! wp_is_numeric_array($data)) {
7070
assertType("array{1: 'intKey', key: 'stringKey'}", $data);

tests/data/return/block-core.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@
1010
assertType('non-falsy-string', build_dropdown_script_block_core_categories(Faker::string()));
1111

1212
// Submenu icon
13-
assertType('non-falsy-string', block_core_navigation_link_render_submenu_icon());
1413
assertType('non-falsy-string', block_core_navigation_render_submenu_icon());
15-
assertType('non-falsy-string', block_core_navigation_submenu_render_submenu_icon());
14+
assertType('non-falsy-string', block_core_shared_navigation_render_submenu_icon());
1615

1716
// Render block
1817
assertType('non-falsy-string', render_block_core_archives(Faker::array()));

wordpress-stubs.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114656,6 +114656,7 @@ function block_core_shared_navigation_item_should_render($attributes, $block)
114656114656
* @since 5.9.0
114657114657
*
114658114658
* @return string
114659+
* @phpstan-return non-falsy-string
114659114660
*/
114660114661
function block_core_shared_navigation_render_submenu_icon()
114661114662
{

0 commit comments

Comments
 (0)