Updated Rector to commit b9a912bb5d5c4966d2a7893aa3d12abe96a1ccfa

b9a912bb5d [DX] RectorConfig - add ruleWithConfiguration() and other methods (#2043)
This commit is contained in:
Tomas Votruba 2022-04-10 17:44:48 +00:00
parent 2807e577a5
commit a4e8d9fc7a
6 changed files with 47 additions and 19 deletions

View File

@ -4,6 +4,8 @@ declare (strict_types=1);
namespace Rector\Config;
use Rector\Core\Configuration\Option;
use Rector\Core\Contract\Rector\ConfigurableRectorInterface;
use Rector\Core\Contract\Rector\RectorInterface;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use RectorPrefix20220410\Webmozart\Assert\Assert;
/**
@ -46,4 +48,30 @@ final class RectorConfig extends \Symfony\Component\DependencyInjection\Loader\C
$parameters = $this->parameters();
$parameters->set(\Rector\Core\Configuration\Option::SKIP, $criteria);
}
public function autoImportNames() : void
{
$parameters = $this->parameters();
$parameters->set(\Rector\Core\Configuration\Option::AUTO_IMPORT_NAMES, \true);
}
/**
* Set PHPStan custom config to load extensions and custom configuration to Rector.
* By default, the "phpstan.neon" path is used.
*/
public function phpstanConfig(string $filePath) : void
{
\RectorPrefix20220410\Webmozart\Assert\Assert::fileExists($filePath);
$parameters = $this->parameters();
$parameters->set(\Rector\Core\Configuration\Option::PHPSTAN_FOR_RECTOR_PATH, $filePath);
}
/**
* @param class-string<ConfigurableRectorInterface&RectorInterface> $rectorClass
* @param mixed[] $configuration
*/
public function ruleWithConfiguration(string $rectorClass, array $configuration) : void
{
\RectorPrefix20220410\Webmozart\Assert\Assert::isAOf($rectorClass, \Rector\Core\Contract\Rector\RectorInterface::class);
\RectorPrefix20220410\Webmozart\Assert\Assert::isAOf($rectorClass, \Rector\Core\Contract\Rector\ConfigurableRectorInterface::class);
$services = $this->services();
$services->set($rectorClass)->configure($configuration);
}
}

View File

@ -16,11 +16,11 @@ final class VersionResolver
/**
* @var string
*/
public const PACKAGE_VERSION = 'd3bb21316ed6c640c3e902ccaaf1c47651cd54a6';
public const PACKAGE_VERSION = 'b9a912bb5d5c4966d2a7893aa3d12abe96a1ccfa';
/**
* @var string
*/
public const RELEASE_DATE = '2022-04-10 14:56:57';
public const RELEASE_DATE = '2022-04-10 19:36:55';
public static function resolvePackageVersion() : string
{
$process = new \RectorPrefix20220410\Symfony\Component\Process\Process(['git', 'log', '--pretty="%H"', '-n1', 'HEAD'], __DIR__);

2
vendor/autoload.php vendored
View File

@ -9,4 +9,4 @@ if (PHP_VERSION_ID < 50600) {
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInit0dada46498b45152ec23bc8eadbf8389::getLoader();
return ComposerAutoloaderInit5fde1ba4078f2b9e85edfecc2f522e04::getLoader();

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit0dada46498b45152ec23bc8eadbf8389
class ComposerAutoloaderInit5fde1ba4078f2b9e85edfecc2f522e04
{
private static $loader;
@ -22,19 +22,19 @@ class ComposerAutoloaderInit0dada46498b45152ec23bc8eadbf8389
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit0dada46498b45152ec23bc8eadbf8389', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit5fde1ba4078f2b9e85edfecc2f522e04', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInit0dada46498b45152ec23bc8eadbf8389', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit5fde1ba4078f2b9e85edfecc2f522e04', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit0dada46498b45152ec23bc8eadbf8389::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit5fde1ba4078f2b9e85edfecc2f522e04::getInitializer($loader));
$loader->setClassMapAuthoritative(true);
$loader->register(true);
$includeFiles = \Composer\Autoload\ComposerStaticInit0dada46498b45152ec23bc8eadbf8389::$files;
$includeFiles = \Composer\Autoload\ComposerStaticInit5fde1ba4078f2b9e85edfecc2f522e04::$files;
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequire0dada46498b45152ec23bc8eadbf8389($fileIdentifier, $file);
composerRequire5fde1ba4078f2b9e85edfecc2f522e04($fileIdentifier, $file);
}
return $loader;
@ -46,7 +46,7 @@ class ComposerAutoloaderInit0dada46498b45152ec23bc8eadbf8389
* @param string $file
* @return void
*/
function composerRequire0dada46498b45152ec23bc8eadbf8389($fileIdentifier, $file)
function composerRequire5fde1ba4078f2b9e85edfecc2f522e04($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;

View File

@ -4,7 +4,7 @@
namespace Composer\Autoload;
class ComposerStaticInit0dada46498b45152ec23bc8eadbf8389
class ComposerStaticInit5fde1ba4078f2b9e85edfecc2f522e04
{
public static $files = array (
'320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php',
@ -3858,9 +3858,9 @@ class ComposerStaticInit0dada46498b45152ec23bc8eadbf8389
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit0dada46498b45152ec23bc8eadbf8389::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit0dada46498b45152ec23bc8eadbf8389::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit0dada46498b45152ec23bc8eadbf8389::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInit5fde1ba4078f2b9e85edfecc2f522e04::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit5fde1ba4078f2b9e85edfecc2f522e04::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit5fde1ba4078f2b9e85edfecc2f522e04::$classMap;
}, null, ClassLoader::class);
}

View File

@ -9,8 +9,8 @@ $loader = require_once __DIR__.'/autoload.php';
if (!class_exists('AutoloadIncluder', false) && !interface_exists('AutoloadIncluder', false) && !trait_exists('AutoloadIncluder', false)) {
spl_autoload_call('RectorPrefix20220410\AutoloadIncluder');
}
if (!class_exists('ComposerAutoloaderInit0dada46498b45152ec23bc8eadbf8389', false) && !interface_exists('ComposerAutoloaderInit0dada46498b45152ec23bc8eadbf8389', false) && !trait_exists('ComposerAutoloaderInit0dada46498b45152ec23bc8eadbf8389', false)) {
spl_autoload_call('RectorPrefix20220410\ComposerAutoloaderInit0dada46498b45152ec23bc8eadbf8389');
if (!class_exists('ComposerAutoloaderInit5fde1ba4078f2b9e85edfecc2f522e04', false) && !interface_exists('ComposerAutoloaderInit5fde1ba4078f2b9e85edfecc2f522e04', false) && !trait_exists('ComposerAutoloaderInit5fde1ba4078f2b9e85edfecc2f522e04', false)) {
spl_autoload_call('RectorPrefix20220410\ComposerAutoloaderInit5fde1ba4078f2b9e85edfecc2f522e04');
}
if (!class_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false) && !interface_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false) && !trait_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false)) {
spl_autoload_call('RectorPrefix20220410\Helmich\TypoScriptParser\Parser\AST\Statement');
@ -59,9 +59,9 @@ if (!function_exists('print_node')) {
return \RectorPrefix20220410\print_node(...func_get_args());
}
}
if (!function_exists('composerRequire0dada46498b45152ec23bc8eadbf8389')) {
function composerRequire0dada46498b45152ec23bc8eadbf8389() {
return \RectorPrefix20220410\composerRequire0dada46498b45152ec23bc8eadbf8389(...func_get_args());
if (!function_exists('composerRequire5fde1ba4078f2b9e85edfecc2f522e04')) {
function composerRequire5fde1ba4078f2b9e85edfecc2f522e04() {
return \RectorPrefix20220410\composerRequire5fde1ba4078f2b9e85edfecc2f522e04(...func_get_args());
}
}
if (!function_exists('scanPath')) {