Files
archived-recipes-contrib/kocal/symfony-app-pack/1.0/tools/phpstan/symfony-configuration.php
Hugo Alliaume cdc5b03530 [Kocal/SymfonyAppPack] Add recipe (#1936)
* [Kocal/SymfonyAppPack] Add recipe

* Remove Makefile from copy-from-recipe
2026-02-11 03:01:04 +04:00

27 lines
774 B
PHP

<?php
declare(strict_types=1);
require __DIR__ . '/../../vendor/autoload.php';
$env = getenv('APP_ENV') ?: 'test';
$xmlContainerFile = __DIR__ . sprintf('/../../var/cache/%s/App_Kernel%sDebugContainer.xml', $env, ucfirst($env));
if (! file_exists($xmlContainerFile)) {
throw new RuntimeException(sprintf(<<<ERROR
PHPStan depends on the meta information the Symfony Dependency Injection that the compiler pass writes.
The meta xml file could not be found: %s.
To compile the Symfony container do a cache:clear in the current env (%s) with debug: true!
ERROR, $xmlContainerFile, $env));
}
return [
'parameters' => [
'symfony' => [
'containerXmlPath' => $xmlContainerFile,
],
],
];