Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c922d67

Browse files
committed
minor symfony#9664 [HttpKernel] minor optimalization at bundle initialization (fabpot)
This PR was merged into the 2.2 branch. Discussion ---------- [HttpKernel] minor optimalization at bundle initialization fast check to avoid six array method calls | Q | A | ------------- | --- | Bug fix? | [no] | New feature? | [no] | BC breaks? | [no] | Deprecations? | [|no] | Tests pass? | [yes] | Fixed tickets | symfony#9657 | License | MIT | Doc PR | That's a rebased version of symfony#9657 on 2.2 + another optimization suggested by @GromNaN Commits ------- 3330c40 [HttpKernel] made a small optimization to Bundle initialization 4ba6c0b minor optimalization at bundle initialization
2 parents b82ab2a + 3330c40 commit c922d67

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Symfony/Component/HttpKernel/Kernel.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,9 @@ 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_diff_key($directChildren, $this->bundles))) {
499+
$diff = array_keys($diff);
500+
499501
throw new \LogicException(sprintf('Bundle "%s" extends bundle "%s", which is not registered.', $directChildren[$diff[0]], $diff[0]));
500502
}
501503

0 commit comments

Comments
 (0)