mirror of
https://github.com/rectorphp/rector.git
synced 2025-03-23 08:49:48 +01:00
Updated Rector to commit 41de61755c1f982ec554b6037a724abe708bfa27
41de61755c
Add possibility to add multiple phpstan configs (#4798)
This commit is contained in:
parent
2ec1804078
commit
1f6016e697
@ -111,13 +111,25 @@ final class RectorConfig extends Container
|
||||
SimpleParameterProvider::setParameter(Option::IMPORT_SHORT_CLASSES, $importShortClasses);
|
||||
}
|
||||
/**
|
||||
* Set PHPStan custom config to load extensions and custom configuration to Rector.
|
||||
* By default, the "phpstan.neon" path is used.
|
||||
* Add PHPStan custom config to load extensions and custom configuration to Rector.
|
||||
*/
|
||||
public function phpstanConfig(string $filePath) : void
|
||||
{
|
||||
Assert::fileExists($filePath);
|
||||
SimpleParameterProvider::setParameter(Option::PHPSTAN_FOR_RECTOR_PATH, $filePath);
|
||||
$paths = SimpleParameterProvider::provideArrayParameter(Option::PHPSTAN_FOR_RECTOR_PATHS);
|
||||
$paths[] = $filePath;
|
||||
SimpleParameterProvider::setParameter(Option::PHPSTAN_FOR_RECTOR_PATHS, $paths);
|
||||
}
|
||||
/**
|
||||
* Add PHPStan custom configs to load extensions and custom configuration to Rector.
|
||||
*
|
||||
* @param string[] $filePaths
|
||||
*/
|
||||
public function phpstanConfigs(array $filePaths) : void
|
||||
{
|
||||
foreach ($filePaths as $filePath) {
|
||||
$this->phpstanConfig($filePath);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @param class-string<ConfigurableRectorInterface&RectorInterface> $rectorClass
|
||||
|
@ -16,6 +16,7 @@ use Rector\Core\Configuration\Option;
|
||||
use Rector\Core\Configuration\Parameter\SimpleParameterProvider;
|
||||
use Rector\NodeTypeResolver\Reflection\BetterReflection\SourceLocatorProvider\DynamicSourceLocatorProvider;
|
||||
use RectorPrefix202308\Symfony\Component\Filesystem\Filesystem;
|
||||
use RectorPrefix202308\Webmozart\Assert\Assert;
|
||||
/**
|
||||
* Factory so Symfony app can use services from PHPStan container
|
||||
*
|
||||
@ -119,8 +120,12 @@ final class PHPStanServicesFactory
|
||||
private function resolveAdditionalConfigFiles() : array
|
||||
{
|
||||
$additionalConfigFiles = [];
|
||||
if (SimpleParameterProvider::hasParameter(Option::PHPSTAN_FOR_RECTOR_PATH)) {
|
||||
$additionalConfigFiles[] = SimpleParameterProvider::provideStringParameter(Option::PHPSTAN_FOR_RECTOR_PATH);
|
||||
if (SimpleParameterProvider::hasParameter(Option::PHPSTAN_FOR_RECTOR_PATHS)) {
|
||||
$paths = SimpleParameterProvider::provideArrayParameter(Option::PHPSTAN_FOR_RECTOR_PATHS);
|
||||
foreach ($paths as $path) {
|
||||
Assert::string($path);
|
||||
$additionalConfigFiles[] = $path;
|
||||
}
|
||||
}
|
||||
$additionalConfigFiles[] = __DIR__ . '/../../../config/phpstan/static-reflection.neon';
|
||||
$additionalConfigFiles[] = __DIR__ . '/../../../config/phpstan/better-infer.neon';
|
||||
|
@ -19,12 +19,12 @@ final class VersionResolver
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = 'a6532a2f295056321924f67b110e79411b95aa50';
|
||||
public const PACKAGE_VERSION = '41de61755c1f982ec554b6037a724abe708bfa27';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2023-08-16 18:11:20';
|
||||
public const RELEASE_DATE = '2023-08-16 23:46:58';
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
|
@ -124,7 +124,7 @@ final class Option
|
||||
* @internal Use @see \Rector\Config\RectorConfig::phpstanConfig() instead
|
||||
* @var string
|
||||
*/
|
||||
public const PHPSTAN_FOR_RECTOR_PATH = 'phpstan_for_rector_path';
|
||||
public const PHPSTAN_FOR_RECTOR_PATHS = 'phpstan_for_rector_paths';
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
|
2
vendor/autoload.php
vendored
2
vendor/autoload.php
vendored
@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) {
|
||||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInitefab334373889163798290c927ac1463::getLoader();
|
||||
return ComposerAutoloaderInita98ab5d27d114088f46189c43c1c70f3::getLoader();
|
||||
|
10
vendor/composer/autoload_real.php
vendored
10
vendor/composer/autoload_real.php
vendored
@ -2,7 +2,7 @@
|
||||
|
||||
// autoload_real.php @generated by Composer
|
||||
|
||||
class ComposerAutoloaderInitefab334373889163798290c927ac1463
|
||||
class ComposerAutoloaderInita98ab5d27d114088f46189c43c1c70f3
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
@ -22,17 +22,17 @@ class ComposerAutoloaderInitefab334373889163798290c927ac1463
|
||||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInitefab334373889163798290c927ac1463', 'loadClassLoader'), true, true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInita98ab5d27d114088f46189c43c1c70f3', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInitefab334373889163798290c927ac1463', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInita98ab5d27d114088f46189c43c1c70f3', 'loadClassLoader'));
|
||||
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInitefab334373889163798290c927ac1463::getInitializer($loader));
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInita98ab5d27d114088f46189c43c1c70f3::getInitializer($loader));
|
||||
|
||||
$loader->setClassMapAuthoritative(true);
|
||||
$loader->register(true);
|
||||
|
||||
$filesToLoad = \Composer\Autoload\ComposerStaticInitefab334373889163798290c927ac1463::$files;
|
||||
$filesToLoad = \Composer\Autoload\ComposerStaticInita98ab5d27d114088f46189c43c1c70f3::$files;
|
||||
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
|
||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
||||
|
8
vendor/composer/autoload_static.php
vendored
8
vendor/composer/autoload_static.php
vendored
@ -4,7 +4,7 @@
|
||||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
class ComposerStaticInitefab334373889163798290c927ac1463
|
||||
class ComposerStaticInita98ab5d27d114088f46189c43c1c70f3
|
||||
{
|
||||
public static $files = array (
|
||||
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
|
||||
@ -2637,9 +2637,9 @@ class ComposerStaticInitefab334373889163798290c927ac1463
|
||||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInitefab334373889163798290c927ac1463::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInitefab334373889163798290c927ac1463::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInitefab334373889163798290c927ac1463::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInita98ab5d27d114088f46189c43c1c70f3::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInita98ab5d27d114088f46189c43c1c70f3::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInita98ab5d27d114088f46189c43c1c70f3::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user