Files
symfony-flex-recipes-contrib/kocal/symfony-app-pack/1.0/tools/phpstan/object-manager.php
T
Hugo AlliaumeandGitHub cdc5b03530 [Kocal/SymfonyAppPack] Add recipe (#1936)
* [Kocal/SymfonyAppPack] Add recipe

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

23 lines
555 B
PHP

<?php
/**
* This file is used by PHPStan, see https://github.com/phpstan/phpstan-symfony#console-command-analysis.
*/
declare(strict_types=1);
use App\Kernel;
use Doctrine\ORM\EntityManager;
use Symfony\Component\Dotenv\Dotenv;
new Dotenv()->bootEnv(__DIR__ . '/../../.env');
// @phpstan-ignore-next-line argument.type
$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
$kernel->boot();
/** @var EntityManager $entityManager */
$entityManager = $kernel->getContainer()->get('doctrine')->getManager();
return $entityManager;