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

Skip to content

Commit e726221

Browse files
committed
Simplified code
1 parent 7da6759 commit e726221

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/Symfony/Component/HttpKernel/Kernel.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -484,10 +484,10 @@ protected function initializeContainer()
484484
$cacheDir = $this->warmupDir ?: $this->getCacheDir();
485485
$cache = new ConfigCache($cacheDir.'/'.$class.'.php', $this->debug);
486486
$oldContainer = null;
487-
if ($fresh = $cache->isFresh()) {
487+
if ($cache->isFresh()) {
488488
// Silence E_WARNING to ignore "include" failures - don't use "@" to prevent silencing fatal errors
489489
$errorLevel = error_reporting(\E_ALL ^ \E_WARNING);
490-
$fresh = $oldContainer = false;
490+
$oldContainer = false;
491491
try {
492492
if (!$asFiles) {
493493
require_once $cache->getPath();
@@ -498,19 +498,15 @@ protected function initializeContainer()
498498
}
499499
if (file_exists($cache->getPath()) && \is_object($this->container = include $cache->getPath())) {
500500
$this->container->set('kernel', $this);
501-
$oldContainer = $this->container;
502-
$fresh = true;
501+
502+
return;
503503
}
504504
} catch (\Throwable $e) {
505505
} finally {
506506
error_reporting($errorLevel);
507507
}
508508
}
509509

510-
if ($fresh) {
511-
return;
512-
}
513-
514510
if ($this->debug) {
515511
$collectedLogs = [];
516512
$previousHandler = \defined('PHPUNIT_COMPOSER_INSTALL');

0 commit comments

Comments
 (0)