Skip to content

Commit 023da3b

Browse files
authored
Merge pull request #147 from wp-cli/fix-phpstan
2 parents 2aa6575 + f26bcdd commit 023da3b

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
}
1313
],
1414
"require": {
15-
"wp-cli/wp-cli": "^2.12"
15+
"wp-cli/wp-cli": "^2.13"
1616
},
1717
"require-dev": {
1818
"wp-cli/extension-command": "^1.2 || ^2",

src/WP_CLI/Fetchers/UnfilteredPlugin.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* `all_plugins` filter, so that plugins cannot hide themselves from the
1010
* checks.
1111
*
12+
* @extends Base<object{name: string, file: string}>
1213
*/
1314
class UnfilteredPlugin extends Base {
1415

@@ -22,9 +23,11 @@ class UnfilteredPlugin extends Base {
2223
*
2324
* @param string|int $name
2425
*
25-
* @return object|false
26+
* @return object{name: string, file: string}|false
2627
*/
2728
public function get( $name ) {
29+
$name = (string) $name;
30+
2831
foreach ( get_plugins() as $file => $_ ) {
2932
if ( "{$name}.php" === $file ||
3033
( $name && $file === $name ) ||

0 commit comments

Comments
 (0)