Skip to content

Commit 374a34d

Browse files
committed
Update with latest framework version
1 parent e0386c5 commit 374a34d

File tree

5 files changed

+14
-18
lines changed

5 files changed

+14
-18
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
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",

src/Plugin_Command.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff 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';

src/WP_CLI/CommandWithUpgrade.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff 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();

src/WP_CLI/Fetchers/Plugin.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
/**
66
* Fetch a WordPress plugin based on one of its attributes.
7+
*
8+
* @extends Base<object{name: string, file: string}>
79
*/
810
class 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 ||

src/WP_CLI/Fetchers/Theme.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
/**
88
* Fetch a WordPress theme based on one of its attributes.
9+
*
10+
* @extends Base<\WP_Theme>
911
*/
1012
class 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
}

0 commit comments

Comments
 (0)