Updated Rector to commit a3d23752b85be3fbff187337ccbe461a4fe10f74

a3d23752b8 [DX] Add error message information for include full path to load internal phpstan bleedingEdge.neon config (#5635)
This commit is contained in:
Tomas Votruba 2024-02-18 19:27:49 +00:00
parent 35b646559b
commit d9e08f8aaf
2 changed files with 28 additions and 3 deletions

View File

@ -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
*/

View File

@ -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 = <<<MESSAGE_ERROR
'%s, use full path bleedingEdge.neon config, eg:
includes:
- phar://vendor/phpstan/phpstan/phpstan.phar/conf/bleedingEdge.neon
in your included phpstan configuration.
MESSAGE_ERROR;
public function __construct()
{
$containerFactory = new ContainerFactory(\getcwd());
$additionalConfigFiles = $this->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