Skip to content

Commit 1a9c238

Browse files
authored
Remove obsolete WP_Theme::get() from the function map (#475)
A corresponding phpstan-return tag has been added in WP 7.0.
1 parent 0f64fae commit 1a9c238

3 files changed

Lines changed: 0 additions & 20 deletions

File tree

functionMap.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,6 @@
410410
'@phpstan-property-read string $theme_root' => '',
411411
'@phpstan-property-read string $theme_root_uri' => '',
412412
],
413-
'WP_Theme::get' => ["(\$header is 'Name'|'ThemeURI'|'Description'|'Author'|'AuthorURI'|'Version'|'Template'|'Status'|'Tags'|'TextDomain'|'DomainPath'|'RequiresWP'|'RequiresPHP'|'UpdateURI' ? (\$header is 'Tags' ? string[] : string) : false)"],
414413
'WP_Theme::offsetExists' => ['($offset is ThemeKey ? true : false)'],
415414
'WP_Theme::offsetGet' => ['($offset is ThemeKey ? mixed : null)'],
416415
'WP_Theme_JSON_Resolver::get_theme_data' => [null, 'deprecated' => 'array{}'],

tests/data/return/wp-theme.php

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,6 @@
2525
assertType('string', $theme->theme_root_uri);
2626
assertType('*ERROR*', $theme->unknown_property);
2727

28-
// WP_Theme::get()
29-
assertType('string', $theme->get('Name'));
30-
assertType('string', $theme->get('ThemeURI'));
31-
assertType('string', $theme->get('Description'));
32-
assertType('string', $theme->get('Author'));
33-
assertType('string', $theme->get('AuthorURI'));
34-
assertType('string', $theme->get('Version'));
35-
assertType('string', $theme->get('Template'));
36-
assertType('string', $theme->get('Status'));
37-
assertType('array<string>', $theme->get('Tags'));
38-
assertType('string', $theme->get('TextDomain'));
39-
assertType('string', $theme->get('DomainPath'));
40-
assertType('string', $theme->get('RequiresWP'));
41-
assertType('string', $theme->get('RequiresPHP'));
42-
assertType('string', $theme->get('UpdateURI'));
43-
assertType('false', $theme->get('NoThemeHeader'));
44-
assertType('array<string>|string|false', $theme->get(Faker::string()));
45-
4628
// WP_Theme::offsetExists()
4729
assertType('false', $theme->offsetExists('NoThemeKey'));
4830
assertType('true', $theme->offsetExists('Name'));

wordpress-stubs.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57946,7 +57946,6 @@ public function cache_delete()
5794657946
* ? string|false
5794757947
* : false )
5794857948
* )
57949-
* @phpstan-return ($header is 'Name'|'ThemeURI'|'Description'|'Author'|'AuthorURI'|'Version'|'Template'|'Status'|'Tags'|'TextDomain'|'DomainPath'|'RequiresWP'|'RequiresPHP'|'UpdateURI' ? ($header is 'Tags' ? string[] : string) : false)
5795057949
*/
5795157950
public function get($header)
5795257951
{

0 commit comments

Comments
 (0)