mirror of
https://github.com/symfony/recipes-contrib.git
synced 2026-09-20 11:56:25 +03:00
* [Kocal/SymfonyAppPack] Add recipe * Remove Makefile from copy-from-recipe
27 lines
774 B
PHP
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,
|
|
],
|
|
],
|
|
];
|