mirror of https://github.com/rectorphp/rector.git
Updated Rector to commit f9de5d311e7e69d1ad2cb5f3087970d8b9335920
f9de5d311e
[Php80] Handle RenameClassRector+AnnotationToAttributeRector with auto import and existing attribute defined (#5219)
This commit is contained in:
parent
9f6334bf4b
commit
184cf49468
|
@ -2,10 +2,10 @@
|
|||
|
||||
// this is part of downgrade build
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202310;
|
||||
namespace RectorPrefix202311;
|
||||
|
||||
use RectorPrefix202310\Nette\Utils\FileSystem;
|
||||
use RectorPrefix202310\Nette\Utils\Json;
|
||||
use RectorPrefix202311\Nette\Utils\FileSystem;
|
||||
use RectorPrefix202311\Nette\Utils\Json;
|
||||
require __DIR__ . '/../vendor/autoload.php';
|
||||
$composerJsonFileContents = FileSystem::read(__DIR__ . '/../composer.json');
|
||||
$composerJson = Json::decode($composerJsonFileContents, Json::FORCE_ARRAY);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env php
|
||||
<?php
|
||||
namespace RectorPrefix202310;
|
||||
namespace RectorPrefix202311;
|
||||
|
||||
require_once __DIR__ . '/rector.php';
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202310;
|
||||
namespace RectorPrefix202311;
|
||||
|
||||
use RectorPrefix202310\Nette\Utils\Json;
|
||||
use RectorPrefix202311\Nette\Utils\Json;
|
||||
use Rector\ChangesReporting\Output\JsonOutputFormatter;
|
||||
use Rector\Core\Bootstrap\RectorConfigsResolver;
|
||||
use Rector\Core\Configuration\Option;
|
||||
|
@ -11,9 +11,9 @@ use Rector\Core\Console\Style\SymfonyStyleFactory;
|
|||
use Rector\Core\DependencyInjection\LazyContainerFactory;
|
||||
use Rector\Core\DependencyInjection\RectorContainerFactory;
|
||||
use Rector\Core\Util\Reflection\PrivatesAccessor;
|
||||
use RectorPrefix202310\Symfony\Component\Console\Application;
|
||||
use RectorPrefix202310\Symfony\Component\Console\Command\Command;
|
||||
use RectorPrefix202310\Symfony\Component\Console\Input\ArgvInput;
|
||||
use RectorPrefix202311\Symfony\Component\Console\Application;
|
||||
use RectorPrefix202311\Symfony\Component\Console\Command\Command;
|
||||
use RectorPrefix202311\Symfony\Component\Console\Input\ArgvInput;
|
||||
// @ intentionally: continue anyway
|
||||
@\ini_set('memory_limit', '-1');
|
||||
// Performance boost
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202310;
|
||||
namespace RectorPrefix202311;
|
||||
|
||||
use RectorPrefix202310\OndraM\CiDetector\CiDetector;
|
||||
use RectorPrefix202311\OndraM\CiDetector\CiDetector;
|
||||
use Rector\Caching\ValueObject\Storage\MemoryCacheStorage;
|
||||
use Rector\Config\RectorConfig;
|
||||
use Rector\Core\Bootstrap\ExtensionConfigResolver;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202310;
|
||||
namespace RectorPrefix202311;
|
||||
|
||||
use Rector\CodeQuality\Rector\Array_\CallableThisArrayToAnonymousFunctionRector;
|
||||
use Rector\CodeQuality\Rector\Assign\CombinedAssignRector;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202310;
|
||||
namespace RectorPrefix202311;
|
||||
|
||||
use Rector\CodingStyle\Rector\ArrowFunction\StaticArrowFunctionRector;
|
||||
use Rector\CodingStyle\Rector\Assign\SplitDoubleAssignRector;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202310;
|
||||
namespace RectorPrefix202311;
|
||||
|
||||
use Rector\CodeQuality\Rector\FunctionLike\SimplifyUselessVariableRector;
|
||||
use Rector\Config\RectorConfig;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202310;
|
||||
namespace RectorPrefix202311;
|
||||
|
||||
use Rector\Config\RectorConfig;
|
||||
use Rector\EarlyReturn\Rector\Foreach_\ChangeNestedForeachIfsToEarlyContinueRector;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202310;
|
||||
namespace RectorPrefix202311;
|
||||
|
||||
use Rector\Config\RectorConfig;
|
||||
use Rector\Renaming\Rector\MethodCall\RenameMethodRector;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202310;
|
||||
namespace RectorPrefix202311;
|
||||
|
||||
use Rector\CodeQuality\Rector\FuncCall\InlineIsAInstanceOfRector;
|
||||
use Rector\CodeQuality\Rector\Identical\FlipTypeControlToUseExclusiveTypeRector;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202310;
|
||||
namespace RectorPrefix202311;
|
||||
|
||||
use Rector\Config\RectorConfig;
|
||||
use Rector\Core\ValueObject\PhpVersion;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202310;
|
||||
namespace RectorPrefix202311;
|
||||
|
||||
use Rector\Config\RectorConfig;
|
||||
use Rector\Core\ValueObject\PhpVersion;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202310;
|
||||
namespace RectorPrefix202311;
|
||||
|
||||
use Rector\Config\RectorConfig;
|
||||
use Rector\Core\ValueObject\PhpVersion;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202310;
|
||||
namespace RectorPrefix202311;
|
||||
|
||||
use Rector\Config\RectorConfig;
|
||||
use Rector\Core\ValueObject\PhpVersion;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202310;
|
||||
namespace RectorPrefix202311;
|
||||
|
||||
use Rector\Config\RectorConfig;
|
||||
use Rector\Core\ValueObject\PhpVersion;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202310;
|
||||
namespace RectorPrefix202311;
|
||||
|
||||
use Rector\Config\RectorConfig;
|
||||
use Rector\Core\ValueObject\PhpVersion;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202310;
|
||||
namespace RectorPrefix202311;
|
||||
|
||||
use Rector\Config\RectorConfig;
|
||||
use Rector\Core\ValueObject\PhpVersion;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202310;
|
||||
namespace RectorPrefix202311;
|
||||
|
||||
use Rector\Config\RectorConfig;
|
||||
use Rector\Core\ValueObject\PhpVersion;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202310;
|
||||
namespace RectorPrefix202311;
|
||||
|
||||
use Rector\Config\RectorConfig;
|
||||
use Rector\Core\ValueObject\PhpVersion;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202310;
|
||||
namespace RectorPrefix202311;
|
||||
|
||||
use Rector\Config\RectorConfig;
|
||||
use Rector\Core\ValueObject\PhpVersion;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202310;
|
||||
namespace RectorPrefix202311;
|
||||
|
||||
use Rector\Config\RectorConfig;
|
||||
use Rector\Core\ValueObject\PhpVersion;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202310;
|
||||
namespace RectorPrefix202311;
|
||||
|
||||
use Rector\Config\RectorConfig;
|
||||
use Rector\Core\ValueObject\PhpVersion;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202310;
|
||||
namespace RectorPrefix202311;
|
||||
|
||||
use Rector\Config\RectorConfig;
|
||||
use Rector\Naming\Rector\Assign\RenameVariableToMatchMethodCallReturnTypeRector;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202310;
|
||||
namespace RectorPrefix202311;
|
||||
|
||||
use Rector\Config\RectorConfig;
|
||||
use Rector\Php52\Rector\Property\VarToPublicPropertyRector;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202310;
|
||||
namespace RectorPrefix202311;
|
||||
|
||||
use Rector\Config\RectorConfig;
|
||||
use Rector\Php53\Rector\FuncCall\DirNameFileConstantToDirConstantRector;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202310;
|
||||
namespace RectorPrefix202311;
|
||||
|
||||
use Rector\Config\RectorConfig;
|
||||
use Rector\Php54\Rector\Array_\LongArrayToShortArrayRector;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202310;
|
||||
namespace RectorPrefix202311;
|
||||
|
||||
use Rector\Config\RectorConfig;
|
||||
use Rector\Php55\Rector\Class_\ClassConstantToSelfClassRector;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202310;
|
||||
namespace RectorPrefix202311;
|
||||
|
||||
use Rector\Config\RectorConfig;
|
||||
use Rector\Php56\Rector\FuncCall\PowToExpRector;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202310;
|
||||
namespace RectorPrefix202311;
|
||||
|
||||
use Rector\Config\RectorConfig;
|
||||
use Rector\Php70\Rector\Assign\ListSplitStringRector;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202310;
|
||||
namespace RectorPrefix202311;
|
||||
|
||||
use Rector\Config\RectorConfig;
|
||||
use Rector\Php71\Rector\Assign\AssignArrayToStringRector;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202310;
|
||||
namespace RectorPrefix202311;
|
||||
|
||||
use Rector\Config\RectorConfig;
|
||||
use Rector\Php72\Rector\Assign\ListEachRector;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202310;
|
||||
namespace RectorPrefix202311;
|
||||
|
||||
use Rector\Config\RectorConfig;
|
||||
use Rector\Php52\Rector\Switch_\ContinueToBreakInSwitchRector;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202310;
|
||||
namespace RectorPrefix202311;
|
||||
|
||||
use Rector\Config\RectorConfig;
|
||||
use Rector\Php74\Rector\ArrayDimFetch\CurlyToSquareBracketArrayStringRector;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202310;
|
||||
namespace RectorPrefix202311;
|
||||
|
||||
use Rector\Arguments\Rector\ClassMethod\ArgumentAdderRector;
|
||||
use Rector\Arguments\Rector\FuncCall\FunctionArgumentDefaultValueReplacerRector;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202310;
|
||||
namespace RectorPrefix202311;
|
||||
|
||||
use Rector\Config\RectorConfig;
|
||||
use Rector\Php81\Rector\Array_\FirstClassCallableRector;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202310;
|
||||
namespace RectorPrefix202311;
|
||||
|
||||
use Rector\Config\RectorConfig;
|
||||
use Rector\Php82\Rector\Class_\ReadOnlyClassRector;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202310;
|
||||
namespace RectorPrefix202311;
|
||||
|
||||
use Rector\Config\RectorConfig;
|
||||
use Rector\Privatization\Rector\Class_\FinalizeClassesWithoutChildrenRector;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202310;
|
||||
namespace RectorPrefix202311;
|
||||
|
||||
use Rector\Config\RectorConfig;
|
||||
use Rector\Strict\Rector\BooleanNot\BooleanInBooleanNotRuleFixerRector;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace RectorPrefix202310;
|
||||
namespace RectorPrefix202311;
|
||||
|
||||
use Rector\Config\RectorConfig;
|
||||
use Rector\TypeDeclaration\Rector\ArrowFunction\AddArrowFunctionReturnTypeRector;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
declare (strict_types=1);
|
||||
namespace Rector\BetterPhpDocParser\PhpDocManipulator;
|
||||
|
||||
use RectorPrefix202310\Nette\Utils\Strings;
|
||||
use RectorPrefix202311\Nette\Utils\Strings;
|
||||
use PhpParser\Node;
|
||||
use Rector\BetterPhpDocParser\PhpDoc\ArrayItemNode;
|
||||
use Rector\BetterPhpDocParser\PhpDoc\DoctrineAnnotationTagValueNode;
|
||||
|
|
|
@ -10,7 +10,7 @@ use Rector\BetterPhpDocParser\ValueObject\Parser\BetterTokenIterator;
|
|||
use Rector\PhpDocParser\PhpDocParser\PhpDocNodeTraverser;
|
||||
use Rector\PhpDocParser\PhpDocParser\PhpDocNodeVisitor\CloningPhpDocNodeVisitor;
|
||||
use Rector\PhpDocParser\PhpDocParser\PhpDocNodeVisitor\ParentConnectingPhpDocNodeVisitor;
|
||||
use RectorPrefix202310\Webmozart\Assert\Assert;
|
||||
use RectorPrefix202311\Webmozart\Assert\Assert;
|
||||
/**
|
||||
* @see \Rector\Tests\BetterPhpDocParser\PhpDocNodeMapperTest
|
||||
*/
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
declare (strict_types=1);
|
||||
namespace Rector\BetterPhpDocParser\PhpDocParser;
|
||||
|
||||
use RectorPrefix202310\Nette\Utils\Strings;
|
||||
use RectorPrefix202311\Nette\Utils\Strings;
|
||||
use PhpParser\Node;
|
||||
use PHPStan\PhpDocParser\Ast\PhpDoc\GenericTagValueNode;
|
||||
use PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocChildNode;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
declare (strict_types=1);
|
||||
namespace Rector\BetterPhpDocParser\Printer;
|
||||
|
||||
use RectorPrefix202310\Nette\Utils\Strings;
|
||||
use RectorPrefix202311\Nette\Utils\Strings;
|
||||
final class DocBlockInliner
|
||||
{
|
||||
/**
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
declare (strict_types=1);
|
||||
namespace Rector\BetterPhpDocParser\Printer;
|
||||
|
||||
use RectorPrefix202310\Nette\Utils\Strings;
|
||||
use RectorPrefix202311\Nette\Utils\Strings;
|
||||
use PhpParser\Comment;
|
||||
use PhpParser\Node\Stmt\InlineHTML;
|
||||
use PHPStan\PhpDocParser\Ast\PhpDoc\ParamTagValueNode;
|
||||
|
|
|
@ -5,7 +5,7 @@ namespace Rector\BetterPhpDocParser\ValueObject\PhpDoc\DoctrineAnnotation;
|
|||
|
||||
use Rector\BetterPhpDocParser\PhpDoc\ArrayItemNode;
|
||||
use Stringable;
|
||||
use RectorPrefix202310\Webmozart\Assert\Assert;
|
||||
use RectorPrefix202311\Webmozart\Assert\Assert;
|
||||
final class CurlyListNode extends \Rector\BetterPhpDocParser\ValueObject\PhpDoc\DoctrineAnnotation\AbstractValuesAwareNode
|
||||
{
|
||||
/**
|
||||
|
|
|
@ -7,7 +7,7 @@ use Rector\Caching\ValueObject\Storage\FileCacheStorage;
|
|||
use Rector\Caching\ValueObject\Storage\MemoryCacheStorage;
|
||||
use Rector\Core\Configuration\Option;
|
||||
use Rector\Core\Configuration\Parameter\SimpleParameterProvider;
|
||||
use RectorPrefix202310\Symfony\Component\Filesystem\Filesystem;
|
||||
use RectorPrefix202311\Symfony\Component\Filesystem\Filesystem;
|
||||
final class CacheFactory
|
||||
{
|
||||
/**
|
||||
|
|
|
@ -4,8 +4,8 @@ declare (strict_types=1);
|
|||
namespace Rector\Caching\ValueObject\Storage;
|
||||
|
||||
use FilesystemIterator;
|
||||
use RectorPrefix202310\Nette\Utils\FileSystem;
|
||||
use RectorPrefix202310\Nette\Utils\Random;
|
||||
use RectorPrefix202311\Nette\Utils\FileSystem;
|
||||
use RectorPrefix202311\Nette\Utils\Random;
|
||||
use Rector\Caching\Contract\ValueObject\Storage\CacheStorageInterface;
|
||||
use Rector\Caching\ValueObject\CacheFilePaths;
|
||||
use Rector\Caching\ValueObject\CacheItem;
|
||||
|
@ -26,7 +26,7 @@ final class FileCacheStorage implements CacheStorageInterface
|
|||
* @var \Symfony\Component\Filesystem\Filesystem
|
||||
*/
|
||||
private $filesystem;
|
||||
public function __construct(string $directory, \RectorPrefix202310\Symfony\Component\Filesystem\Filesystem $filesystem)
|
||||
public function __construct(string $directory, \RectorPrefix202311\Symfony\Component\Filesystem\Filesystem $filesystem)
|
||||
{
|
||||
$this->directory = $directory;
|
||||
$this->filesystem = $filesystem;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
declare (strict_types=1);
|
||||
namespace Rector\ChangesReporting\Annotation;
|
||||
|
||||
use RectorPrefix202310\Nette\Utils\Strings;
|
||||
use RectorPrefix202311\Nette\Utils\Strings;
|
||||
use Rector\Core\Contract\Rector\RectorInterface;
|
||||
use ReflectionClass;
|
||||
/**
|
||||
|
|
|
@ -3,14 +3,14 @@
|
|||
declare (strict_types=1);
|
||||
namespace Rector\ChangesReporting\Output;
|
||||
|
||||
use RectorPrefix202310\Nette\Utils\Strings;
|
||||
use RectorPrefix202311\Nette\Utils\Strings;
|
||||
use Rector\ChangesReporting\Annotation\RectorsChangelogResolver;
|
||||
use Rector\ChangesReporting\Contract\Output\OutputFormatterInterface;
|
||||
use Rector\Core\ValueObject\Configuration;
|
||||
use Rector\Core\ValueObject\Error\SystemError;
|
||||
use Rector\Core\ValueObject\ProcessResult;
|
||||
use Rector\Core\ValueObject\Reporting\FileDiff;
|
||||
use RectorPrefix202310\Symfony\Component\Console\Style\SymfonyStyle;
|
||||
use RectorPrefix202311\Symfony\Component\Console\Style\SymfonyStyle;
|
||||
final class ConsoleOutputFormatter implements OutputFormatterInterface
|
||||
{
|
||||
/**
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
declare (strict_types=1);
|
||||
namespace Rector\ChangesReporting\Output;
|
||||
|
||||
use RectorPrefix202310\Nette\Utils\Json;
|
||||
use RectorPrefix202311\Nette\Utils\Json;
|
||||
use Rector\ChangesReporting\Annotation\RectorsChangelogResolver;
|
||||
use Rector\ChangesReporting\Contract\Output\OutputFormatterInterface;
|
||||
use Rector\Core\ValueObject\Configuration;
|
||||
|
|
|
@ -4,8 +4,8 @@ declare (strict_types=1);
|
|||
namespace Rector\ChangesReporting\ValueObject;
|
||||
|
||||
use Rector\Core\Contract\Rector\RectorInterface;
|
||||
use RectorPrefix202310\Symplify\EasyParallel\Contract\SerializableInterface;
|
||||
use RectorPrefix202310\Webmozart\Assert\Assert;
|
||||
use RectorPrefix202311\Symplify\EasyParallel\Contract\SerializableInterface;
|
||||
use RectorPrefix202311\Webmozart\Assert\Assert;
|
||||
final class RectorWithLineChange implements SerializableInterface
|
||||
{
|
||||
/**
|
||||
|
@ -48,7 +48,7 @@ final class RectorWithLineChange implements SerializableInterface
|
|||
* @param array<string, mixed> $json
|
||||
* @return $this
|
||||
*/
|
||||
public static function decode(array $json) : \RectorPrefix202310\Symplify\EasyParallel\Contract\SerializableInterface
|
||||
public static function decode(array $json) : \RectorPrefix202311\Symplify\EasyParallel\Contract\SerializableInterface
|
||||
{
|
||||
$rectorClass = $json[self::KEY_RECTOR_CLASS];
|
||||
Assert::string($rectorClass);
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
declare (strict_types=1);
|
||||
namespace Rector\Config;
|
||||
|
||||
use RectorPrefix202310\Illuminate\Container\Container;
|
||||
use RectorPrefix202311\Illuminate\Container\Container;
|
||||
use PHPStan\Collectors\Collector;
|
||||
use Rector\Caching\Contract\ValueObject\Storage\CacheStorageInterface;
|
||||
use Rector\Core\Configuration\Option;
|
||||
|
@ -15,7 +15,7 @@ use Rector\Core\DependencyInjection\Laravel\ContainerMemento;
|
|||
use Rector\Core\Exception\ShouldNotHappenException;
|
||||
use Rector\Core\ValueObject\PhpVersion;
|
||||
use Rector\Skipper\SkipCriteriaResolver\SkippedClassResolver;
|
||||
use RectorPrefix202310\Webmozart\Assert\Assert;
|
||||
use RectorPrefix202311\Webmozart\Assert\Assert;
|
||||
/**
|
||||
* @api
|
||||
*/
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
declare (strict_types=1);
|
||||
namespace Rector\FileSystemRector\Parser;
|
||||
|
||||
use RectorPrefix202310\Nette\Utils\FileSystem;
|
||||
use RectorPrefix202311\Nette\Utils\FileSystem;
|
||||
use PhpParser\Node\Stmt;
|
||||
use Rector\Core\PhpParser\Parser\RectorParser;
|
||||
use Rector\Core\Provider\CurrentFileProvider;
|
||||
|
|
|
@ -15,7 +15,7 @@ use PHPStan\Reflection\ReflectionProvider;
|
|||
use Rector\Core\Configuration\Option;
|
||||
use Rector\Core\Configuration\Parameter\SimpleParameterProvider;
|
||||
use Rector\NodeTypeResolver\Reflection\BetterReflection\SourceLocatorProvider\DynamicSourceLocatorProvider;
|
||||
use RectorPrefix202310\Webmozart\Assert\Assert;
|
||||
use RectorPrefix202311\Webmozart\Assert\Assert;
|
||||
/**
|
||||
* Factory so Symfony app can use services from PHPStan container
|
||||
*
|
||||
|
|
|
@ -60,7 +60,7 @@ use Rector\Core\Util\Reflection\PrivatesAccessor;
|
|||
use Rector\NodeNameResolver\NodeNameResolver;
|
||||
use Rector\NodeTypeResolver\Node\AttributeKey;
|
||||
use Rector\NodeTypeResolver\PHPStan\Scope\Contract\NodeVisitor\ScopeResolverNodeVisitorInterface;
|
||||
use RectorPrefix202310\Webmozart\Assert\Assert;
|
||||
use RectorPrefix202311\Webmozart\Assert\Assert;
|
||||
/**
|
||||
* @inspired by https://github.com/silverstripe/silverstripe-upgrader/blob/532182b23e854d02e0b27e68ebc394f436de0682/src/UpgradeRule/PHP/Visitor/PHPStanScopeVisitor.php
|
||||
* - https://github.com/silverstripe/silverstripe-upgrader/pull/57/commits/e5c7cfa166ad940d9d4ff69537d9f7608e992359#diff-5e0807bb3dc03d6a8d8b6ad049abd774
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
declare (strict_types=1);
|
||||
namespace Rector\NodeTypeResolver\PhpDocNodeVisitor;
|
||||
|
||||
use RectorPrefix202310\Nette\Utils\Strings;
|
||||
use RectorPrefix202311\Nette\Utils\Strings;
|
||||
use PhpParser\Node as PhpParserNode;
|
||||
use PHPStan\PhpDocParser\Ast\Node;
|
||||
use PHPStan\PhpDocParser\Ast\PhpDoc\TemplateTagValueNode;
|
||||
|
|
|
@ -11,7 +11,7 @@ use PHPStan\Type\Type;
|
|||
use Rector\Core\Exception\NotImplementedYetException;
|
||||
use Rector\PHPStanStaticTypeMapper\Contract\TypeMapperInterface;
|
||||
use Rector\PHPStanStaticTypeMapper\Enum\TypeKind;
|
||||
use RectorPrefix202310\Webmozart\Assert\Assert;
|
||||
use RectorPrefix202311\Webmozart\Assert\Assert;
|
||||
final class PHPStanStaticTypeMapper
|
||||
{
|
||||
/**
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
declare (strict_types=1);
|
||||
namespace Rector\PHPStanStaticTypeMapper\TypeMapper;
|
||||
|
||||
use RectorPrefix202310\Nette\Utils\Strings;
|
||||
use RectorPrefix202311\Nette\Utils\Strings;
|
||||
use PhpParser\Node;
|
||||
use PHPStan\PhpDocParser\Ast\Type\TypeNode;
|
||||
use PHPStan\Reflection\ClassReflection;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
declare (strict_types=1);
|
||||
namespace Rector\PHPStanStaticTypeMapper\TypeMapper;
|
||||
|
||||
use RectorPrefix202310\Nette\Utils\Strings;
|
||||
use RectorPrefix202311\Nette\Utils\Strings;
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Name;
|
||||
use PhpParser\Node\Name\FullyQualified;
|
||||
|
|
|
@ -34,8 +34,8 @@ use Rector\PHPStanStaticTypeMapper\Enum\TypeKind;
|
|||
use Rector\PHPStanStaticTypeMapper\PHPStanStaticTypeMapper;
|
||||
use Rector\PHPStanStaticTypeMapper\TypeAnalyzer\UnionTypeAnalyzer;
|
||||
use Rector\PHPStanStaticTypeMapper\ValueObject\UnionTypeAnalysis;
|
||||
use RectorPrefix202310\Webmozart\Assert\Assert;
|
||||
use RectorPrefix202310\Webmozart\Assert\InvalidArgumentException;
|
||||
use RectorPrefix202311\Webmozart\Assert\Assert;
|
||||
use RectorPrefix202311\Webmozart\Assert\InvalidArgumentException;
|
||||
/**
|
||||
* @implements TypeMapperInterface<UnionType>
|
||||
*/
|
||||
|
|
|
@ -3,13 +3,13 @@
|
|||
declare (strict_types=1);
|
||||
namespace Rector\Parallel\Application;
|
||||
|
||||
use RectorPrefix202310\Clue\React\NDJson\Decoder;
|
||||
use RectorPrefix202310\Clue\React\NDJson\Encoder;
|
||||
use RectorPrefix202310\Nette\Utils\Random;
|
||||
use RectorPrefix202311\Clue\React\NDJson\Decoder;
|
||||
use RectorPrefix202311\Clue\React\NDJson\Encoder;
|
||||
use RectorPrefix202311\Nette\Utils\Random;
|
||||
use PHPStan\Collectors\CollectedData;
|
||||
use RectorPrefix202310\React\EventLoop\StreamSelectLoop;
|
||||
use RectorPrefix202310\React\Socket\ConnectionInterface;
|
||||
use RectorPrefix202310\React\Socket\TcpServer;
|
||||
use RectorPrefix202311\React\EventLoop\StreamSelectLoop;
|
||||
use RectorPrefix202311\React\Socket\ConnectionInterface;
|
||||
use RectorPrefix202311\React\Socket\TcpServer;
|
||||
use Rector\Core\Configuration\Option;
|
||||
use Rector\Core\Configuration\Parameter\SimpleParameterProvider;
|
||||
use Rector\Core\Console\Command\ProcessCommand;
|
||||
|
@ -19,15 +19,15 @@ use Rector\Core\ValueObject\ProcessResult;
|
|||
use Rector\Core\ValueObject\Reporting\FileDiff;
|
||||
use Rector\Parallel\Command\WorkerCommandLineFactory;
|
||||
use Rector\Parallel\ValueObject\Bridge;
|
||||
use RectorPrefix202310\Symfony\Component\Console\Command\Command;
|
||||
use RectorPrefix202310\Symfony\Component\Console\Input\InputInterface;
|
||||
use RectorPrefix202310\Symplify\EasyParallel\Enum\Action;
|
||||
use RectorPrefix202310\Symplify\EasyParallel\Enum\Content;
|
||||
use RectorPrefix202310\Symplify\EasyParallel\Enum\ReactCommand;
|
||||
use RectorPrefix202310\Symplify\EasyParallel\Enum\ReactEvent;
|
||||
use RectorPrefix202310\Symplify\EasyParallel\ValueObject\ParallelProcess;
|
||||
use RectorPrefix202310\Symplify\EasyParallel\ValueObject\ProcessPool;
|
||||
use RectorPrefix202310\Symplify\EasyParallel\ValueObject\Schedule;
|
||||
use RectorPrefix202311\Symfony\Component\Console\Command\Command;
|
||||
use RectorPrefix202311\Symfony\Component\Console\Input\InputInterface;
|
||||
use RectorPrefix202311\Symplify\EasyParallel\Enum\Action;
|
||||
use RectorPrefix202311\Symplify\EasyParallel\Enum\Content;
|
||||
use RectorPrefix202311\Symplify\EasyParallel\Enum\ReactCommand;
|
||||
use RectorPrefix202311\Symplify\EasyParallel\Enum\ReactEvent;
|
||||
use RectorPrefix202311\Symplify\EasyParallel\ValueObject\ParallelProcess;
|
||||
use RectorPrefix202311\Symplify\EasyParallel\ValueObject\ProcessPool;
|
||||
use RectorPrefix202311\Symplify\EasyParallel\ValueObject\Schedule;
|
||||
use Throwable;
|
||||
/**
|
||||
* Inspired from @see
|
||||
|
|
|
@ -6,10 +6,10 @@ namespace Rector\Parallel\Command;
|
|||
use Rector\ChangesReporting\Output\JsonOutputFormatter;
|
||||
use Rector\Core\Configuration\Option;
|
||||
use Rector\Core\FileSystem\FilePathHelper;
|
||||
use RectorPrefix202310\Symfony\Component\Console\Command\Command;
|
||||
use RectorPrefix202310\Symfony\Component\Console\Input\InputInterface;
|
||||
use RectorPrefix202310\Symplify\EasyParallel\Exception\ParallelShouldNotHappenException;
|
||||
use RectorPrefix202310\Symplify\EasyParallel\Reflection\CommandFromReflectionFactory;
|
||||
use RectorPrefix202311\Symfony\Component\Console\Command\Command;
|
||||
use RectorPrefix202311\Symfony\Component\Console\Input\InputInterface;
|
||||
use RectorPrefix202311\Symplify\EasyParallel\Exception\ParallelShouldNotHappenException;
|
||||
use RectorPrefix202311\Symplify\EasyParallel\Reflection\CommandFromReflectionFactory;
|
||||
/**
|
||||
* @see \Rector\Tests\Parallel\Command\WorkerCommandLineFactoryTest
|
||||
* @todo possibly extract to symplify/easy-parallel
|
||||
|
|
|
@ -12,7 +12,7 @@ use Rector\BetterPhpDocParser\PhpDoc\StringNode;
|
|||
use Rector\NodeTypeResolver\Node\AttributeKey;
|
||||
use Rector\PhpAttribute\Contract\AnnotationToAttributeMapperInterface;
|
||||
use Rector\PhpAttribute\Enum\DocTagNodeState;
|
||||
use RectorPrefix202310\Webmozart\Assert\Assert;
|
||||
use RectorPrefix202311\Webmozart\Assert\Assert;
|
||||
/**
|
||||
* @see \Rector\Tests\PhpAttribute\AnnotationToAttributeMapper\AnnotationToAttributeMapperTest
|
||||
*/
|
||||
|
|
|
@ -13,7 +13,7 @@ use Rector\Core\PhpParser\Node\Value\ValueResolver;
|
|||
use Rector\PhpAttribute\AnnotationToAttributeMapper;
|
||||
use Rector\PhpAttribute\Contract\AnnotationToAttributeMapperInterface;
|
||||
use Rector\PhpAttribute\Enum\DocTagNodeState;
|
||||
use RectorPrefix202310\Webmozart\Assert\Assert;
|
||||
use RectorPrefix202311\Webmozart\Assert\Assert;
|
||||
/**
|
||||
* @implements AnnotationToAttributeMapperInterface<mixed[]>
|
||||
*/
|
||||
|
|
|
@ -14,7 +14,7 @@ use Rector\Core\Validation\RectorAssert;
|
|||
use Rector\PhpAttribute\AnnotationToAttributeMapper;
|
||||
use Rector\PhpAttribute\Contract\AnnotationToAttributeMapperInterface;
|
||||
use Rector\PhpAttribute\Enum\DocTagNodeState;
|
||||
use RectorPrefix202310\Webmozart\Assert\InvalidArgumentException;
|
||||
use RectorPrefix202311\Webmozart\Assert\InvalidArgumentException;
|
||||
/**
|
||||
* @implements AnnotationToAttributeMapperInterface<ArrayItemNode>
|
||||
*/
|
||||
|
|
|
@ -10,7 +10,7 @@ use Rector\BetterPhpDocParser\ValueObject\PhpDoc\DoctrineAnnotation\CurlyListNod
|
|||
use Rector\PhpAttribute\AnnotationToAttributeMapper;
|
||||
use Rector\PhpAttribute\Contract\AnnotationToAttributeMapperInterface;
|
||||
use Rector\PhpAttribute\Enum\DocTagNodeState;
|
||||
use RectorPrefix202310\Webmozart\Assert\Assert;
|
||||
use RectorPrefix202311\Webmozart\Assert\Assert;
|
||||
/**
|
||||
* @implements AnnotationToAttributeMapperInterface<CurlyListNode>
|
||||
*/
|
||||
|
|
|
@ -11,7 +11,7 @@ use PhpParser\Node\Identifier;
|
|||
use PhpParser\Node\Scalar\LNumber;
|
||||
use PhpParser\Node\Scalar\String_;
|
||||
use Rector\Core\Exception\NotImplementedYetException;
|
||||
use RectorPrefix202310\Webmozart\Assert\Assert;
|
||||
use RectorPrefix202311\Webmozart\Assert\Assert;
|
||||
final class AttributeArrayNameInliner
|
||||
{
|
||||
/**
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
declare (strict_types=1);
|
||||
namespace Rector\PhpAttribute\NodeFactory;
|
||||
|
||||
use RectorPrefix202310\Nette\Utils\Strings;
|
||||
use RectorPrefix202311\Nette\Utils\Strings;
|
||||
use PhpParser\BuilderHelpers;
|
||||
use PhpParser\Node\Arg;
|
||||
use PhpParser\Node\Expr;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
declare (strict_types=1);
|
||||
namespace Rector\PhpAttribute\NodeFactory;
|
||||
|
||||
use RectorPrefix202310\Nette\Utils\Strings;
|
||||
use RectorPrefix202311\Nette\Utils\Strings;
|
||||
use PhpParser\Node\Arg;
|
||||
use PhpParser\Node\Attribute;
|
||||
use PhpParser\Node\AttributeGroup;
|
||||
|
|
|
@ -4,11 +4,10 @@ declare (strict_types=1);
|
|||
namespace Rector\PostRector\Rector;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Arg;
|
||||
use PhpParser\Node\Expr;
|
||||
use PhpParser\Node\Name;
|
||||
use PhpParser\Node\Name\FullyQualified;
|
||||
use PhpParser\Node\Stmt;
|
||||
use PhpParser\Node\Stmt\Namespace_;
|
||||
use PhpParser\Node\Stmt\PropertyProperty;
|
||||
use PHPStan\Analyser\Scope;
|
||||
use Rector\CodingStyle\Application\UseImportsRemover;
|
||||
use Rector\Core\Configuration\Option;
|
||||
|
@ -62,8 +61,8 @@ final class ClassRenamingPostRector extends \Rector\PostRector\Rector\AbstractPo
|
|||
}
|
||||
public function enterNode(Node $node) : ?Node
|
||||
{
|
||||
// cannot be renamed
|
||||
if ($node instanceof Expr || $node instanceof Arg || $node instanceof PropertyProperty) {
|
||||
// no longer need post rename
|
||||
if (!$node instanceof Name) {
|
||||
return null;
|
||||
}
|
||||
$oldToNewClasses = $this->renamedClassesDataCollector->getOldToNewClasses();
|
||||
|
@ -73,6 +72,12 @@ final class ClassRenamingPostRector extends \Rector\PostRector\Rector\AbstractPo
|
|||
/** @var Scope|null $scope */
|
||||
$scope = $node->getAttribute(AttributeKey::SCOPE);
|
||||
$result = $this->classRenamer->renameNode($node, $oldToNewClasses, $scope);
|
||||
if (!$result instanceof Name && !$node instanceof FullyQualified) {
|
||||
$phpAttributeName = $node->getAttribute(AttributeKey::PHP_ATTRIBUTE_NAME);
|
||||
if (\is_string($phpAttributeName)) {
|
||||
return $this->classRenamer->renameNode(new FullyQualified($phpAttributeName, $node->getAttributes()), $oldToNewClasses, $scope);
|
||||
}
|
||||
}
|
||||
if (!SimpleParameterProvider::provideBoolParameter(Option::AUTO_IMPORT_NAMES)) {
|
||||
return $result;
|
||||
}
|
||||
|
|
|
@ -20,7 +20,6 @@ use Rector\CodingStyle\Node\NameImporter;
|
|||
use Rector\Comments\NodeDocBlock\DocBlockUpdater;
|
||||
use Rector\Core\Configuration\Option;
|
||||
use Rector\Core\Configuration\Parameter\SimpleParameterProvider;
|
||||
use Rector\Core\Configuration\RenamedClassesDataCollector;
|
||||
use Rector\Core\PhpParser\Node\CustomNode\FileWithoutNamespace;
|
||||
use Rector\Core\Provider\CurrentFileProvider;
|
||||
use Rector\Core\ValueObject\Application\File;
|
||||
|
@ -70,12 +69,7 @@ final class NameImportingPostRector extends \Rector\PostRector\Rector\AbstractPo
|
|||
* @var \Rector\Comments\NodeDocBlock\DocBlockUpdater
|
||||
*/
|
||||
private $docBlockUpdater;
|
||||
/**
|
||||
* @readonly
|
||||
* @var \Rector\Core\Configuration\RenamedClassesDataCollector
|
||||
*/
|
||||
private $renamedClassesDataCollector;
|
||||
public function __construct(NameImporter $nameImporter, DocBlockNameImporter $docBlockNameImporter, ClassNameImportSkipper $classNameImportSkipper, PhpDocInfoFactory $phpDocInfoFactory, CurrentFileProvider $currentFileProvider, UseImportsResolver $useImportsResolver, AliasNameResolver $aliasNameResolver, DocBlockUpdater $docBlockUpdater, RenamedClassesDataCollector $renamedClassesDataCollector)
|
||||
public function __construct(NameImporter $nameImporter, DocBlockNameImporter $docBlockNameImporter, ClassNameImportSkipper $classNameImportSkipper, PhpDocInfoFactory $phpDocInfoFactory, CurrentFileProvider $currentFileProvider, UseImportsResolver $useImportsResolver, AliasNameResolver $aliasNameResolver, DocBlockUpdater $docBlockUpdater)
|
||||
{
|
||||
$this->nameImporter = $nameImporter;
|
||||
$this->docBlockNameImporter = $docBlockNameImporter;
|
||||
|
@ -85,7 +79,6 @@ final class NameImportingPostRector extends \Rector\PostRector\Rector\AbstractPo
|
|||
$this->useImportsResolver = $useImportsResolver;
|
||||
$this->aliasNameResolver = $aliasNameResolver;
|
||||
$this->docBlockUpdater = $docBlockUpdater;
|
||||
$this->renamedClassesDataCollector = $renamedClassesDataCollector;
|
||||
}
|
||||
public function enterNode(Node $node) : ?Node
|
||||
{
|
||||
|
@ -101,7 +94,6 @@ final class NameImportingPostRector extends \Rector\PostRector\Rector\AbstractPo
|
|||
return null;
|
||||
}
|
||||
if ($node instanceof Name) {
|
||||
$node = $this->resolveNameFromAttribute($node);
|
||||
return $this->processNodeName($node, $file);
|
||||
}
|
||||
if (!$node instanceof Stmt && !$node instanceof Param) {
|
||||
|
@ -122,22 +114,6 @@ final class NameImportingPostRector extends \Rector\PostRector\Rector\AbstractPo
|
|||
$this->docBlockUpdater->updateRefactoredNodeWithPhpDocInfo($node);
|
||||
return $node;
|
||||
}
|
||||
private function resolveNameFromAttribute(Name $name) : Name
|
||||
{
|
||||
if ($name instanceof FullyQualified) {
|
||||
return $name;
|
||||
}
|
||||
if (\array_keys($name->getAttributes()) === [AttributeKey::PHP_ATTRIBUTE_NAME]) {
|
||||
$oldToNewClasses = $this->renamedClassesDataCollector->getOldToNewClasses();
|
||||
$phpAttributeName = $name->getAttribute(AttributeKey::PHP_ATTRIBUTE_NAME);
|
||||
foreach ($oldToNewClasses as $oldName => $newName) {
|
||||
if ($oldName === $phpAttributeName) {
|
||||
return new FullyQualified($newName, $name->getAttributes());
|
||||
}
|
||||
}
|
||||
}
|
||||
return $name;
|
||||
}
|
||||
private function processNodeName(Name $name, File $file) : ?Node
|
||||
{
|
||||
if ($name->isSpecialClassName()) {
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
declare (strict_types=1);
|
||||
namespace Rector\PostRector\Rector;
|
||||
|
||||
use RectorPrefix202310\Nette\Utils\Strings;
|
||||
use RectorPrefix202311\Nette\Utils\Strings;
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Identifier;
|
||||
use PhpParser\Node\Name;
|
||||
|
|
|
@ -7,7 +7,7 @@ use PhpParser\Node;
|
|||
use Rector\Core\Contract\Rector\RectorInterface;
|
||||
use Rector\Core\ProcessAnalyzer\RectifiedAnalyzer;
|
||||
use Rector\Skipper\Contract\SkipVoterInterface;
|
||||
use RectorPrefix202310\Webmozart\Assert\Assert;
|
||||
use RectorPrefix202311\Webmozart\Assert\Assert;
|
||||
/**
|
||||
* @api
|
||||
* @see \Rector\Tests\Skipper\Skipper\SkipperTest
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
declare (strict_types=1);
|
||||
namespace Rector\StaticTypeMapper\Mapper;
|
||||
|
||||
use RectorPrefix202310\Nette\Utils\Strings;
|
||||
use RectorPrefix202311\Nette\Utils\Strings;
|
||||
use PHPStan\Type\Accessory\AccessoryNonEmptyStringType;
|
||||
use PHPStan\Type\ArrayType;
|
||||
use PHPStan\Type\BooleanType;
|
||||
|
|
|
@ -9,7 +9,7 @@ use PHPStan\PhpDoc\TypeNodeResolver;
|
|||
use PHPStan\PhpDocParser\Ast\Type\TypeNode;
|
||||
use PHPStan\Type\Type;
|
||||
use Rector\StaticTypeMapper\Contract\PhpDocParser\PhpDocTypeMapperInterface;
|
||||
use RectorPrefix202310\Webmozart\Assert\Assert;
|
||||
use RectorPrefix202311\Webmozart\Assert\Assert;
|
||||
/**
|
||||
* @see \Rector\Tests\StaticTypeMapper\PhpDoc\PhpDocTypeMapperTest
|
||||
*/
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
declare (strict_types=1);
|
||||
namespace Rector\StaticTypeMapper\PhpDocParser;
|
||||
|
||||
use RectorPrefix202310\Nette\Utils\Strings;
|
||||
use RectorPrefix202311\Nette\Utils\Strings;
|
||||
use PhpParser\Node;
|
||||
use PHPStan\Analyser\NameScope;
|
||||
use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
declare (strict_types=1);
|
||||
namespace Rector\StaticTypeMapper\ValueObject\Type;
|
||||
|
||||
use RectorPrefix202310\Nette\Utils\Strings;
|
||||
use RectorPrefix202311\Nette\Utils\Strings;
|
||||
use PhpParser\Node\Name;
|
||||
use PhpParser\Node\Stmt\Use_;
|
||||
use PhpParser\Node\Stmt\UseUse;
|
||||
|
|
|
@ -4,7 +4,7 @@ declare (strict_types=1);
|
|||
namespace Rector\Testing\Fixture;
|
||||
|
||||
use Iterator;
|
||||
use RectorPrefix202310\Symfony\Component\Finder\Finder;
|
||||
use RectorPrefix202311\Symfony\Component\Finder\Finder;
|
||||
final class FixtureFileFinder
|
||||
{
|
||||
/**
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
declare (strict_types=1);
|
||||
namespace Rector\Testing\Fixture;
|
||||
|
||||
use RectorPrefix202310\Nette\Utils\FileSystem;
|
||||
use RectorPrefix202311\Nette\Utils\FileSystem;
|
||||
final class FixtureFileUpdater
|
||||
{
|
||||
/**
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
declare (strict_types=1);
|
||||
namespace Rector\Testing\Fixture;
|
||||
|
||||
use RectorPrefix202310\Nette\Utils\FileSystem;
|
||||
use RectorPrefix202311\Nette\Utils\FileSystem;
|
||||
/**
|
||||
* @api
|
||||
*/
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
declare (strict_types=1);
|
||||
namespace Rector\Testing\Fixture;
|
||||
|
||||
use RectorPrefix202310\Nette\Utils\FileSystem;
|
||||
use RectorPrefix202311\Nette\Utils\FileSystem;
|
||||
/**
|
||||
* @api used in tests
|
||||
*/
|
||||
|
|
|
@ -3,10 +3,10 @@
|
|||
declare (strict_types=1);
|
||||
namespace Rector\Testing\PHPUnit;
|
||||
|
||||
use RectorPrefix202310\Illuminate\Container\RewindableGenerator;
|
||||
use RectorPrefix202311\Illuminate\Container\RewindableGenerator;
|
||||
use Iterator;
|
||||
use RectorPrefix202310\Nette\Utils\FileSystem;
|
||||
use RectorPrefix202310\Nette\Utils\Strings;
|
||||
use RectorPrefix202311\Nette\Utils\FileSystem;
|
||||
use RectorPrefix202311\Nette\Utils\Strings;
|
||||
use PHPStan\Collectors\Collector;
|
||||
use PHPUnit\Framework\ExpectationFailedException;
|
||||
use Rector\Core\Application\ApplicationFileProcessor;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
declare (strict_types=1);
|
||||
namespace Rector\Testing\TestingParser;
|
||||
|
||||
use RectorPrefix202310\Nette\Utils\FileSystem;
|
||||
use RectorPrefix202311\Nette\Utils\FileSystem;
|
||||
use PhpParser\Node;
|
||||
use Rector\Core\Configuration\Option;
|
||||
use Rector\Core\Configuration\Parameter\SimpleParameterProvider;
|
||||
|
|
|
@ -28,7 +28,7 @@ use Rector\PHPStanStaticTypeMapper\Enum\TypeKind;
|
|||
use Rector\StaticTypeMapper\StaticTypeMapper;
|
||||
use Symplify\RuleDocGenerator\ValueObject\CodeSample\ConfiguredCodeSample;
|
||||
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
|
||||
use RectorPrefix202310\Webmozart\Assert\Assert;
|
||||
use RectorPrefix202311\Webmozart\Assert\Assert;
|
||||
/**
|
||||
* @see \Rector\Tests\Arguments\Rector\ClassMethod\ArgumentAdderRector\ArgumentAdderRectorTest
|
||||
*/
|
||||
|
|
|
@ -15,7 +15,7 @@ use Rector\Core\Rector\AbstractRector;
|
|||
use Rector\Core\ValueObject\MethodName;
|
||||
use Symplify\RuleDocGenerator\ValueObject\CodeSample\ConfiguredCodeSample;
|
||||
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
|
||||
use RectorPrefix202310\Webmozart\Assert\Assert;
|
||||
use RectorPrefix202311\Webmozart\Assert\Assert;
|
||||
/**
|
||||
* @api used in rector-symfony
|
||||
* @see \Rector\Tests\Arguments\Rector\ClassMethod\ReplaceArgumentDefaultValueRector\ReplaceArgumentDefaultValueRectorTest
|
||||
|
|
|
@ -11,7 +11,7 @@ use Rector\Core\Contract\Rector\ConfigurableRectorInterface;
|
|||
use Rector\Core\Rector\AbstractRector;
|
||||
use Symplify\RuleDocGenerator\ValueObject\CodeSample\ConfiguredCodeSample;
|
||||
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
|
||||
use RectorPrefix202310\Webmozart\Assert\Assert;
|
||||
use RectorPrefix202311\Webmozart\Assert\Assert;
|
||||
/**
|
||||
* @changelog https://php.watch/versions/8.1/version_compare-operator-restrictions
|
||||
* @changelog https://github.com/rectorphp/rector/issues/6271
|
||||
|
|
|
@ -11,7 +11,7 @@ use Rector\Core\Contract\Rector\ConfigurableRectorInterface;
|
|||
use Rector\Core\Rector\AbstractRector;
|
||||
use Symplify\RuleDocGenerator\ValueObject\CodeSample\ConfiguredCodeSample;
|
||||
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
|
||||
use RectorPrefix202310\Webmozart\Assert\Assert;
|
||||
use RectorPrefix202311\Webmozart\Assert\Assert;
|
||||
/**
|
||||
* @see \Rector\Tests\Arguments\Rector\MethodCall\RemoveMethodCallParamRector\RemoveMethodCallParamRectorTest
|
||||
*/
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
declare (strict_types=1);
|
||||
namespace Rector\CodeQuality\Rector\Concat;
|
||||
|
||||
use RectorPrefix202310\Nette\Utils\Strings;
|
||||
use RectorPrefix202311\Nette\Utils\Strings;
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr\BinaryOp\Concat;
|
||||
use PhpParser\Node\Scalar\String_;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
declare (strict_types=1);
|
||||
namespace Rector\CodeQuality\Rector\FuncCall;
|
||||
|
||||
use RectorPrefix202310\Nette\Utils\Strings;
|
||||
use RectorPrefix202311\Nette\Utils\Strings;
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Scalar\String_;
|
||||
use Rector\Core\Rector\AbstractRector;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
declare (strict_types=1);
|
||||
namespace Rector\CodeQuality\Rector\Include_;
|
||||
|
||||
use RectorPrefix202310\Nette\Utils\Strings;
|
||||
use RectorPrefix202311\Nette\Utils\Strings;
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr\BinaryOp\Concat;
|
||||
use PhpParser\Node\Expr\Include_;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
declare (strict_types=1);
|
||||
namespace Rector\CodingStyle\Application;
|
||||
|
||||
use RectorPrefix202310\Nette\Utils\Strings;
|
||||
use RectorPrefix202311\Nette\Utils\Strings;
|
||||
use PhpParser\Node\Name;
|
||||
use PhpParser\Node\Stmt;
|
||||
use PhpParser\Node\Stmt\Declare_;
|
||||
|
|
|
@ -6,6 +6,7 @@ namespace Rector\CodingStyle\ClassNameImport\ClassNameImportSkipVoter;
|
|||
use PhpParser\Node;
|
||||
use Rector\CodingStyle\ClassNameImport\ShortNameResolver;
|
||||
use Rector\CodingStyle\Contract\ClassNameImport\ClassNameImportSkipVoterInterface;
|
||||
use Rector\Core\Configuration\RenamedClassesDataCollector;
|
||||
use Rector\Core\ValueObject\Application\File;
|
||||
use Rector\StaticTypeMapper\ValueObject\Type\FullyQualifiedObjectType;
|
||||
/**
|
||||
|
@ -24,19 +25,29 @@ final class FullyQualifiedNameClassNameImportSkipVoter implements ClassNameImpor
|
|||
* @var \Rector\CodingStyle\ClassNameImport\ShortNameResolver
|
||||
*/
|
||||
private $shortNameResolver;
|
||||
public function __construct(ShortNameResolver $shortNameResolver)
|
||||
/**
|
||||
* @readonly
|
||||
* @var \Rector\Core\Configuration\RenamedClassesDataCollector
|
||||
*/
|
||||
private $renamedClassesDataCollector;
|
||||
public function __construct(ShortNameResolver $shortNameResolver, RenamedClassesDataCollector $renamedClassesDataCollector)
|
||||
{
|
||||
$this->shortNameResolver = $shortNameResolver;
|
||||
$this->renamedClassesDataCollector = $renamedClassesDataCollector;
|
||||
}
|
||||
public function shouldSkip(File $file, FullyQualifiedObjectType $fullyQualifiedObjectType, Node $node) : bool
|
||||
{
|
||||
// "new X" or "X::static()"
|
||||
/** @var array<string, string> $shortNamesToFullyQualifiedNames */
|
||||
$shortNamesToFullyQualifiedNames = $this->shortNameResolver->resolveFromFile($file);
|
||||
$removedUses = $this->renamedClassesDataCollector->getOldClasses();
|
||||
foreach ($shortNamesToFullyQualifiedNames as $shortName => $fullyQualifiedName) {
|
||||
if ($fullyQualifiedObjectType->getShortName() !== $shortName) {
|
||||
continue;
|
||||
}
|
||||
if (\in_array($fullyQualifiedName, $removedUses, \true)) {
|
||||
continue;
|
||||
}
|
||||
return $fullyQualifiedObjectType->getClassName() !== $fullyQualifiedName;
|
||||
}
|
||||
return \false;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
declare (strict_types=1);
|
||||
namespace Rector\CodingStyle\ClassNameImport;
|
||||
|
||||
use RectorPrefix202310\Nette\Utils\Reflection;
|
||||
use RectorPrefix202311\Nette\Utils\Reflection;
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Identifier;
|
||||
use PhpParser\Node\Name;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
declare (strict_types=1);
|
||||
namespace Rector\CodingStyle\Naming;
|
||||
|
||||
use RectorPrefix202310\Nette\Utils\Strings;
|
||||
use RectorPrefix202311\Nette\Utils\Strings;
|
||||
use PhpParser\Node\Identifier;
|
||||
use PhpParser\Node\Name;
|
||||
use PhpParser\Node\Stmt\ClassLike;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
declare (strict_types=1);
|
||||
namespace Rector\CodingStyle\NodeAnalyzer;
|
||||
|
||||
use RectorPrefix202310\Nette\Utils\Strings;
|
||||
use RectorPrefix202311\Nette\Utils\Strings;
|
||||
use PhpParser\Node\Identifier;
|
||||
use PhpParser\Node\Stmt;
|
||||
use PhpParser\Node\Stmt\GroupUse;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
declare (strict_types=1);
|
||||
namespace Rector\CodingStyle\Rector\Catch_;
|
||||
|
||||
use RectorPrefix202310\Nette\Utils\Strings;
|
||||
use RectorPrefix202311\Nette\Utils\Strings;
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr\Assign;
|
||||
use PhpParser\Node\Expr\Closure;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
declare (strict_types=1);
|
||||
namespace Rector\CodingStyle\Rector\Encapsed;
|
||||
|
||||
use RectorPrefix202310\Nette\Utils\Strings;
|
||||
use RectorPrefix202311\Nette\Utils\Strings;
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Arg;
|
||||
use PhpParser\Node\Expr;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
declare (strict_types=1);
|
||||
namespace Rector\CodingStyle\Rector\String_;
|
||||
|
||||
use RectorPrefix202310\Nette\Utils\Strings;
|
||||
use RectorPrefix202311\Nette\Utils\Strings;
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr\ClassConstFetch;
|
||||
use PhpParser\Node\Name\FullyQualified;
|
||||
|
|
|
@ -17,7 +17,7 @@ use Rector\Core\Contract\Rector\ConfigurableRectorInterface;
|
|||
use Rector\Core\Rector\AbstractRector;
|
||||
use Symplify\RuleDocGenerator\ValueObject\CodeSample\ConfiguredCodeSample;
|
||||
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
|
||||
use RectorPrefix202310\Webmozart\Assert\Assert;
|
||||
use RectorPrefix202311\Webmozart\Assert\Assert;
|
||||
/**
|
||||
* @see \Rector\Tests\DeadCode\Rector\ClassLike\RemoveAnnotationRector\RemoveAnnotationRectorTest
|
||||
*/
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
declare (strict_types=1);
|
||||
namespace Rector\DeadCode\SideEffect;
|
||||
|
||||
use RectorPrefix202310\Nette\Utils\Strings;
|
||||
use RectorPrefix202311\Nette\Utils\Strings;
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr;
|
||||
use PhpParser\Node\Expr\ArrayDimFetch;
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue