Skip to content

Commit 12d5b3b

Browse files
committed
Merge branch '5.4' into 6.0
* 5.4: Fix colors for 4.4 Stand with Ukraine [Runtime] Fix passing $debug parameter to `ErrorHandler` [FrameworkBundle] Ensure container is reset between tests [HttpKernel] fix using Target with controller args Remove blocking test for adding support for placeholders in EmumNode in 6.1 [FrameworkBundle] Fix compiler passes processing a container twice when it's loaded from the debug dump [HttpKernel] Fix advertizing deprecations for *TestSessionListener
2 parents 284d16a + 0185a3b commit 12d5b3b

File tree

4 files changed

+15
-1
lines changed

4 files changed

+15
-1
lines changed

Command/BuildDebugContainerTrait.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ protected function getContainerBuilder(KernelInterface $kernel): ContainerBuilde
5353
(new XmlFileLoader($container = new ContainerBuilder(), new FileLocator()))->load($kernel->getContainer()->getParameter('debug.container.dump'));
5454
$locatorPass = new ServiceLocatorTagPass();
5555
$locatorPass->process($container);
56+
57+
$container->getCompilerPassConfig()->setBeforeOptimizationPasses([]);
58+
$container->getCompilerPassConfig()->setOptimizationPasses([]);
59+
$container->getCompilerPassConfig()->setBeforeRemovingPasses([]);
5660
}
5761

5862
return $this->containerBuilder = $container;

Command/ContainerLintCommand.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,10 @@ private function getContainerBuilder(): ContainerBuilder
113113
$skippedIds[$serviceId] = true;
114114
}
115115
}
116+
117+
$container->getCompilerPassConfig()->setBeforeOptimizationPasses([]);
118+
$container->getCompilerPassConfig()->setOptimizationPasses([]);
119+
$container->getCompilerPassConfig()->setBeforeRemovingPasses([]);
116120
}
117121

118122
$container->setParameter('container.build_hash', 'lint_container');

Console/Application.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ public function all(string $namespace = null): array
145145
*/
146146
public function getLongVersion(): string
147147
{
148-
return parent::getLongVersion().sprintf(' (env: <comment>%s</>, debug: <comment>%s</>)', $this->kernel->getEnvironment(), $this->kernel->isDebug() ? 'true' : 'false');
148+
return parent::getLongVersion().sprintf(' (env: <comment>%s</>, debug: <comment>%s</>) <bg=blue;fg=yellow>#StandWith</><bg=yellow;fg=blue>Ukraine</> <href=https://sf.to/ukraine>https://sf.to/ukraine</>', $this->kernel->getEnvironment(), $this->kernel->isDebug() ? 'true' : 'false');
149149
}
150150

151151
public function add(Command $command): ?Command

Test/KernelTestCase.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Symfony\Component\DependencyInjection\ContainerInterface;
1616
use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;
1717
use Symfony\Component\HttpKernel\KernelInterface;
18+
use Symfony\Contracts\Service\ResetInterface;
1819

1920
/**
2021
* KernelTestCase is the base class for tests needing a Kernel.
@@ -139,8 +140,13 @@ protected static function ensureKernelShutdown()
139140
{
140141
if (null !== static::$kernel) {
141142
static::$kernel->boot();
143+
$container = static::$kernel->getContainer();
142144
static::$kernel->shutdown();
143145
static::$booted = false;
146+
147+
if ($container instanceof ResetInterface) {
148+
$container->reset();
149+
}
144150
}
145151
}
146152
}

0 commit comments

Comments
 (0)