File tree Expand file tree Collapse file tree 5 files changed +14
-18
lines changed
Expand file tree Collapse file tree 5 files changed +14
-18
lines changed Original file line number Diff line number Diff line change 1818 ],
1919 "require" : {
2020 "composer/semver" : " ^1.4 || ^2 || ^3" ,
21- "wp-cli/wp-cli" : " ^2.12 "
21+ "wp-cli/wp-cli" : " ^2.13 "
2222 },
2323 "require-dev" : {
2424 "wp-cli/cache-command" : " ^2.0" ,
Original file line number Diff line number Diff line change @@ -69,15 +69,6 @@ class Plugin_Command extends CommandWithUpgrade {
6969 'auto_update ' ,
7070 );
7171
72- /**
73- * Plugin fetcher instance.
74- *
75- * @var \WP_CLI\Fetchers\Plugin
76- *
77- * @phpstan-ignore property.phpDocType (To be fixed with in https://github.com/wp-cli/wp-cli/pull/6096)
78- */
79- protected $ fetcher ;
80-
8172 public function __construct () {
8273 require_once ABSPATH . 'wp-admin/includes/plugin.php ' ;
8374 require_once ABSPATH . 'wp-admin/includes/plugin-install.php ' ;
Original file line number Diff line number Diff line change @@ -67,6 +67,9 @@ function () {
6767 $ this ->fetcher = new Fetchers \Plugin ();
6868 }
6969
70+ /**
71+ * @return class-string<\WP_Upgrader>
72+ */
7073 abstract protected function get_upgrader_class ( $ force );
7174
7275 abstract protected function get_item_list ();
Original file line number Diff line number Diff line change 44
55/**
66 * Fetch a WordPress plugin based on one of its attributes.
7+ *
8+ * @extends Base<object{name: string, file: string}>
79 */
810class Plugin extends Base {
911
@@ -15,12 +17,12 @@ class Plugin extends Base {
1517 /**
1618 * Get a plugin object by name
1719 *
18- * @param string $name Plugin name.
20+ * @param string|int $name Plugin name.
1921 * @return object{name: string, file: string}|false
20- *
21- * @phpstan-ignore method.childParameterType (To be fixed with in https://github.com/wp-cli/wp-cli/pull/6096)
2222 */
2323 public function get ( $ name ) {
24+ $ name = (string ) $ name ;
25+
2426 // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- Calling native WordPress hook.
2527 foreach ( apply_filters ( 'all_plugins ' , get_plugins () ) as $ file => $ _ ) {
2628 if ( "$ name.php " === $ file ||
Original file line number Diff line number Diff line change 66
77/**
88 * Fetch a WordPress theme based on one of its attributes.
9+ *
10+ * @extends Base<\WP_Theme>
911 */
1012class Theme extends Base {
1113
@@ -17,18 +19,16 @@ class Theme extends Base {
1719 /**
1820 * Get a theme object by name
1921 *
20- * @param string $name
21- * @return object|false
22- *
23- * @phpstan-ignore method.childParameterType (To be fixed with in https://github.com/wp-cli/wp-cli/pull/6096)
22+ * @param string|int $name
23+ * @return \WP_Theme|false
2424 */
2525 public function get ( $ name ) {
2626 // Workaround to equalize folder naming conventions across Win/Mac/Linux.
2727 // Returns false if theme stylesheet doesn't exactly match existing themes.
2828 $ existing_themes = wp_get_themes ( array ( 'errors ' => null ) );
2929 $ existing_stylesheets = array_keys ( $ existing_themes );
3030 if ( ! in_array ( $ name , $ existing_stylesheets , true ) ) {
31- $ inexact_match = $ this ->find_inexact_match ( $ name , $ existing_themes );
31+ $ inexact_match = $ this ->find_inexact_match ( ( string ) $ name , $ existing_themes );
3232 if ( false !== $ inexact_match ) {
3333 $ this ->msg .= sprintf ( " Did you mean '%s'? " , $ inexact_match );
3434 }
You can’t perform that action at this time.
0 commit comments