Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c922d67

Browse filesBrowse files
committed
minor #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 | #9657 | License | MIT | Doc PR | That's a rebased version of #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
Copy full SHA for c922d67

File tree

1 file changed

+3
-1
lines changed
Filter options

1 file changed

+3
-1
lines changed

‎src/Symfony/Component/HttpKernel/Kernel.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpKernel/Kernel.php
+3-1Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.