Updated Rector to commit bf2fe78378130e72970cd41c8a4cc2f1807ab951

bf2fe78378 Various cleanup (#4121)
This commit is contained in:
Tomas Votruba 2023-06-08 19:43:06 +00:00
parent 2464e91763
commit 7ceca5a857
9 changed files with 25 additions and 82 deletions

View File

@ -42,6 +42,8 @@ use Rector\NodeTypeResolver\Reflection\BetterReflection\SourceLocatorProvider\Dy
use Rector\PhpDocParser\NodeTraverser\SimpleCallableNodeTraverser;
use Rector\PhpDocParser\PhpParser\SmartPhpParser;
use Rector\PhpDocParser\PhpParser\SmartPhpParserFactory;
use Rector\RectorGenerator\Command\GenerateCommand;
use Rector\RectorGenerator\Command\InitRecipeCommand;
use Rector\Utils\Command\MissingInSetCommand;
use Rector\Utils\Command\OutsideAnySetCommand;
use RectorPrefix202306\Symfony\Component\Console\Application;
@ -81,6 +83,7 @@ return static function (RectorConfig $rectorConfig) : void {
__DIR__ . '/../packages/PHPStanStaticTypeMapper/Enum',
__DIR__ . '/../packages/Caching/Cache.php',
__DIR__ . '/../packages/NodeTypeResolver/PhpDocNodeVisitor/UnderscoreRenamePhpDocNodeVisitor.php',
__DIR__ . '/../packages/NodeTypeResolver/PHPStan/ObjectWithoutClassTypeWithParentTypes.php',
// used in PHPStan
__DIR__ . '/../packages/NodeTypeResolver/Reflection/BetterReflection/RectorBetterReflectionSourceLocatorFactory.php',
__DIR__ . '/../packages/NodeTypeResolver/Reflection/BetterReflection/SourceLocatorProvider/DynamicSourceLocatorProvider.php',
@ -133,7 +136,12 @@ return static function (RectorConfig $rectorConfig) : void {
if (\class_exists(MissingInSetCommand::class)) {
$services->set(MissingInSetCommand::class);
$services->set(OutsideAnySetCommand::class);
$services->set(ConsoleApplication::class)->call('add', [service(MissingInSetCommand::class)])->call('add', [service(OutsideAnySetCommand::class)]);
$services->get(ConsoleApplication::class)->call('add', [service(MissingInSetCommand::class)])->call('add', [service(OutsideAnySetCommand::class)]);
}
if (\class_exists(InitRecipeCommand::class)) {
$services->set(InitRecipeCommand::class);
$services->set(GenerateCommand::class);
$services->get(ConsoleApplication::class)->call('add', [service(InitRecipeCommand::class)])->call('add', [service(GenerateCommand::class)]);
}
// phpdoc parser
$services->set(SmartPhpParser::class)->factory([service(SmartPhpParserFactory::class), 'create']);

View File

@ -1,24 +0,0 @@
<?php
declare (strict_types=1);
namespace Rector\Php80\AttributeDecorator;
use PhpParser\Node\Attribute;
use PhpParser\Node\Identifier;
use Rector\Php80\Contract\AttributeDecoratorInterface;
final class JMSAccesorOrderAttributeDecorator implements AttributeDecoratorInterface
{
public function getAttributeName() : string
{
return 'JMS\\Serializer\\Annotation\\AccessorOrder';
}
public function decorate(Attribute $attribute) : void
{
// make first named arg explicit, @see https://github.com/rectorphp/rector/issues/7369
$firstArg = $attribute->args[0];
if ($firstArg->name instanceof Identifier) {
return;
}
$firstArg->name = new Identifier('order');
}
}

View File

@ -1,34 +0,0 @@
<?php
declare (strict_types=1);
namespace Rector\Php80\AttributeDecorator;
use PhpParser\Node\Attribute;
use PhpParser\Node\Identifier;
use PhpParser\Node\Scalar\String_;
use Rector\Php80\Contract\AttributeDecoratorInterface;
/**
* The string is replaced by specific value
*/
final class JMSAccessTypeAttributeDecorator implements AttributeDecoratorInterface
{
public function getAttributeName() : string
{
return 'JMS\\Serializer\\Annotation\\AccessType';
}
public function decorate(Attribute $attribute) : void
{
$args = $attribute->args;
if (\count($args) !== 1) {
return;
}
$currentArg = $args[0];
if ($currentArg->name instanceof Identifier) {
return;
}
if (!$currentArg->value instanceof String_) {
return;
}
$currentArg->name = new Identifier('type');
}
}

View File

@ -5,20 +5,17 @@ namespace Rector\Php80\NodeManipulator;
use PhpParser\Node\AttributeGroup;
use Rector\NodeTypeResolver\Node\AttributeKey;
use Rector\Php80\AttributeDecorator\SensioParamConverterAttributeDecorator;
use Rector\Php80\Contract\AttributeDecoratorInterface;
final class AttributeGroupNamedArgumentManipulator
{
/**
* @var AttributeDecoratorInterface[]
* @readonly
*/
private $attributeDecorators;
/**
* @param AttributeDecoratorInterface[] $attributeDecorators
*/
public function __construct(array $attributeDecorators)
private $attributeDecorators = [];
public function __construct(SensioParamConverterAttributeDecorator $sensioParamConverterAttributeDecorator)
{
$this->attributeDecorators = $attributeDecorators;
$this->attributeDecorators[] = $sensioParamConverterAttributeDecorator;
}
/**
* @param AttributeGroup[] $attributeGroups

View File

@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = '754f2b31495ef47302a5db4783b2bf8b152ef2d0';
public const PACKAGE_VERSION = 'bf2fe78378130e72970cd41c8a4cc2f1807ab951';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2023-06-08 21:13:05';
public const RELEASE_DATE = '2023-06-08 19:39:15';
/**
* @var int
*/

2
vendor/autoload.php vendored
View File

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

View File

@ -2320,8 +2320,6 @@ return array(
'Rector\\Php74\\Rector\\StaticCall\\ExportToReflectionFunctionRector' => $baseDir . '/rules/Php74/Rector/StaticCall/ExportToReflectionFunctionRector.php',
'Rector\\Php74\\Rector\\Ternary\\ParenthesizeNestedTernaryRector' => $baseDir . '/rules/Php74/Rector/Ternary/ParenthesizeNestedTernaryRector.php',
'Rector\\Php74\\Tokenizer\\ParenthesizedNestedTernaryAnalyzer' => $baseDir . '/rules/Php74/Tokenizer/ParenthesizedNestedTernaryAnalyzer.php',
'Rector\\Php80\\AttributeDecorator\\JMSAccesorOrderAttributeDecorator' => $baseDir . '/rules/Php80/AttributeDecorator/JMSAccesorOrderAttributeDecorator.php',
'Rector\\Php80\\AttributeDecorator\\JMSAccessTypeAttributeDecorator' => $baseDir . '/rules/Php80/AttributeDecorator/JMSAccessTypeAttributeDecorator.php',
'Rector\\Php80\\AttributeDecorator\\SensioParamConverterAttributeDecorator' => $baseDir . '/rules/Php80/AttributeDecorator/SensioParamConverterAttributeDecorator.php',
'Rector\\Php80\\Contract\\AttributeDecoratorInterface' => $baseDir . '/rules/Php80/Contract/AttributeDecoratorInterface.php',
'Rector\\Php80\\Contract\\StrStartWithMatchAndRefactorInterface' => $baseDir . '/rules/Php80/Contract/StrStartWithMatchAndRefactorInterface.php',

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit2433e3da0220adee79d8e5cab5b8e955
class ComposerAutoloaderInit022e70dea58728c489b819bf8b259df5
{
private static $loader;
@ -22,17 +22,17 @@ class ComposerAutoloaderInit2433e3da0220adee79d8e5cab5b8e955
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit2433e3da0220adee79d8e5cab5b8e955', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit022e70dea58728c489b819bf8b259df5', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInit2433e3da0220adee79d8e5cab5b8e955', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit022e70dea58728c489b819bf8b259df5', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit2433e3da0220adee79d8e5cab5b8e955::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit022e70dea58728c489b819bf8b259df5::getInitializer($loader));
$loader->setClassMapAuthoritative(true);
$loader->register(true);
$filesToLoad = \Composer\Autoload\ComposerStaticInit2433e3da0220adee79d8e5cab5b8e955::$files;
$filesToLoad = \Composer\Autoload\ComposerStaticInit022e70dea58728c489b819bf8b259df5::$files;
$requireFile = \Closure::bind(static function ($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 ComposerStaticInit2433e3da0220adee79d8e5cab5b8e955
class ComposerStaticInit022e70dea58728c489b819bf8b259df5
{
public static $files = array (
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
@ -2571,8 +2571,6 @@ class ComposerStaticInit2433e3da0220adee79d8e5cab5b8e955
'Rector\\Php74\\Rector\\StaticCall\\ExportToReflectionFunctionRector' => __DIR__ . '/../..' . '/rules/Php74/Rector/StaticCall/ExportToReflectionFunctionRector.php',
'Rector\\Php74\\Rector\\Ternary\\ParenthesizeNestedTernaryRector' => __DIR__ . '/../..' . '/rules/Php74/Rector/Ternary/ParenthesizeNestedTernaryRector.php',
'Rector\\Php74\\Tokenizer\\ParenthesizedNestedTernaryAnalyzer' => __DIR__ . '/../..' . '/rules/Php74/Tokenizer/ParenthesizedNestedTernaryAnalyzer.php',
'Rector\\Php80\\AttributeDecorator\\JMSAccesorOrderAttributeDecorator' => __DIR__ . '/../..' . '/rules/Php80/AttributeDecorator/JMSAccesorOrderAttributeDecorator.php',
'Rector\\Php80\\AttributeDecorator\\JMSAccessTypeAttributeDecorator' => __DIR__ . '/../..' . '/rules/Php80/AttributeDecorator/JMSAccessTypeAttributeDecorator.php',
'Rector\\Php80\\AttributeDecorator\\SensioParamConverterAttributeDecorator' => __DIR__ . '/../..' . '/rules/Php80/AttributeDecorator/SensioParamConverterAttributeDecorator.php',
'Rector\\Php80\\Contract\\AttributeDecoratorInterface' => __DIR__ . '/../..' . '/rules/Php80/Contract/AttributeDecoratorInterface.php',
'Rector\\Php80\\Contract\\StrStartWithMatchAndRefactorInterface' => __DIR__ . '/../..' . '/rules/Php80/Contract/StrStartWithMatchAndRefactorInterface.php',
@ -3156,9 +3154,9 @@ class ComposerStaticInit2433e3da0220adee79d8e5cab5b8e955
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit2433e3da0220adee79d8e5cab5b8e955::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit2433e3da0220adee79d8e5cab5b8e955::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit2433e3da0220adee79d8e5cab5b8e955::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInit022e70dea58728c489b819bf8b259df5::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit022e70dea58728c489b819bf8b259df5::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit022e70dea58728c489b819bf8b259df5::$classMap;
}, null, ClassLoader::class);
}