fix(devops): repair phpstan config so static analysis runs again
- container_xml_path -> containerXmlPath (phpstan-symfony v2 rename); the old key made phpstan abort with an invalid-configuration error, so analysis silently never ran - add the missing tests/doctrine_object_manager.php loader - drop a stale ignoreErrors pattern phpstan now runs and surfaces 42 pre-existing level-5 errors (tracked separately).
This commit is contained in:
+1
-3
@@ -7,8 +7,6 @@ parameters:
|
||||
paths:
|
||||
- src
|
||||
symfony:
|
||||
container_xml_path: var/cache/dev/App_KernelDevDebugContainer.xml
|
||||
containerXmlPath: var/cache/dev/App_KernelDevDebugContainer.xml
|
||||
doctrine:
|
||||
objectManagerLoader: tests/doctrine_object_manager.php
|
||||
ignoreErrors:
|
||||
- '#Call to an undefined method Doctrine\\ORM\\QueryBuilder::#'
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
// Loader used by phpstan-doctrine to resolve entity metadata for static analysis.
|
||||
// Boots the Symfony kernel and returns the default EntityManager.
|
||||
|
||||
use App\Kernel;
|
||||
use Symfony\Component\Dotenv\Dotenv;
|
||||
|
||||
require __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
(new Dotenv())->bootEnv(__DIR__ . '/../.env');
|
||||
|
||||
$kernel = new Kernel($_SERVER['APP_ENV'] ?? 'dev', (bool) ($_SERVER['APP_DEBUG'] ?? true));
|
||||
$kernel->boot();
|
||||
|
||||
return $kernel->getContainer()->get('doctrine')->getManager();
|
||||
Reference in New Issue
Block a user