Skip to content

Commit f5f21b3

Browse files
Gábor Tóthfabpot
Gábor Tóth
authored andcommitted
minor optimalization at bundle initialization
fast check to avoid six array method calls
1 parent a39d1f9 commit f5f21b3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Kernel.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ protected function initializeBundles()
495495
}
496496

497497
// look for orphans
498-
if (count($diff = array_values(array_diff(array_keys($directChildren), array_keys($this->bundles))))) {
498+
if (!empty($directChildren) && count($diff = array_values(array_diff(array_keys($directChildren), array_keys($this->bundles))))) {
499499
throw new \LogicException(sprintf('Bundle "%s" extends bundle "%s", which is not registered.', $directChildren[$diff[0]], $diff[0]));
500500
}
501501

0 commit comments

Comments
 (0)