mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-05 02:40:50 +00:00
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:
parent
35b646559b
commit
d9e08f8aaf
|
@ -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
|
||||
*/
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user