mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-17 13:28:18 +01:00
Updated Rector to commit 00dd0eb4ca6672cf8856aaec0ae3211c13078397
00dd0eb4ca
[Core] Refactor init command to use LevelSetList::UP_TO_PHP_XY set list (#1328)
This commit is contained in:
parent
3d98187ea1
commit
0d05a7606d
@ -16,11 +16,11 @@ final class VersionResolver
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = '39a530c1f5b4cb2cbb6cca37b9e6947d735bac14';
|
||||
public const PACKAGE_VERSION = '00dd0eb4ca6672cf8856aaec0ae3211c13078397';
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2021-11-28 16:45:10';
|
||||
public const RELEASE_DATE = '2021-11-28 17:59:11';
|
||||
public static function resolvePackageVersion() : string
|
||||
{
|
||||
$process = new \RectorPrefix20211128\Symfony\Component\Process\Process(['git', 'log', '--pretty="%H"', '-n1', 'HEAD'], __DIR__);
|
||||
|
@ -3,9 +3,11 @@
|
||||
declare (strict_types=1);
|
||||
namespace Rector\Core\Console\Command;
|
||||
|
||||
use RectorPrefix20211128\Nette\Utils\Strings;
|
||||
use Rector\Core\Configuration\Option;
|
||||
use Rector\Core\Contract\Template\TemplateResolverInterface;
|
||||
use Rector\Core\Exception\Template\TemplateTypeNotFoundException;
|
||||
use Rector\Core\Php\PhpVersionProvider;
|
||||
use Rector\Core\Template\DefaultResolver;
|
||||
use Stringable;
|
||||
use RectorPrefix20211128\Symfony\Component\Console\Command\Command;
|
||||
@ -33,15 +35,20 @@ final class InitCommand extends \RectorPrefix20211128\Symfony\Component\Console\
|
||||
* @var \Rector\Core\Contract\Template\TemplateResolverInterface[]
|
||||
*/
|
||||
private $templateResolvers;
|
||||
/**
|
||||
* @var \Rector\Core\Php\PhpVersionProvider
|
||||
*/
|
||||
private $phpVersionProvider;
|
||||
/**
|
||||
* @param TemplateResolverInterface[] $templateResolvers
|
||||
*/
|
||||
public function __construct(\RectorPrefix20211128\Symplify\SmartFileSystem\FileSystemGuard $fileSystemGuard, \RectorPrefix20211128\Symplify\SmartFileSystem\SmartFileSystem $smartFileSystem, \RectorPrefix20211128\Symfony\Component\Console\Style\SymfonyStyle $symfonyStyle, array $templateResolvers)
|
||||
public function __construct(\RectorPrefix20211128\Symplify\SmartFileSystem\FileSystemGuard $fileSystemGuard, \RectorPrefix20211128\Symplify\SmartFileSystem\SmartFileSystem $smartFileSystem, \RectorPrefix20211128\Symfony\Component\Console\Style\SymfonyStyle $symfonyStyle, array $templateResolvers, \Rector\Core\Php\PhpVersionProvider $phpVersionProvider)
|
||||
{
|
||||
$this->fileSystemGuard = $fileSystemGuard;
|
||||
$this->smartFileSystem = $smartFileSystem;
|
||||
$this->symfonyStyle = $symfonyStyle;
|
||||
$this->templateResolvers = $templateResolvers;
|
||||
$this->phpVersionProvider = $phpVersionProvider;
|
||||
parent::__construct();
|
||||
}
|
||||
protected function configure() : void
|
||||
@ -64,6 +71,11 @@ final class InitCommand extends \RectorPrefix20211128\Symfony\Component\Console\
|
||||
$this->symfonyStyle->warning('Config file "rector.php" already exists');
|
||||
} else {
|
||||
$this->smartFileSystem->copy($rectorTemplateFilePath, $rectorRootFilePath);
|
||||
$fullPHPVersion = (string) $this->phpVersionProvider->provide();
|
||||
$phpVersion = \RectorPrefix20211128\Nette\Utils\Strings::substring($fullPHPVersion, 0, 1) . \RectorPrefix20211128\Nette\Utils\Strings::substring($fullPHPVersion, 2, 1);
|
||||
$fileContent = $this->smartFileSystem->readFile($rectorRootFilePath);
|
||||
$fileContent = \str_replace('LevelSetList::UP_TO_PHP_XY', \sprintf('LevelSetList::UP_TO_PHP_%d', $phpVersion), $fileContent);
|
||||
$this->smartFileSystem->dumpFile($rectorRootFilePath, $fileContent);
|
||||
$this->symfonyStyle->success('"rector.php" config file was added');
|
||||
}
|
||||
return \RectorPrefix20211128\Symfony\Component\Console\Command\Command::SUCCESS;
|
||||
|
@ -4,7 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
use Rector\Core\Configuration\Option;
|
||||
use Rector\Php74\Rector\Property\TypedPropertyRector;
|
||||
use Rector\Set\ValueObject\SetList;
|
||||
use Rector\Set\ValueObject\LevelSetList;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
@ -15,7 +15,7 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
]);
|
||||
|
||||
// Define what rule sets will be applied
|
||||
$containerConfigurator->import(SetList::DEAD_CODE);
|
||||
$containerConfigurator->import(LevelSetList::UP_TO_PHP_XY);
|
||||
|
||||
// get services (needed for register a single rule)
|
||||
// $services = $containerConfigurator->services();
|
||||
|
2
vendor/autoload.php
vendored
2
vendor/autoload.php
vendored
@ -4,4 +4,4 @@
|
||||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInita4f4075db4c53dc5c814f34f3ee877ca::getLoader();
|
||||
return ComposerAutoloaderInitb59f8cb8d17ba6f6ba55e8ad5b82bbad::getLoader();
|
||||
|
14
vendor/composer/autoload_real.php
vendored
14
vendor/composer/autoload_real.php
vendored
@ -2,7 +2,7 @@
|
||||
|
||||
// autoload_real.php @generated by Composer
|
||||
|
||||
class ComposerAutoloaderInita4f4075db4c53dc5c814f34f3ee877ca
|
||||
class ComposerAutoloaderInitb59f8cb8d17ba6f6ba55e8ad5b82bbad
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
@ -22,15 +22,15 @@ class ComposerAutoloaderInita4f4075db4c53dc5c814f34f3ee877ca
|
||||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInita4f4075db4c53dc5c814f34f3ee877ca', 'loadClassLoader'), true, true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInitb59f8cb8d17ba6f6ba55e8ad5b82bbad', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInita4f4075db4c53dc5c814f34f3ee877ca', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInitb59f8cb8d17ba6f6ba55e8ad5b82bbad', 'loadClassLoader'));
|
||||
|
||||
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
||||
if ($useStaticLoader) {
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInita4f4075db4c53dc5c814f34f3ee877ca::getInitializer($loader));
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInitb59f8cb8d17ba6f6ba55e8ad5b82bbad::getInitializer($loader));
|
||||
} else {
|
||||
$classMap = require __DIR__ . '/autoload_classmap.php';
|
||||
if ($classMap) {
|
||||
@ -42,19 +42,19 @@ class ComposerAutoloaderInita4f4075db4c53dc5c814f34f3ee877ca
|
||||
$loader->register(true);
|
||||
|
||||
if ($useStaticLoader) {
|
||||
$includeFiles = Composer\Autoload\ComposerStaticInita4f4075db4c53dc5c814f34f3ee877ca::$files;
|
||||
$includeFiles = Composer\Autoload\ComposerStaticInitb59f8cb8d17ba6f6ba55e8ad5b82bbad::$files;
|
||||
} else {
|
||||
$includeFiles = require __DIR__ . '/autoload_files.php';
|
||||
}
|
||||
foreach ($includeFiles as $fileIdentifier => $file) {
|
||||
composerRequirea4f4075db4c53dc5c814f34f3ee877ca($fileIdentifier, $file);
|
||||
composerRequireb59f8cb8d17ba6f6ba55e8ad5b82bbad($fileIdentifier, $file);
|
||||
}
|
||||
|
||||
return $loader;
|
||||
}
|
||||
}
|
||||
|
||||
function composerRequirea4f4075db4c53dc5c814f34f3ee877ca($fileIdentifier, $file)
|
||||
function composerRequireb59f8cb8d17ba6f6ba55e8ad5b82bbad($fileIdentifier, $file)
|
||||
{
|
||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||
require $file;
|
||||
|
8
vendor/composer/autoload_static.php
vendored
8
vendor/composer/autoload_static.php
vendored
@ -4,7 +4,7 @@
|
||||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
class ComposerStaticInita4f4075db4c53dc5c814f34f3ee877ca
|
||||
class ComposerStaticInitb59f8cb8d17ba6f6ba55e8ad5b82bbad
|
||||
{
|
||||
public static $files = array (
|
||||
'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php',
|
||||
@ -3771,9 +3771,9 @@ class ComposerStaticInita4f4075db4c53dc5c814f34f3ee877ca
|
||||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInita4f4075db4c53dc5c814f34f3ee877ca::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInita4f4075db4c53dc5c814f34f3ee877ca::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInita4f4075db4c53dc5c814f34f3ee877ca::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInitb59f8cb8d17ba6f6ba55e8ad5b82bbad::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInitb59f8cb8d17ba6f6ba55e8ad5b82bbad::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInitb59f8cb8d17ba6f6ba55e8ad5b82bbad::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
10
vendor/scoper-autoload.php
vendored
10
vendor/scoper-autoload.php
vendored
@ -12,8 +12,8 @@ if (!class_exists('GenerateChangelogCommand', false) && !interface_exists('Gener
|
||||
if (!class_exists('AutoloadIncluder', false) && !interface_exists('AutoloadIncluder', false) && !trait_exists('AutoloadIncluder', false)) {
|
||||
spl_autoload_call('RectorPrefix20211128\AutoloadIncluder');
|
||||
}
|
||||
if (!class_exists('ComposerAutoloaderInita4f4075db4c53dc5c814f34f3ee877ca', false) && !interface_exists('ComposerAutoloaderInita4f4075db4c53dc5c814f34f3ee877ca', false) && !trait_exists('ComposerAutoloaderInita4f4075db4c53dc5c814f34f3ee877ca', false)) {
|
||||
spl_autoload_call('RectorPrefix20211128\ComposerAutoloaderInita4f4075db4c53dc5c814f34f3ee877ca');
|
||||
if (!class_exists('ComposerAutoloaderInitb59f8cb8d17ba6f6ba55e8ad5b82bbad', false) && !interface_exists('ComposerAutoloaderInitb59f8cb8d17ba6f6ba55e8ad5b82bbad', false) && !trait_exists('ComposerAutoloaderInitb59f8cb8d17ba6f6ba55e8ad5b82bbad', false)) {
|
||||
spl_autoload_call('RectorPrefix20211128\ComposerAutoloaderInitb59f8cb8d17ba6f6ba55e8ad5b82bbad');
|
||||
}
|
||||
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('RectorPrefix20211128\Helmich\TypoScriptParser\Parser\AST\Statement');
|
||||
@ -81,9 +81,9 @@ if (!function_exists('print_node')) {
|
||||
return \RectorPrefix20211128\print_node(...func_get_args());
|
||||
}
|
||||
}
|
||||
if (!function_exists('composerRequirea4f4075db4c53dc5c814f34f3ee877ca')) {
|
||||
function composerRequirea4f4075db4c53dc5c814f34f3ee877ca() {
|
||||
return \RectorPrefix20211128\composerRequirea4f4075db4c53dc5c814f34f3ee877ca(...func_get_args());
|
||||
if (!function_exists('composerRequireb59f8cb8d17ba6f6ba55e8ad5b82bbad')) {
|
||||
function composerRequireb59f8cb8d17ba6f6ba55e8ad5b82bbad() {
|
||||
return \RectorPrefix20211128\composerRequireb59f8cb8d17ba6f6ba55e8ad5b82bbad(...func_get_args());
|
||||
}
|
||||
}
|
||||
if (!function_exists('scanPath')) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user