diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index 97cb56a65da..762d06d7bd9 100644 --- a/src/Application/VersionResolver.php +++ b/src/Application/VersionResolver.php @@ -19,12 +19,12 @@ final class VersionResolver * @api * @var string */ - public const PACKAGE_VERSION = '914349ca92cb1df4463b46f541c6e249045bd4ca'; + public const PACKAGE_VERSION = 'a3d23752b85be3fbff187337ccbe461a4fe10f74'; /** * @api * @var string */ - public const RELEASE_DATE = '2024-02-19 01:30:31'; + public const RELEASE_DATE = '2024-02-18 20:25:31'; /** * @var int */ diff --git a/src/NodeTypeResolver/DependencyInjection/PHPStanServicesFactory.php b/src/NodeTypeResolver/DependencyInjection/PHPStanServicesFactory.php index 98099e96d02..c699cc2013f 100644 --- a/src/NodeTypeResolver/DependencyInjection/PHPStanServicesFactory.php +++ b/src/NodeTypeResolver/DependencyInjection/PHPStanServicesFactory.php @@ -3,6 +3,7 @@ declare (strict_types=1); namespace Rector\NodeTypeResolver\DependencyInjection; +use Throwable; use PhpParser\Lexer; use PHPStan\Analyser\NodeScopeResolver; use PHPStan\Analyser\ScopeFactory; @@ -15,6 +16,9 @@ use PHPStan\Reflection\ReflectionProvider; use Rector\Configuration\Option; use Rector\Configuration\Parameter\SimpleParameterProvider; use Rector\NodeTypeResolver\Reflection\BetterReflection\SourceLocatorProvider\DynamicSourceLocatorProvider; +use RectorPrefix202402\Symfony\Component\Console\Input\ArrayInput; +use RectorPrefix202402\Symfony\Component\Console\Output\ConsoleOutput; +use RectorPrefix202402\Symfony\Component\Console\Style\SymfonyStyle; use RectorPrefix202402\Webmozart\Assert\Assert; /** * Factory so Symfony app can use services from PHPStan container @@ -28,11 +32,32 @@ final class PHPStanServicesFactory * @var \PHPStan\DependencyInjection\Container */ private $container; + /** + * @var string + */ + private const INVALID_BLEEDING_EDGE_PATH_MESSAGE = <<resolveAdditionalConfigFiles(); - $this->container = $containerFactory->create(SimpleParameterProvider::provideStringParameter(Option::CONTAINER_CACHE_DIRECTORY), $additionalConfigFiles, []); + try { + $this->container = $containerFactory->create(SimpleParameterProvider::provideStringParameter(Option::CONTAINER_CACHE_DIRECTORY), $additionalConfigFiles, []); + } catch (Throwable $throwable) { + if ($throwable->getMessage() === "File 'phar://phpstan.phar/conf/bleedingEdge.neon' is missing or is not readable.") { + $symfonyStyle = new SymfonyStyle(new ArrayInput([]), new ConsoleOutput()); + $symfonyStyle->error(\sprintf(self::INVALID_BLEEDING_EDGE_PATH_MESSAGE, $throwable->getMessage())); + exit(-1); + } + throw $throwable; + } } /** * @api