Created
December 14, 2021 16:01
-
-
Save bastienapp/a59fc9bc7c3bbc8128f75a2d9ddaf7ba to your computer and use it in GitHub Desktop.
Fix PHPStan with Doctrine
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// this file is in tests/object-manager.php | |
use App\Kernel; | |
use Symfony\Component\Dotenv\Dotenv; | |
require __DIR__ . '/../vendor/autoload.php'; | |
(new Dotenv())->bootEnv(__DIR__ . '/../.env'); | |
$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']); | |
$kernel->boot(); | |
/** @var \Doctrine\Bundle\DoctrineBundle\Registry */ | |
$doctrine = $kernel->getContainer()->get('doctrine'); | |
return $doctrine->getManager(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
includes: | |
- vendor/phpstan/phpstan-doctrine/extension.neon | |
- vendor/phpstan/phpstan-doctrine/rules.neon | |
- vendor/phpstan/phpstan-symfony/extension.neon | |
parameters: | |
excludePaths: | |
- src/DataFixtures | |
- src/Security | |
ignoreErrors: | |
- '#Call to an undefined method [a-zA-Z0-9\\_]+::findOneBy[A-Z][a-zA-Z]*\(\)#' | |
- '#Call to an undefined method [a-zA-Z0-9\\_]+::findBy[A-Z][a-zA-Z]*\(\)#' | |
reportUnmatchedIgnoredErrors: false | |
checkGenericClassInNonGenericObjectType: false | |
checkMissingIterableValueType: false | |
doctrine: | |
objectManagerLoader: tests/object-manager.php |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment