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:
hamed
2026-06-28 17:17:46 +03:30
parent 8b96753df6
commit e456809b55
2 changed files with 17 additions and 3 deletions
+1 -3
View File
@@ -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::#'
+16
View File
@@ -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();