Skip to content

Commit a11b757

Browse files
authored
wp_generate_block_templates_export_file: narrow return type (#451)
1 parent ece8be7 commit a11b757

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

functionMap.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@
244244
'wp_dropdown_languages' => ["(\$args is array{id: null|''}&array ? void : (\$args is array{name: null|''}&array ? void : string))"],
245245
'wp_extract_urls' => ['($content is empty ? array{} : list<string>)'],
246246
'wp_fast_hash' => ['non-falsy-string'],
247+
'wp_generate_block_templates_export_file' => ['non-falsy-string|\WP_Error'],
247248
'wp_generate_password' => [null, '@phpstan-impure' => ''],
248249
'wp_generate_tag_cloud' => ["(\$args is array{format: 'array'}&array ? array<int, string> : string)"],
249250
'wp_generate_uuid4' => ['lowercase-string&non-falsy-string', '@phpstan-impure' => ''],
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use function PHPStan\Testing\assertType;
6+
7+
assertType('non-falsy-string|WP_Error', wp_generate_block_templates_export_file());

wordpress-stubs.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99525,6 +99525,7 @@ function wp_is_theme_directory_ignored($path)
9952599525
* @since 6.0.0 Adds the whole theme to the export archive.
9952699526
*
9952799527
* @return WP_Error|string Path of the ZIP file or error on failure.
99528+
* @phpstan-return non-falsy-string|\WP_Error
9952899529
*/
9952999530
function wp_generate_block_templates_export_file()
9953099531
{

0 commit comments

Comments
 (0)