Skip to content

Commit 7c89401

Browse files
committed
PHPStan fix
1 parent 68cb95c commit 7c89401

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

src/Theme_Command.php

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -170,21 +170,11 @@ public function check_update( $args, $assoc_args ) {
170170
// Filter to only themes with available updates
171171
$items_with_updates = array_filter(
172172
$items,
173-
function ( $item ) {
174-
return 'available' === $item['update'];
173+
function ( $item ) use ( $args ) {
174+
return in_array( $item['name'], $args, true ) && 'available' === $item['update'];
175175
}
176176
);
177177

178-
// If specific themes requested, filter to those
179-
if ( ! empty( $args ) ) {
180-
$items_with_updates = array_filter(
181-
$items_with_updates,
182-
function ( $item ) use ( $args ) {
183-
return in_array( $item['name'], $args, true );
184-
}
185-
);
186-
}
187-
188178
if ( empty( $items_with_updates ) ) {
189179
WP_CLI::success( 'All themes are up to date.' );
190180
return;

0 commit comments

Comments
 (0)