Skip to content

Commit 7a688c7

Browse files
committed
Refactor missing-dependencies check for readability
1 parent 5c80d79 commit 7a688c7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/wp-includes/class-wp-dependencies.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,11 @@ public function all_deps( $handles, $recursion = false, $group = false ) {
199199
continue;
200200
}
201201

202-
$keep_going = true;
203-
$missing_dependencies = ( isset( $this->registered[ $handle ] ) && $this->registered[ $handle ]->deps ) ? array_diff( $this->registered[ $handle ]->deps, array_keys( $this->registered ) ) : array();
202+
$keep_going = true;
203+
$missing_dependencies = array();
204+
if ( isset( $this->registered[ $handle ] ) && $this->registered[ $handle ]->deps ) {
205+
$missing_dependencies = array_diff( $this->registered[ $handle ]->deps, array_keys( $this->registered ) );
206+
}
204207
if ( ! isset( $this->registered[ $handle ] ) ) {
205208
$keep_going = false; // Item doesn't exist.
206209
} elseif ( $missing_dependencies ) {

0 commit comments

Comments
 (0)