mirror of
https://github.com/rectorphp/rector.git
synced 2025-04-11 19:11:57 +02:00
Updated Rector to commit 74df7741a7d0798888d2d9a3bf1020746b80ad8e
74df7741a7
[PostRector] Fix unused import not removed on empty generic class name exists (#5012)
This commit is contained in:
parent
66134953c2
commit
2331f6b39c
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 ComposerAutoloaderInit33a4f154d243e1d7c08d04a30fb200d1::getLoader();
|
||||
return ComposerAutoloaderInitfc60864e8baa406f3cb1a7a1afef9c9e::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 ComposerAutoloaderInit33a4f154d243e1d7c08d04a30fb200d1
|
||||
class ComposerAutoloaderInitfc60864e8baa406f3cb1a7a1afef9c9e
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
@ -22,17 +22,17 @@ class ComposerAutoloaderInit33a4f154d243e1d7c08d04a30fb200d1
|
||||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInit33a4f154d243e1d7c08d04a30fb200d1', 'loadClassLoader'), true, true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInitfc60864e8baa406f3cb1a7a1afef9c9e', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit33a4f154d243e1d7c08d04a30fb200d1', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInitfc60864e8baa406f3cb1a7a1afef9c9e', 'loadClassLoader'));
|
||||
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit33a4f154d243e1d7c08d04a30fb200d1::getInitializer($loader));
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInitfc60864e8baa406f3cb1a7a1afef9c9e::getInitializer($loader));
|
||||
|
||||
$loader->setClassMapAuthoritative(true);
|
||||
$loader->register(true);
|
||||
|
||||
$filesToLoad = \Composer\Autoload\ComposerStaticInit33a4f154d243e1d7c08d04a30fb200d1::$files;
|
||||
$filesToLoad = \Composer\Autoload\ComposerStaticInitfc60864e8baa406f3cb1a7a1afef9c9e::$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 ComposerStaticInit33a4f154d243e1d7c08d04a30fb200d1
|
||||
class ComposerStaticInitfc60864e8baa406f3cb1a7a1afef9c9e
|
||||
{
|
||||
public static $files = array (
|
||||
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
|
||||
@ -2593,9 +2593,9 @@ class ComposerStaticInit33a4f154d243e1d7c08d04a30fb200d1
|
||||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit33a4f154d243e1d7c08d04a30fb200d1::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit33a4f154d243e1d7c08d04a30fb200d1::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit33a4f154d243e1d7c08d04a30fb200d1::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInitfc60864e8baa406f3cb1a7a1afef9c9e::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInitfc60864e8baa406f3cb1a7a1afef9c9e::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInitfc60864e8baa406f3cb1a7a1afef9c9e::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
40
vendor/composer/installed.json
vendored
40
vendor/composer/installed.json
vendored
@ -504,8 +504,8 @@
|
||||
},
|
||||
{
|
||||
"name": "illuminate\/container",
|
||||
"version": "v10.23.0",
|
||||
"version_normalized": "10.23.0.0",
|
||||
"version": "v10.23.1",
|
||||
"version_normalized": "10.23.1.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/illuminate\/container.git",
|
||||
@ -561,8 +561,8 @@
|
||||
},
|
||||
{
|
||||
"name": "illuminate\/contracts",
|
||||
"version": "v10.23.0",
|
||||
"version_normalized": "10.23.0.0",
|
||||
"version": "v10.23.1",
|
||||
"version_normalized": "10.23.1.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/illuminate\/contracts.git",
|
||||
@ -1744,12 +1744,12 @@
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/rectorphp\/rector-doctrine.git",
|
||||
"reference": "4fb068db5a67f0506412ad3dfc8bb04c44c35df2"
|
||||
"reference": "b599d7a8d207391ce74b35632a3e4a51043bc182"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-doctrine\/zipball\/4fb068db5a67f0506412ad3dfc8bb04c44c35df2",
|
||||
"reference": "4fb068db5a67f0506412ad3dfc8bb04c44c35df2",
|
||||
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-doctrine\/zipball\/b599d7a8d207391ce74b35632a3e4a51043bc182",
|
||||
"reference": "b599d7a8d207391ce74b35632a3e4a51043bc182",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -1774,7 +1774,7 @@
|
||||
"tomasvotruba\/type-coverage": "^0.2",
|
||||
"tomasvotruba\/unused-public": "^0.3"
|
||||
},
|
||||
"time": "2023-09-13T14:35:42+00:00",
|
||||
"time": "2023-09-13T14:52:54+00:00",
|
||||
"default-branch": true,
|
||||
"type": "rector-extension",
|
||||
"extra": {
|
||||
@ -1807,12 +1807,12 @@
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/rectorphp\/rector-downgrade-php.git",
|
||||
"reference": "86f57eee49e0beae650cbef6ff70841849cca6a0"
|
||||
"reference": "3782784fc66a6e03b1d94c532268a49ac2d68392"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-downgrade-php\/zipball\/86f57eee49e0beae650cbef6ff70841849cca6a0",
|
||||
"reference": "86f57eee49e0beae650cbef6ff70841849cca6a0",
|
||||
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-downgrade-php\/zipball\/3782784fc66a6e03b1d94c532268a49ac2d68392",
|
||||
"reference": "3782784fc66a6e03b1d94c532268a49ac2d68392",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -1839,7 +1839,7 @@
|
||||
"tomasvotruba\/unused-public": "^0.2",
|
||||
"tracy\/tracy": "^2.10"
|
||||
},
|
||||
"time": "2023-09-11T17:45:57+00:00",
|
||||
"time": "2023-09-13T15:04:17+00:00",
|
||||
"default-branch": true,
|
||||
"type": "rector-extension",
|
||||
"extra": {
|
||||
@ -1872,12 +1872,12 @@
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/rectorphp\/rector-phpunit.git",
|
||||
"reference": "d4ca7d7e4d5d6d9d61d8aa1695010a6a6df50f47"
|
||||
"reference": "2a9734abbc73619f2897162dea012ebef8200eba"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-phpunit\/zipball\/d4ca7d7e4d5d6d9d61d8aa1695010a6a6df50f47",
|
||||
"reference": "d4ca7d7e4d5d6d9d61d8aa1695010a6a6df50f47",
|
||||
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-phpunit\/zipball\/2a9734abbc73619f2897162dea012ebef8200eba",
|
||||
"reference": "2a9734abbc73619f2897162dea012ebef8200eba",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -1907,7 +1907,7 @@
|
||||
"tomasvotruba\/unused-public": "^0.3",
|
||||
"tracy\/tracy": "^2.10"
|
||||
},
|
||||
"time": "2023-09-11T17:34:46+00:00",
|
||||
"time": "2023-09-13T15:00:43+00:00",
|
||||
"default-branch": true,
|
||||
"type": "rector-extension",
|
||||
"extra": {
|
||||
@ -1943,12 +1943,12 @@
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/rectorphp\/rector-symfony.git",
|
||||
"reference": "6ef9eb731559a91c170f27c6432a0b76176f5655"
|
||||
"reference": "09ddd39b611dd02321b4b79f5e175a819e04c670"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-symfony\/zipball\/6ef9eb731559a91c170f27c6432a0b76176f5655",
|
||||
"reference": "6ef9eb731559a91c170f27c6432a0b76176f5655",
|
||||
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-symfony\/zipball\/09ddd39b611dd02321b4b79f5e175a819e04c670",
|
||||
"reference": "09ddd39b611dd02321b4b79f5e175a819e04c670",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -1981,7 +1981,7 @@
|
||||
"tomasvotruba\/unused-public": "^0.2",
|
||||
"tracy\/tracy": "^2.10"
|
||||
},
|
||||
"time": "2023-09-11T17:29:57+00:00",
|
||||
"time": "2023-09-13T14:49:54+00:00",
|
||||
"default-branch": true,
|
||||
"type": "rector-extension",
|
||||
"extra": {
|
||||
|
2
vendor/composer/installed.php
vendored
2
vendor/composer/installed.php
vendored
File diff suppressed because one or more lines are too long
@ -9,7 +9,7 @@ namespace Rector\RectorInstaller;
|
||||
*/
|
||||
final class GeneratedConfig
|
||||
{
|
||||
public const EXTENSIONS = array('rector/rector-doctrine' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-doctrine', 'relative_install_path' => '../../rector-doctrine', 'extra' => NULL, 'version' => 'dev-main 4fb068d'), 'rector/rector-downgrade-php' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-downgrade-php', 'relative_install_path' => '../../rector-downgrade-php', 'extra' => NULL, 'version' => 'dev-main 86f57ee'), 'rector/rector-phpunit' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpunit', 'relative_install_path' => '../../rector-phpunit', 'extra' => NULL, 'version' => 'dev-main d4ca7d7'), 'rector/rector-symfony' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-symfony', 'relative_install_path' => '../../rector-symfony', 'extra' => NULL, 'version' => 'dev-main 6ef9eb7'));
|
||||
public const EXTENSIONS = array('rector/rector-doctrine' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-doctrine', 'relative_install_path' => '../../rector-doctrine', 'extra' => NULL, 'version' => 'dev-main b599d7a'), 'rector/rector-downgrade-php' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-downgrade-php', 'relative_install_path' => '../../rector-downgrade-php', 'extra' => NULL, 'version' => 'dev-main 3782784'), 'rector/rector-phpunit' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpunit', 'relative_install_path' => '../../rector-phpunit', 'extra' => NULL, 'version' => 'dev-main 2a9734a'), 'rector/rector-symfony' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-symfony', 'relative_install_path' => '../../rector-symfony', 'extra' => NULL, 'version' => 'dev-main 09ddd39'));
|
||||
private function __construct()
|
||||
{
|
||||
}
|
||||
|
3
vendor/rector/rector-doctrine/rector.php
vendored
3
vendor/rector/rector-doctrine/rector.php
vendored
@ -10,7 +10,8 @@ use Rector\Set\ValueObject\LevelSetList;
|
||||
use Rector\Set\ValueObject\SetList;
|
||||
return static function (RectorConfig $rectorConfig) : void {
|
||||
$rectorConfig->importNames();
|
||||
$rectorConfig->paths([__DIR__ . '/src', __DIR__ . '/tests']);
|
||||
$rectorConfig->removeUnusedImports();
|
||||
$rectorConfig->paths([__DIR__ . '/src', __DIR__ . '/rules', __DIR__ . '/tests']);
|
||||
$rectorConfig->skip([
|
||||
// for tests
|
||||
'*/Source/*',
|
||||
|
@ -13,7 +13,6 @@ use PHPStan\PhpDocParser\Ast\ConstExpr\ConstExprTrueNode;
|
||||
use Rector\BetterPhpDocParser\PhpDoc\ArrayItemNode;
|
||||
use Rector\BetterPhpDocParser\PhpDoc\DoctrineAnnotationTagValueNode;
|
||||
use Rector\BetterPhpDocParser\PhpDoc\StringNode;
|
||||
use Rector\BetterPhpDocParser\PhpDocNodeVisitor\UnionTypeNodePhpDocNodeVisitor;
|
||||
use Rector\BetterPhpDocParser\ValueObject\PhpDoc\DoctrineAnnotation\CurlyListNode;
|
||||
use Rector\Comments\NodeDocBlock\DocBlockUpdater;
|
||||
use Rector\Core\Rector\AbstractRector;
|
||||
|
@ -3,12 +3,12 @@
|
||||
declare (strict_types=1);
|
||||
namespace Rector\Doctrine\CodeQuality\Rector\Property;
|
||||
|
||||
use RectorPrefix202309\Doctrine\Common\Collections\Criteria;
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Attribute;
|
||||
use PhpParser\Node\Expr\Array_;
|
||||
use PhpParser\Node\Expr\ArrayItem;
|
||||
use PhpParser\Node\Scalar\String_;
|
||||
use PhpParser\Node\Stmt\Property;
|
||||
use Rector\BetterPhpDocParser\PhpDoc\DoctrineAnnotationTagValueNode;
|
||||
use Rector\Core\Rector\AbstractRector;
|
||||
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
|
||||
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
|
||||
@ -63,7 +63,7 @@ CODE_SAMPLE
|
||||
}
|
||||
}
|
||||
// If Attribute is not OrderBy, return null
|
||||
if (null === $nodeAttribute) {
|
||||
if (!$nodeAttribute instanceof Attribute) {
|
||||
return null;
|
||||
}
|
||||
if (!isset($nodeAttribute->args[0])) {
|
||||
@ -75,14 +75,14 @@ CODE_SAMPLE
|
||||
if (!isset($nodeAttribute->args[0]->value->items[0])) {
|
||||
return null;
|
||||
}
|
||||
if (!$nodeAttribute->args[0]->value->items[0] instanceof Node\Expr\ArrayItem) {
|
||||
if (!$nodeAttribute->args[0]->value->items[0] instanceof ArrayItem) {
|
||||
return null;
|
||||
}
|
||||
if (!$nodeAttribute->args[0]->value->items[0]->value instanceof String_) {
|
||||
return null;
|
||||
}
|
||||
// If Attribute value from key is not `ASC` or `DESC`, return null
|
||||
if (!\in_array($nodeAttribute->args[0]->value->items[0]->value->value, ['ASC', 'asc', 'DESC', 'desc'])) {
|
||||
if (!\in_array($nodeAttribute->args[0]->value->items[0]->value->value, ['ASC', 'asc', 'DESC', 'desc'], \true)) {
|
||||
return null;
|
||||
}
|
||||
$upper = \strtoupper($nodeAttribute->args[0]->value->items[0]->value->value);
|
||||
|
@ -9,10 +9,7 @@ use PHPStan\Type\MixedType;
|
||||
use PHPStan\Type\Type;
|
||||
use PHPStan\Type\TypeCombinator;
|
||||
use PHPStan\Type\UnionType;
|
||||
use Rector\BetterPhpDocParser\PhpDocManipulator\PhpDocTypeChanger;
|
||||
use Rector\Core\Php\PhpVersionProvider;
|
||||
use Rector\Core\Rector\AbstractRector;
|
||||
use Rector\Core\ValueObject\PhpVersion;
|
||||
use Rector\Core\ValueObject\PhpVersionFeature;
|
||||
use Rector\Doctrine\NodeManipulator\ColumnPropertyTypeResolver;
|
||||
use Rector\Doctrine\NodeManipulator\NullabilityColumnPropertyTypeResolver;
|
||||
|
@ -6,7 +6,6 @@ namespace Rector\NodeAnalyzer;
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr;
|
||||
use PhpParser\Node\Expr\Closure;
|
||||
use PhpParser\Node\Stmt;
|
||||
use PhpParser\Node\Stmt\Do_;
|
||||
use PhpParser\Node\Stmt\Echo_;
|
||||
use PhpParser\Node\Stmt\Expression;
|
||||
|
2
vendor/rector/rector-phpunit/rector.php
vendored
2
vendor/rector/rector-phpunit/rector.php
vendored
@ -11,7 +11,7 @@ use Rector\Set\ValueObject\SetList;
|
||||
return static function (RectorConfig $rectorConfig) : void {
|
||||
$rectorConfig->importNames();
|
||||
$rectorConfig->removeUnusedImports();
|
||||
$rectorConfig->paths([__DIR__ . '/src', __DIR__ . '/tests', __DIR__ . '/rules', __DIR__ . '/rules-tests']);
|
||||
$rectorConfig->paths([__DIR__ . '/config', __DIR__ . '/src', __DIR__ . '/tests', __DIR__ . '/rules', __DIR__ . '/rules-tests', __DIR__ . '/rector.php', __DIR__ . '/ecs.php']);
|
||||
$rectorConfig->skip([
|
||||
// for tests
|
||||
'*/Source/*',
|
||||
|
@ -3,8 +3,8 @@
|
||||
declare (strict_types=1);
|
||||
namespace Rector\PHPUnit\AnnotationsToAttributes\Rector\Class_;
|
||||
|
||||
use PhpParser\Node\Arg;
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Arg;
|
||||
use PhpParser\Node\Attribute;
|
||||
use PhpParser\Node\AttributeGroup;
|
||||
use PhpParser\Node\Name\FullyQualified;
|
||||
@ -19,10 +19,8 @@ use Rector\BetterPhpDocParser\PhpDocManipulator\PhpDocTagRemover;
|
||||
use Rector\Comments\NodeDocBlock\DocBlockUpdater;
|
||||
use Rector\Core\Rector\AbstractRector;
|
||||
use Rector\Core\ValueObject\PhpVersionFeature;
|
||||
use Rector\PHPUnit\ValueObject\AnnotationWithValueToAttribute;
|
||||
use Rector\VersionBonding\Contract\MinPhpVersionInterface;
|
||||
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
|
||||
use Symplify\RuleDocGenerator\ValueObject\CodeSample\ConfiguredCodeSample;
|
||||
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
|
||||
/**
|
||||
* @changelog https://docs.phpunit.de/en/10.0/annotations.html#ticket
|
||||
|
@ -9,7 +9,6 @@ use PhpParser\Node\Expr\CallLike;
|
||||
use PhpParser\Node\Expr\ClassConstFetch;
|
||||
use PhpParser\Node\Expr\MethodCall;
|
||||
use PhpParser\Node\Expr\New_;
|
||||
use PhpParser\Node\Identifier;
|
||||
use PhpParser\Node\Scalar\LNumber;
|
||||
use PHPStan\Type\ObjectType;
|
||||
use Rector\Core\Rector\AbstractRector;
|
||||
|
@ -9,7 +9,6 @@ use Rector\BetterPhpDocParser\PhpDoc\ArrayItemNode;
|
||||
use Rector\BetterPhpDocParser\PhpDoc\DoctrineAnnotationTagValueNode;
|
||||
use Rector\BetterPhpDocParser\PhpDoc\StringNode;
|
||||
use Rector\BetterPhpDocParser\PhpDocManipulator\PhpDocTagRemover;
|
||||
use Rector\BetterPhpDocParser\Printer\PhpDocInfoPrinter;
|
||||
use Rector\BetterPhpDocParser\ValueObject\PhpDoc\DoctrineAnnotation\CurlyListNode;
|
||||
use Rector\Comments\NodeDocBlock\DocBlockUpdater;
|
||||
use Rector\Core\Rector\AbstractRector;
|
||||
|
@ -3,12 +3,12 @@
|
||||
declare (strict_types=1);
|
||||
namespace Rector\Symfony\Symfony43\Rector\ClassMethod;
|
||||
|
||||
use PHPStan\Reflection\ClassReflection;
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr\StaticCall;
|
||||
use PhpParser\Node\Stmt\ClassMethod;
|
||||
use PhpParser\Node\Stmt\Expression;
|
||||
use PHPStan\Analyser\Scope;
|
||||
use PHPStan\Reflection\ClassReflection;
|
||||
use Rector\Core\Enum\ObjectReference;
|
||||
use Rector\Core\Rector\AbstractScopeAwareRector;
|
||||
use Rector\Core\ValueObject\MethodName;
|
||||
|
@ -5,17 +5,16 @@ namespace Rector\Symfony\Symfony43\Rector\StmtsAwareInterface;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Arg;
|
||||
use PhpParser\Node\Expr;
|
||||
use PhpParser\Node\Expr\Assign;
|
||||
use PhpParser\Node\Expr\MethodCall;
|
||||
use PhpParser\Node\Expr\New_;
|
||||
use PhpParser\Node\Name\FullyQualified;
|
||||
use PhpParser\Node\Stmt\Expression;
|
||||
use PHPStan\Type\ObjectType;
|
||||
use Rector\Core\Contract\PhpParser\Node\StmtsAwareInterface;
|
||||
use Rector\Core\Rector\AbstractRector;
|
||||
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
|
||||
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
|
||||
use PHPStan\Type\ObjectType;
|
||||
/**
|
||||
* @see \Rector\Symfony\Tests\Symfony43\Rector\StmtsAwareInterface\TwigBundleFilesystemLoaderToTwigRector\TwigBundleFilesystemLoaderToTwigRectorTest
|
||||
*/
|
||||
|
@ -88,14 +88,13 @@ CODE_SAMPLE
|
||||
return \false;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @return array{bool, Expr|null, Expr|null}
|
||||
*/
|
||||
private function extractSupportsArguments(Class_ $class, int $key, ClassMethod $classMethod) : array
|
||||
{
|
||||
$isIdentical = \true;
|
||||
$supportFirstArg = $supportSecondArg = null;
|
||||
if (null === $classMethod->getStmts()) {
|
||||
if ($classMethod->getStmts() === null) {
|
||||
return [$isIdentical, $supportFirstArg, $supportSecondArg];
|
||||
}
|
||||
foreach ($classMethod->getStmts() as $stmt) {
|
||||
|
@ -3,14 +3,14 @@
|
||||
declare (strict_types=1);
|
||||
namespace Rector\Symfony\Symfony62\Rector\Class_;
|
||||
|
||||
use PhpParser\Node\Expr\Yield_;
|
||||
use PhpParser\Node\Expr\ClassConstFetch;
|
||||
use PhpParser\Node\Expr\Array_;
|
||||
use PhpParser\Node\Name;
|
||||
use PhpParser\Node\Expr\ArrayItem;
|
||||
use PhpParser\Node\Expr;
|
||||
use PhpParser\Node\Identifier;
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr;
|
||||
use PhpParser\Node\Expr\Array_;
|
||||
use PhpParser\Node\Expr\ArrayItem;
|
||||
use PhpParser\Node\Expr\ClassConstFetch;
|
||||
use PhpParser\Node\Expr\Yield_;
|
||||
use PhpParser\Node\Identifier;
|
||||
use PhpParser\Node\Name;
|
||||
use PhpParser\Node\Stmt\Class_;
|
||||
use PhpParser\Node\Stmt\ClassMethod;
|
||||
use PhpParser\Node\Stmt\Expression;
|
||||
@ -134,7 +134,7 @@ CODE_SAMPLE
|
||||
return null;
|
||||
}
|
||||
$stmts = (array) $getHandledMessagesClassMethod->stmts;
|
||||
if ([] === $stmts) {
|
||||
if ($stmts === []) {
|
||||
return null;
|
||||
}
|
||||
if ($stmts[0] instanceof Expression && $stmts[0]->expr instanceof Yield_) {
|
||||
@ -184,7 +184,7 @@ CODE_SAMPLE
|
||||
}
|
||||
$key = (string) $this->valueResolver->getValue($item->key);
|
||||
$value = $this->valueResolver->getValue($item->value);
|
||||
if ('method' === $key) {
|
||||
if ($key === 'method') {
|
||||
$method = $value;
|
||||
continue;
|
||||
}
|
||||
@ -201,7 +201,7 @@ CODE_SAMPLE
|
||||
if (!$classMethod instanceof ClassMethod) {
|
||||
return;
|
||||
}
|
||||
if (MethodName::INVOKE === $classMethodName) {
|
||||
if ($classMethodName === MethodName::INVOKE) {
|
||||
$this->renameInvoke($classMethod);
|
||||
}
|
||||
$this->messengerHelper->addAttribute($classMethod, $arguments);
|
||||
|
@ -1,15 +1,16 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace Rector\Symfony\Symfony63\Rector\Class_;
|
||||
|
||||
use Rector\Core\Rector\AbstractRector;
|
||||
use PhpParser\Node\Stmt\ClassMethod;
|
||||
use PHPStan\Type\UnionType;
|
||||
use PHPStan\Type\IntegerType;
|
||||
use PHPStan\Type\Constant\ConstantBooleanType;
|
||||
use PhpParser\Node\Stmt\Return_;
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Stmt\Class_;
|
||||
use PhpParser\Node\Stmt\ClassMethod;
|
||||
use PhpParser\Node\Stmt\Return_;
|
||||
use PHPStan\Type\Constant\ConstantBooleanType;
|
||||
use PHPStan\Type\IntegerType;
|
||||
use PHPStan\Type\UnionType;
|
||||
use Rector\Core\Rector\AbstractRector;
|
||||
use Rector\PHPStanStaticTypeMapper\Enum\TypeKind;
|
||||
use Rector\Symfony\NodeAnalyzer\ClassAnalyzer;
|
||||
use Rector\VendorLocker\ParentClassMethodTypeOverrideGuard;
|
||||
@ -51,9 +52,6 @@ CODE_SAMPLE
|
||||
CODE_SAMPLE
|
||||
)]);
|
||||
}
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getNodeTypes() : array
|
||||
{
|
||||
return [Class_::class];
|
||||
|
Loading…
x
Reference in New Issue
Block a user