diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon deleted file mode 100644 index a3c635de..00000000 --- a/phpstan-baseline.neon +++ /dev/null @@ -1,6 +0,0 @@ -parameters: - ignoreErrors: - - - message: "#^Instantiated class ProjectServiceContainer not found\\.$#" - count: 1 - path: src/Cli/Symfony/ConsoleKernel.php diff --git a/phpstan.neon b/phpstan.neon index c24238a5..83c659ee 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,5 +1,3 @@ -includes: - - phpstan-baseline.neon parameters: level: 8 editorUrl: 'phpstorm://open?file=%%file%%&line=%%line%%' diff --git a/src/Cli/Symfony/ConsoleKernel.php b/src/Cli/Symfony/ConsoleKernel.php index b1afbe8f..bca8c08a 100644 --- a/src/Cli/Symfony/ConsoleKernel.php +++ b/src/Cli/Symfony/ConsoleKernel.php @@ -105,8 +105,13 @@ private function initializeContainer(): void if (file_exists($file)) { require_once $file; + if (!class_exists(\ProjectServiceContainer::class, false)) { + throw new \UnexpectedValueException('Class ProjectServiceContainer does not exist'); + } + /** @var Container $container */ $container = new \ProjectServiceContainer(); + } else { $container = new ContainerBuilder(); $loader = new PhpFileLoader($container, new FileLocator());