Updated Rector to commit 4d01db5c10372f2a0a7cf63ec51fa7e2913ee2a3

4d01db5c10 [DX] Improve direct return of Stmt arrays in Rector rules, remove NodesToAddCollector from AbstractRector (#2623)
This commit is contained in:
Tomas Votruba 2022-07-03 21:09:19 +00:00
parent 175fded020
commit 68e1f45251
37 changed files with 249 additions and 78 deletions

View File

@ -2018,11 +2018,11 @@ Add new line after statements to tidify code
```diff
class SomeClass
{
public function test()
public function first()
{
}
+
public function test2()
public function second()
{
}
}

View File

@ -4,8 +4,6 @@ declare (strict_types=1);
namespace Rector\CodingStyle\Rector\PostInc;
use PhpParser\Node;
use PhpParser\Node\Expr;
use PhpParser\Node\Expr\ArrayDimFetch;
use PhpParser\Node\Expr\PostDec;
use PhpParser\Node\Expr\PostInc;
use PhpParser\Node\Expr\PreDec;
@ -61,9 +59,6 @@ CODE_SAMPLE
if ($this->isAnExpression($parentNode)) {
return $this->processPrePost($node);
}
if ($parentNode instanceof ArrayDimFetch && $this->nodeComparator->areNodesEqual($parentNode->dim, $node)) {
return $this->processPreArray($node, $parentNode);
}
if (!$parentNode instanceof For_) {
return null;
}
@ -93,19 +88,6 @@ CODE_SAMPLE
}
return new PreDec($node->var);
}
/**
* @param \PhpParser\Node\Expr\PostInc|\PhpParser\Node\Expr\PostDec $node
*/
private function processPreArray($node, ArrayDimFetch $arrayDimFetch) : ?Expr
{
$parentOfArrayDimFetch = $arrayDimFetch->getAttribute(AttributeKey::PARENT_NODE);
if (!$this->isAnExpression($parentOfArrayDimFetch)) {
return null;
}
$arrayDimFetch->dim = $node->var;
$this->nodesToAddCollector->addNodeAfterNode($this->processPrePost($node), $arrayDimFetch);
return $arrayDimFetch->dim;
}
/**
* @param \PhpParser\Node\Expr\PostInc|\PhpParser\Node\Expr\PostDec $node
* @return \PhpParser\Node\Expr\PreDec|\PhpParser\Node\Expr\PreInc

View File

@ -15,6 +15,7 @@ use PhpParser\Node\Name;
use PhpParser\Node\Scalar\LNumber;
use Rector\Core\Rector\AbstractRector;
use Rector\NodeTypeResolver\Node\AttributeKey;
use Rector\PostRector\Collector\NodesToAddCollector;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
/**
@ -31,6 +32,15 @@ final class MysqlAssignToMysqliRector extends AbstractRector
* @var string
*/
private const MYSQLI_DATA_SEEK = 'mysqli_data_seek';
/**
* @readonly
* @var \Rector\PostRector\Collector\NodesToAddCollector
*/
private $nodesToAddCollector;
public function __construct(NodesToAddCollector $nodesToAddCollector)
{
$this->nodesToAddCollector = $nodesToAddCollector;
}
public function getRuleDefinition() : RuleDefinition
{
return new RuleDefinition('Converts more complex mysql functions to mysqli', [new CodeSample(<<<'CODE_SAMPLE'

View File

@ -34,6 +34,7 @@ use Rector\Naming\Naming\VariableNaming;
use Rector\NodeNestingScope\ParentScopeFinder;
use Rector\NodeTypeResolver\Node\AttributeKey;
use Rector\Php70\ValueObject\VariableAssignPair;
use Rector\PostRector\Collector\NodesToAddCollector;
use Rector\VersionBonding\Contract\MinPhpVersionInterface;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
@ -64,12 +65,18 @@ final class NonVariableToVariableOnFunctionCallRector extends AbstractRector imp
* @var \Rector\Core\NodeAnalyzer\ArgsAnalyzer
*/
private $argsAnalyzer;
public function __construct(VariableNaming $variableNaming, ParentScopeFinder $parentScopeFinder, ReflectionResolver $reflectionResolver, ArgsAnalyzer $argsAnalyzer)
/**
* @readonly
* @var \Rector\PostRector\Collector\NodesToAddCollector
*/
private $nodesToAddCollector;
public function __construct(VariableNaming $variableNaming, ParentScopeFinder $parentScopeFinder, ReflectionResolver $reflectionResolver, ArgsAnalyzer $argsAnalyzer, NodesToAddCollector $nodesToAddCollector)
{
$this->variableNaming = $variableNaming;
$this->parentScopeFinder = $parentScopeFinder;
$this->reflectionResolver = $reflectionResolver;
$this->argsAnalyzer = $argsAnalyzer;
$this->nodesToAddCollector = $nodesToAddCollector;
}
public function getRuleDefinition() : RuleDefinition
{

View File

@ -14,6 +14,7 @@ use Rector\Core\NodeManipulator\AssignManipulator;
use Rector\Core\Rector\AbstractRector;
use Rector\Core\ValueObject\PhpVersionFeature;
use Rector\NodeTypeResolver\Node\AttributeKey;
use Rector\PostRector\Collector\NodesToAddCollector;
use Rector\VersionBonding\Contract\MinPhpVersionInterface;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
@ -29,9 +30,15 @@ final class ListEachRector extends AbstractRector implements MinPhpVersionInterf
* @var \Rector\Core\NodeManipulator\AssignManipulator
*/
private $assignManipulator;
public function __construct(AssignManipulator $assignManipulator)
/**
* @readonly
* @var \Rector\PostRector\Collector\NodesToAddCollector
*/
private $nodesToAddCollector;
public function __construct(AssignManipulator $assignManipulator, NodesToAddCollector $nodesToAddCollector)
{
$this->assignManipulator = $assignManipulator;
$this->nodesToAddCollector = $nodesToAddCollector;
}
public function provideMinPhpVersion() : int
{

View File

@ -15,6 +15,7 @@ use PhpParser\Node\Stmt\While_;
use Rector\Core\Rector\AbstractRector;
use Rector\Core\ValueObject\PhpVersionFeature;
use Rector\NodeTypeResolver\Node\AttributeKey;
use Rector\PostRector\Collector\NodesToAddCollector;
use Rector\VersionBonding\Contract\MinPhpVersionInterface;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
@ -27,6 +28,15 @@ final class ReplaceEachAssignmentWithKeyCurrentRector extends AbstractRector imp
* @var string
*/
private const KEY = 'key';
/**
* @readonly
* @var \Rector\PostRector\Collector\NodesToAddCollector
*/
private $nodesToAddCollector;
public function __construct(NodesToAddCollector $nodesToAddCollector)
{
$this->nodesToAddCollector = $nodesToAddCollector;
}
public function provideMinPhpVersion() : int
{
return PhpVersionFeature::NO_EACH_OUTSIDE_LOOP;

View File

@ -17,6 +17,7 @@ use Rector\Core\Rector\AbstractRector;
use Rector\Core\ValueObject\PhpVersionFeature;
use Rector\NodeTypeResolver\Node\AttributeKey;
use Rector\Php80\NodeManipulator\TokenManipulator;
use Rector\PostRector\Collector\NodesToAddCollector;
use Rector\VersionBonding\Contract\MinPhpVersionInterface;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
@ -32,9 +33,15 @@ final class TokenGetAllToObjectRector extends AbstractRector implements MinPhpVe
* @var \Rector\Php80\NodeManipulator\TokenManipulator
*/
private $tokenManipulator;
public function __construct(TokenManipulator $tokenManipulator)
/**
* @readonly
* @var \Rector\PostRector\Collector\NodesToAddCollector
*/
private $nodesToAddCollector;
public function __construct(TokenManipulator $tokenManipulator, NodesToAddCollector $nodesToAddCollector)
{
$this->tokenManipulator = $tokenManipulator;
$this->nodesToAddCollector = $nodesToAddCollector;
}
public function provideMinPhpVersion() : int
{

View File

@ -17,12 +17,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = 'f8221e3e21c487f2d18707f7b979ef6607204826';
public const PACKAGE_VERSION = '4d01db5c10372f2a0a7cf63ec51fa7e2913ee2a3';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2022-07-03 22:37:10';
public const RELEASE_DATE = '2022-07-03 23:04:12';
/**
* @var int
*/

View File

@ -36,7 +36,6 @@ use Rector\NodeNameResolver\NodeNameResolver;
use Rector\NodeRemoval\NodeRemover;
use Rector\NodeTypeResolver\Node\AttributeKey;
use Rector\NodeTypeResolver\NodeTypeResolver;
use Rector\PostRector\Collector\NodesToAddCollector;
use Rector\PostRector\Collector\NodesToRemoveCollector;
use Rector\StaticTypeMapper\StaticTypeMapper;
use RectorPrefix202207\Symfony\Contracts\Service\Attribute\Required;
@ -103,11 +102,6 @@ CODE_SAMPLE;
* @var \Rector\Core\ValueObject\Application\File
*/
protected $file;
/**
* @deprecated Return stmts directly instead
* @var \Rector\PostRector\Collector\NodesToAddCollector
*/
protected $nodesToAddCollector;
/**
* @var \Rector\Core\Application\ChangedNodeScopeRefresher
*/
@ -159,10 +153,9 @@ CODE_SAMPLE;
/**
* @required
*/
public function autowire(NodesToRemoveCollector $nodesToRemoveCollector, NodesToAddCollector $nodesToAddCollector, NodeRemover $nodeRemover, NodeNameResolver $nodeNameResolver, NodeTypeResolver $nodeTypeResolver, SimpleCallableNodeTraverser $simpleCallableNodeTraverser, NodeFactory $nodeFactory, PhpDocInfoFactory $phpDocInfoFactory, ExclusionManager $exclusionManager, StaticTypeMapper $staticTypeMapper, CurrentRectorProvider $currentRectorProvider, CurrentNodeProvider $currentNodeProvider, Skipper $skipper, ValueResolver $valueResolver, BetterNodeFinder $betterNodeFinder, NodeComparator $nodeComparator, CurrentFileProvider $currentFileProvider, RectifiedAnalyzer $rectifiedAnalyzer, CreatedByRuleDecorator $createdByRuleDecorator, ChangedNodeScopeRefresher $changedNodeScopeRefresher, RectorOutputStyle $rectorOutputStyle) : void
public function autowire(NodesToRemoveCollector $nodesToRemoveCollector, NodeRemover $nodeRemover, NodeNameResolver $nodeNameResolver, NodeTypeResolver $nodeTypeResolver, SimpleCallableNodeTraverser $simpleCallableNodeTraverser, NodeFactory $nodeFactory, PhpDocInfoFactory $phpDocInfoFactory, ExclusionManager $exclusionManager, StaticTypeMapper $staticTypeMapper, CurrentRectorProvider $currentRectorProvider, CurrentNodeProvider $currentNodeProvider, Skipper $skipper, ValueResolver $valueResolver, BetterNodeFinder $betterNodeFinder, NodeComparator $nodeComparator, CurrentFileProvider $currentFileProvider, RectifiedAnalyzer $rectifiedAnalyzer, CreatedByRuleDecorator $createdByRuleDecorator, ChangedNodeScopeRefresher $changedNodeScopeRefresher, RectorOutputStyle $rectorOutputStyle) : void
{
$this->nodesToRemoveCollector = $nodesToRemoveCollector;
$this->nodesToAddCollector = $nodesToAddCollector;
$this->nodeRemover = $nodeRemover;
$this->nodeNameResolver = $nodeNameResolver;
$this->nodeTypeResolver = $nodeTypeResolver;

2
vendor/autoload.php vendored
View File

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

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInitcdd6065f6f3d900461c5946dc02fec48
class ComposerAutoloaderInit27d1d0557c4920dea3fb90548b352290
{
private static $loader;
@ -22,19 +22,19 @@ class ComposerAutoloaderInitcdd6065f6f3d900461c5946dc02fec48
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInitcdd6065f6f3d900461c5946dc02fec48', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit27d1d0557c4920dea3fb90548b352290', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInitcdd6065f6f3d900461c5946dc02fec48', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit27d1d0557c4920dea3fb90548b352290', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInitcdd6065f6f3d900461c5946dc02fec48::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit27d1d0557c4920dea3fb90548b352290::getInitializer($loader));
$loader->setClassMapAuthoritative(true);
$loader->register(true);
$includeFiles = \Composer\Autoload\ComposerStaticInitcdd6065f6f3d900461c5946dc02fec48::$files;
$includeFiles = \Composer\Autoload\ComposerStaticInit27d1d0557c4920dea3fb90548b352290::$files;
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequirecdd6065f6f3d900461c5946dc02fec48($fileIdentifier, $file);
composerRequire27d1d0557c4920dea3fb90548b352290($fileIdentifier, $file);
}
return $loader;
@ -46,7 +46,7 @@ class ComposerAutoloaderInitcdd6065f6f3d900461c5946dc02fec48
* @param string $file
* @return void
*/
function composerRequirecdd6065f6f3d900461c5946dc02fec48($fileIdentifier, $file)
function composerRequire27d1d0557c4920dea3fb90548b352290($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 ComposerStaticInitcdd6065f6f3d900461c5946dc02fec48
class ComposerStaticInit27d1d0557c4920dea3fb90548b352290
{
public static $files = array (
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
@ -3410,9 +3410,9 @@ class ComposerStaticInitcdd6065f6f3d900461c5946dc02fec48
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInitcdd6065f6f3d900461c5946dc02fec48::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitcdd6065f6f3d900461c5946dc02fec48::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitcdd6065f6f3d900461c5946dc02fec48::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInit27d1d0557c4920dea3fb90548b352290::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit27d1d0557c4920dea3fb90548b352290::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit27d1d0557c4920dea3fb90548b352290::$classMap;
}, null, ClassLoader::class);
}

View File

@ -1991,12 +1991,12 @@
"source": {
"type": "git",
"url": "https:\/\/github.com\/rectorphp\/rector-downgrade-php.git",
"reference": "c857264716a90041d463f29970b8d43074c05dc8"
"reference": "ba7d7b8458a01e15b30604bdc962f8477285b088"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-downgrade-php\/zipball\/c857264716a90041d463f29970b8d43074c05dc8",
"reference": "c857264716a90041d463f29970b8d43074c05dc8",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-downgrade-php\/zipball\/ba7d7b8458a01e15b30604bdc962f8477285b088",
"reference": "ba7d7b8458a01e15b30604bdc962f8477285b088",
"shasum": ""
},
"require": {
@ -2020,7 +2020,7 @@
"symplify\/rule-doc-generator": "^11.0",
"symplify\/vendor-patches": "^11.0"
},
"time": "2022-06-29T13:59:59+00:00",
"time": "2022-07-03T21:01:00+00:00",
"default-branch": true,
"type": "rector-extension",
"extra": {
@ -2202,12 +2202,12 @@
"source": {
"type": "git",
"url": "https:\/\/github.com\/rectorphp\/rector-nette.git",
"reference": "003b954a5707bda6100014b33afd3674ea4a744b"
"reference": "3fba0dce341584812463d3be1ab2bc57b48be9fe"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-nette\/zipball\/003b954a5707bda6100014b33afd3674ea4a744b",
"reference": "003b954a5707bda6100014b33afd3674ea4a744b",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-nette\/zipball\/3fba0dce341584812463d3be1ab2bc57b48be9fe",
"reference": "3fba0dce341584812463d3be1ab2bc57b48be9fe",
"shasum": ""
},
"require": {
@ -2239,7 +2239,7 @@
"symplify\/rule-doc-generator": "^11.0",
"symplify\/vendor-patches": "^11.0"
},
"time": "2022-07-03T18:43:51+00:00",
"time": "2022-07-03T20:49:46+00:00",
"default-branch": true,
"type": "rector-extension",
"extra": {
@ -2347,12 +2347,12 @@
"source": {
"type": "git",
"url": "https:\/\/github.com\/rectorphp\/rector-phpunit.git",
"reference": "ca42a8ea43abe8e975382c585ec9adbf293df01f"
"reference": "9bc374804d5b4fa5919f1572524963a3fc9babde"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-phpunit\/zipball\/ca42a8ea43abe8e975382c585ec9adbf293df01f",
"reference": "ca42a8ea43abe8e975382c585ec9adbf293df01f",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-phpunit\/zipball\/9bc374804d5b4fa5919f1572524963a3fc9babde",
"reference": "9bc374804d5b4fa5919f1572524963a3fc9babde",
"shasum": ""
},
"require": {
@ -2377,7 +2377,7 @@
"symplify\/rule-doc-generator": "^11.0",
"symplify\/vendor-patches": "^11.0"
},
"time": "2022-07-03T19:13:24+00:00",
"time": "2022-07-03T20:42:02+00:00",
"default-branch": true,
"type": "rector-extension",
"extra": {

File diff suppressed because one or more lines are too long

View File

@ -9,7 +9,7 @@ namespace Rector\RectorInstaller;
*/
final class GeneratedConfig
{
public const EXTENSIONS = array('rector/rector-cakephp' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-cakephp', 'relative_install_path' => '../../rector-cakephp', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 86ab8c3'), 'rector/rector-doctrine' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-doctrine', 'relative_install_path' => '../../rector-doctrine', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main b177492'), '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' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main c857264'), 'rector/rector-generator' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-generator', 'relative_install_path' => '../../rector-generator', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 644d45b'), 'rector/rector-laravel' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-laravel', 'relative_install_path' => '../../rector-laravel', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main ab8aacc'), 'rector/rector-nette' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-nette', 'relative_install_path' => '../../rector-nette', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 003b954'), 'rector/rector-phpoffice' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpoffice', 'relative_install_path' => '../../rector-phpoffice', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main d826618'), 'rector/rector-phpunit' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpunit', 'relative_install_path' => '../../rector-phpunit', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main ca42a8e'), 'rector/rector-symfony' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-symfony', 'relative_install_path' => '../../rector-symfony', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main d4e61a1'));
public const EXTENSIONS = array('rector/rector-cakephp' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-cakephp', 'relative_install_path' => '../../rector-cakephp', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 86ab8c3'), 'rector/rector-doctrine' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-doctrine', 'relative_install_path' => '../../rector-doctrine', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main b177492'), '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' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main ba7d7b8'), 'rector/rector-generator' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-generator', 'relative_install_path' => '../../rector-generator', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 644d45b'), 'rector/rector-laravel' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-laravel', 'relative_install_path' => '../../rector-laravel', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main ab8aacc'), 'rector/rector-nette' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-nette', 'relative_install_path' => '../../rector-nette', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 3fba0dc'), 'rector/rector-phpoffice' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpoffice', 'relative_install_path' => '../../rector-phpoffice', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main d826618'), 'rector/rector-phpunit' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpunit', 'relative_install_path' => '../../rector-phpunit', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 9bc3748'), 'rector/rector-symfony' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-symfony', 'relative_install_path' => '../../rector-symfony', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main d4e61a1'));
private function __construct()
{
}

View File

@ -17,6 +17,7 @@ use PHPStan\Reflection\Php\PhpPropertyReflection;
use Rector\Core\PhpParser\Node\NamedVariableFactory;
use Rector\Core\Rector\AbstractRector;
use Rector\Core\Reflection\ReflectionResolver;
use Rector\PostRector\Collector\NodesToAddCollector;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
/**
@ -36,10 +37,16 @@ final class DowngradeThisInClosureRector extends AbstractRector
* @var \Rector\Core\Reflection\ReflectionResolver
*/
private $reflectionResolver;
public function __construct(NamedVariableFactory $namedVariableFactory, ReflectionResolver $reflectionResolver)
/**
* @readonly
* @var \Rector\PostRector\Collector\NodesToAddCollector
*/
private $nodesToAddCollector;
public function __construct(NamedVariableFactory $namedVariableFactory, ReflectionResolver $reflectionResolver, NodesToAddCollector $nodesToAddCollector)
{
$this->namedVariableFactory = $namedVariableFactory;
$this->reflectionResolver = $reflectionResolver;
$this->nodesToAddCollector = $nodesToAddCollector;
}
public function getRuleDefinition() : RuleDefinition
{

View File

@ -14,6 +14,7 @@ use PhpParser\Node\Stmt\Expression;
use Rector\Core\PhpParser\Node\NamedVariableFactory;
use Rector\Core\Rector\AbstractRector;
use Rector\NodeTypeResolver\Node\AttributeKey;
use Rector\PostRector\Collector\NodesToAddCollector;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
/**
@ -28,9 +29,15 @@ final class DowngradeInstanceMethodCallRector extends AbstractRector
* @var \Rector\Core\PhpParser\Node\NamedVariableFactory
*/
private $namedVariableFactory;
public function __construct(NamedVariableFactory $namedVariableFactory)
/**
* @readonly
* @var \Rector\PostRector\Collector\NodesToAddCollector
*/
private $nodesToAddCollector;
public function __construct(NamedVariableFactory $namedVariableFactory, NodesToAddCollector $nodesToAddCollector)
{
$this->namedVariableFactory = $namedVariableFactory;
$this->nodesToAddCollector = $nodesToAddCollector;
}
public function getRuleDefinition() : RuleDefinition
{

View File

@ -21,6 +21,7 @@ use PhpParser\Node\Stmt\Return_;
use Rector\Core\Rector\AbstractRector;
use Rector\Naming\Naming\VariableNaming;
use Rector\NodeTypeResolver\Node\AttributeKey;
use Rector\PostRector\Collector\NodesToAddCollector;
use RectorPrefix202207\Symplify\Astral\NodeTraverser\SimpleCallableNodeTraverser;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
@ -41,10 +42,16 @@ final class DowngradeArrayFilterUseConstantRector extends AbstractRector
* @var \Symplify\Astral\NodeTraverser\SimpleCallableNodeTraverser
*/
private $simpleCallableNodeTraverser;
public function __construct(VariableNaming $variableNaming, SimpleCallableNodeTraverser $simpleCallableNodeTraverser)
/**
* @readonly
* @var \Rector\PostRector\Collector\NodesToAddCollector
*/
private $nodesToAddCollector;
public function __construct(VariableNaming $variableNaming, SimpleCallableNodeTraverser $simpleCallableNodeTraverser, NodesToAddCollector $nodesToAddCollector)
{
$this->variableNaming = $variableNaming;
$this->simpleCallableNodeTraverser = $simpleCallableNodeTraverser;
$this->nodesToAddCollector = $nodesToAddCollector;
}
public function getRuleDefinition() : RuleDefinition
{

View File

@ -21,6 +21,7 @@ use PhpParser\Node\Stmt\Return_;
use PhpParser\Node\Stmt\While_;
use Rector\Core\PhpParser\Node\NamedVariableFactory;
use Rector\Core\Rector\AbstractRector;
use Rector\PostRector\Collector\NodesToAddCollector;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
/**
@ -39,9 +40,15 @@ final class DowngradeDirnameLevelsRector extends AbstractRector
* @var \Rector\Core\PhpParser\Node\NamedVariableFactory
*/
private $namedVariableFactory;
public function __construct(NamedVariableFactory $namedVariableFactory)
/**
* @readonly
* @var \Rector\PostRector\Collector\NodesToAddCollector
*/
private $nodesToAddCollector;
public function __construct(NamedVariableFactory $namedVariableFactory, NodesToAddCollector $nodesToAddCollector)
{
$this->namedVariableFactory = $namedVariableFactory;
$this->nodesToAddCollector = $nodesToAddCollector;
}
public function getRuleDefinition() : RuleDefinition
{

View File

@ -12,6 +12,7 @@ use PhpParser\Node\Name;
use PhpParser\Node\Scalar\String_;
use PhpParser\Node\Stmt\Expression;
use Rector\Core\Rector\AbstractRector;
use Rector\PostRector\Collector\NodesToAddCollector;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
/**
@ -19,6 +20,15 @@ use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
*/
final class DowngradeSessionStartArrayOptionsRector extends AbstractRector
{
/**
* @readonly
* @var \Rector\PostRector\Collector\NodesToAddCollector
*/
private $nodesToAddCollector;
public function __construct(NodesToAddCollector $nodesToAddCollector)
{
$this->nodesToAddCollector = $nodesToAddCollector;
}
/**
* @return array<class-string<Node>>
*/

View File

@ -12,6 +12,7 @@ use PhpParser\Node\Stmt\Expression;
use Rector\Core\Rector\AbstractRector;
use Rector\Naming\Naming\VariableNaming;
use Rector\NodeTypeResolver\Node\AttributeKey;
use Rector\PostRector\Collector\NodesToAddCollector;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
/**
@ -26,9 +27,15 @@ final class DowngradeMethodCallOnCloneRector extends AbstractRector
* @var \Rector\Naming\Naming\VariableNaming
*/
private $variableNaming;
public function __construct(VariableNaming $variableNaming)
/**
* @readonly
* @var \Rector\PostRector\Collector\NodesToAddCollector
*/
private $nodesToAddCollector;
public function __construct(VariableNaming $variableNaming, NodesToAddCollector $nodesToAddCollector)
{
$this->variableNaming = $variableNaming;
$this->nodesToAddCollector = $nodesToAddCollector;
}
public function getRuleDefinition() : RuleDefinition
{

View File

@ -20,6 +20,7 @@ use PhpParser\Node\Stmt\Return_;
use Rector\Core\NodeManipulator\IfManipulator;
use Rector\Core\PhpParser\Node\NamedVariableFactory;
use Rector\Core\Rector\AbstractRector;
use Rector\PostRector\Collector\NodesToAddCollector;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
/**
@ -37,10 +38,16 @@ final class DowngradeSpaceshipRector extends AbstractRector
* @var \Rector\Core\PhpParser\Node\NamedVariableFactory
*/
private $namedVariableFactory;
public function __construct(IfManipulator $ifManipulator, NamedVariableFactory $namedVariableFactory)
/**
* @readonly
* @var \Rector\PostRector\Collector\NodesToAddCollector
*/
private $nodesToAddCollector;
public function __construct(IfManipulator $ifManipulator, NamedVariableFactory $namedVariableFactory, NodesToAddCollector $nodesToAddCollector)
{
$this->ifManipulator = $ifManipulator;
$this->namedVariableFactory = $namedVariableFactory;
$this->nodesToAddCollector = $nodesToAddCollector;
}
/**
* @return array<class-string<Node>>

View File

@ -17,6 +17,7 @@ use Rector\Core\Rector\AbstractRector;
use Rector\Naming\ExpectedNameResolver\InflectorSingularResolver;
use Rector\Naming\Naming\VariableNaming;
use Rector\NodeTypeResolver\Node\AttributeKey;
use Rector\PostRector\Collector\NodesToAddCollector;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
/**
@ -34,10 +35,16 @@ final class DowngradeKeysInListRector extends AbstractRector
* @var \Rector\Naming\Naming\VariableNaming
*/
private $variableNaming;
public function __construct(InflectorSingularResolver $inflectorSingularResolver, VariableNaming $variableNaming)
/**
* @readonly
* @var \Rector\PostRector\Collector\NodesToAddCollector
*/
private $nodesToAddCollector;
public function __construct(InflectorSingularResolver $inflectorSingularResolver, VariableNaming $variableNaming, NodesToAddCollector $nodesToAddCollector)
{
$this->inflectorSingularResolver = $inflectorSingularResolver;
$this->variableNaming = $variableNaming;
$this->nodesToAddCollector = $nodesToAddCollector;
}
/**
* @return array<class-string<Node>>

View File

@ -14,6 +14,7 @@ use PhpParser\Node\Stmt\Expression;
use PhpParser\Node\Stmt\Return_;
use Rector\Core\PhpParser\Node\NamedVariableFactory;
use Rector\Core\Rector\AbstractRector;
use Rector\PostRector\Collector\NodesToAddCollector;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
/**
@ -28,9 +29,15 @@ final class DowngradeClosureFromCallableRector extends AbstractRector
* @var \Rector\Core\PhpParser\Node\NamedVariableFactory
*/
private $namedVariableFactory;
public function __construct(NamedVariableFactory $namedVariableFactory)
/**
* @readonly
* @var \Rector\PostRector\Collector\NodesToAddCollector
*/
private $nodesToAddCollector;
public function __construct(NamedVariableFactory $namedVariableFactory, NodesToAddCollector $nodesToAddCollector)
{
$this->namedVariableFactory = $namedVariableFactory;
$this->nodesToAddCollector = $nodesToAddCollector;
}
/**
* @return array<class-string<Node>>

View File

@ -25,6 +25,7 @@ use Rector\Core\Rector\AbstractRector;
use Rector\DowngradePhp72\NodeAnalyzer\RegexFuncAnalyzer;
use Rector\DowngradePhp72\NodeManipulator\BitwiseFlagCleaner;
use Rector\NodeTypeResolver\Node\AttributeKey;
use Rector\PostRector\Collector\NodesToAddCollector;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
/**
@ -52,11 +53,17 @@ final class DowngradePregUnmatchedAsNullConstantRector extends AbstractRector
* @var \Rector\DowngradePhp72\NodeAnalyzer\RegexFuncAnalyzer
*/
private $regexFuncAnalyzer;
public function __construct(IfManipulator $ifManipulator, BitwiseFlagCleaner $bitwiseFlagCleaner, RegexFuncAnalyzer $regexFuncAnalyzer)
/**
* @readonly
* @var \Rector\PostRector\Collector\NodesToAddCollector
*/
private $nodesToAddCollector;
public function __construct(IfManipulator $ifManipulator, BitwiseFlagCleaner $bitwiseFlagCleaner, RegexFuncAnalyzer $regexFuncAnalyzer, NodesToAddCollector $nodesToAddCollector)
{
$this->ifManipulator = $ifManipulator;
$this->bitwiseFlagCleaner = $bitwiseFlagCleaner;
$this->regexFuncAnalyzer = $regexFuncAnalyzer;
$this->nodesToAddCollector = $nodesToAddCollector;
}
/**
* @return array<class-string<Node>>

View File

@ -15,6 +15,7 @@ use Rector\Core\PhpParser\Parser\InlineCodeParser;
use Rector\Core\Rector\AbstractScopeAwareRector;
use Rector\DowngradePhp72\NodeAnalyzer\FunctionExistsFunCallAnalyzer;
use Rector\Naming\Naming\VariableNaming;
use Rector\PostRector\Collector\NodesToAddCollector;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
/**
@ -43,11 +44,17 @@ final class DowngradeStreamIsattyRector extends AbstractScopeAwareRector
* @var \Rector\Naming\Naming\VariableNaming
*/
private $variableNaming;
public function __construct(InlineCodeParser $inlineCodeParser, FunctionExistsFunCallAnalyzer $functionExistsFunCallAnalyzer, VariableNaming $variableNaming)
/**
* @readonly
* @var \Rector\PostRector\Collector\NodesToAddCollector
*/
private $nodesToAddCollector;
public function __construct(InlineCodeParser $inlineCodeParser, FunctionExistsFunCallAnalyzer $functionExistsFunCallAnalyzer, VariableNaming $variableNaming, NodesToAddCollector $nodesToAddCollector)
{
$this->inlineCodeParser = $inlineCodeParser;
$this->functionExistsFunCallAnalyzer = $functionExistsFunCallAnalyzer;
$this->variableNaming = $variableNaming;
$this->nodesToAddCollector = $nodesToAddCollector;
}
public function getRuleDefinition() : RuleDefinition
{

View File

@ -15,6 +15,7 @@ use PhpParser\Node\Stmt\Expression;
use Rector\Core\Rector\AbstractRector;
use Rector\Naming\Naming\VariableNaming;
use Rector\NodeTypeResolver\Node\AttributeKey;
use Rector\PostRector\Collector\NodesToAddCollector;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
/**
@ -29,9 +30,15 @@ final class DowngradeArrayKeyFirstLastRector extends AbstractRector
* @var \Rector\Naming\Naming\VariableNaming
*/
private $variableNaming;
public function __construct(VariableNaming $variableNaming)
/**
* @readonly
* @var \Rector\PostRector\Collector\NodesToAddCollector
*/
private $nodesToAddCollector;
public function __construct(VariableNaming $variableNaming, NodesToAddCollector $nodesToAddCollector)
{
$this->variableNaming = $variableNaming;
$this->nodesToAddCollector = $nodesToAddCollector;
}
public function getRuleDefinition() : RuleDefinition
{

View File

@ -16,6 +16,7 @@ use PhpParser\Node\Scalar\LNumber;
use PhpParser\Node\Scalar\String_;
use Rector\Core\Rector\AbstractRector;
use Rector\NodeTypeResolver\Node\AttributeKey;
use Rector\PostRector\Collector\NodesToAddCollector;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
/**
@ -32,6 +33,15 @@ final class DowngradeListReferenceAssignmentRector extends AbstractRector
* @var int
*/
private const ANY = 1;
/**
* @readonly
* @var \Rector\PostRector\Collector\NodesToAddCollector
*/
private $nodesToAddCollector;
public function __construct(NodesToAddCollector $nodesToAddCollector)
{
$this->nodesToAddCollector = $nodesToAddCollector;
}
public function getRuleDefinition() : RuleDefinition
{
return new RuleDefinition('Convert the list reference assignment to its equivalent PHP 7.2 code', [new CodeSample(<<<'CODE_SAMPLE'

View File

@ -21,6 +21,7 @@ use PhpParser\Node\Scalar\String_;
use Rector\Core\Rector\AbstractRector;
use Rector\Naming\Naming\VariableNaming;
use Rector\NodeTypeResolver\Node\AttributeKey;
use Rector\PostRector\Collector\NodesToAddCollector;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
/**
@ -33,9 +34,15 @@ final class DowngradeStripTagsCallWithArrayRector extends AbstractRector
* @var \Rector\Naming\Naming\VariableNaming
*/
private $variableNaming;
public function __construct(VariableNaming $variableNaming)
/**
* @readonly
* @var \Rector\PostRector\Collector\NodesToAddCollector
*/
private $nodesToAddCollector;
public function __construct(VariableNaming $variableNaming, NodesToAddCollector $nodesToAddCollector)
{
$this->variableNaming = $variableNaming;
$this->nodesToAddCollector = $nodesToAddCollector;
}
public function getRuleDefinition() : RuleDefinition
{

View File

@ -23,6 +23,7 @@ use Rector\Core\Rector\AbstractRector;
use Rector\Naming\Naming\VariableNaming;
use Rector\NodeCollector\BinaryOpConditionsCollector;
use Rector\NodeTypeResolver\Node\AttributeKey;
use Rector\PostRector\Collector\NodesToAddCollector;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
/**
@ -49,11 +50,17 @@ final class DowngradeReflectionClassGetConstantsFilterRector extends AbstractRec
* @var \Rector\NodeCollector\BinaryOpConditionsCollector
*/
private $binaryOpConditionsCollector;
public function __construct(VariableNaming $variableNaming, IfManipulator $ifManipulator, BinaryOpConditionsCollector $binaryOpConditionsCollector)
/**
* @readonly
* @var \Rector\PostRector\Collector\NodesToAddCollector
*/
private $nodesToAddCollector;
public function __construct(VariableNaming $variableNaming, IfManipulator $ifManipulator, BinaryOpConditionsCollector $binaryOpConditionsCollector, NodesToAddCollector $nodesToAddCollector)
{
$this->variableNaming = $variableNaming;
$this->ifManipulator = $ifManipulator;
$this->binaryOpConditionsCollector = $binaryOpConditionsCollector;
$this->nodesToAddCollector = $nodesToAddCollector;
}
/**
* @return array<class-string<Node>>

View File

@ -17,6 +17,7 @@ use PhpParser\Node\Expr\Variable;
use Rector\Core\PhpParser\Node\NamedVariableFactory;
use Rector\Core\Rector\AbstractRector;
use Rector\NodeTypeResolver\Node\AttributeKey;
use Rector\PostRector\Collector\NodesToAddCollector;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
/**
@ -31,9 +32,15 @@ final class DowngradeArbitraryExpressionsSupportRector extends AbstractRector
* @var \Rector\Core\PhpParser\Node\NamedVariableFactory
*/
private $namedVariableFactory;
public function __construct(NamedVariableFactory $namedVariableFactory)
/**
* @readonly
* @var \Rector\PostRector\Collector\NodesToAddCollector
*/
private $nodesToAddCollector;
public function __construct(NamedVariableFactory $namedVariableFactory, NodesToAddCollector $nodesToAddCollector)
{
$this->namedVariableFactory = $namedVariableFactory;
$this->nodesToAddCollector = $nodesToAddCollector;
}
public function getRuleDefinition() : RuleDefinition
{

View File

@ -15,6 +15,7 @@ use Rector\Core\PhpParser\Parser\InlineCodeParser;
use Rector\Core\Rector\AbstractScopeAwareRector;
use Rector\DowngradePhp72\NodeAnalyzer\FunctionExistsFunCallAnalyzer;
use Rector\Naming\Naming\VariableNaming;
use Rector\PostRector\Collector\NodesToAddCollector;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
/**
@ -43,11 +44,17 @@ final class DowngradeArrayIsListRector extends AbstractScopeAwareRector
* @var \Rector\Naming\Naming\VariableNaming
*/
private $variableNaming;
public function __construct(InlineCodeParser $inlineCodeParser, FunctionExistsFunCallAnalyzer $functionExistsFunCallAnalyzer, VariableNaming $variableNaming)
/**
* @readonly
* @var \Rector\PostRector\Collector\NodesToAddCollector
*/
private $nodesToAddCollector;
public function __construct(InlineCodeParser $inlineCodeParser, FunctionExistsFunCallAnalyzer $functionExistsFunCallAnalyzer, VariableNaming $variableNaming, NodesToAddCollector $nodesToAddCollector)
{
$this->inlineCodeParser = $inlineCodeParser;
$this->functionExistsFunCallAnalyzer = $functionExistsFunCallAnalyzer;
$this->variableNaming = $variableNaming;
$this->nodesToAddCollector = $nodesToAddCollector;
}
public function getRuleDefinition() : RuleDefinition
{

View File

@ -15,6 +15,7 @@ use Rector\Core\PhpParser\Parser\InlineCodeParser;
use Rector\Core\Rector\AbstractScopeAwareRector;
use Rector\DowngradePhp72\NodeAnalyzer\FunctionExistsFunCallAnalyzer;
use Rector\Naming\Naming\VariableNaming;
use Rector\PostRector\Collector\NodesToAddCollector;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
/**
@ -44,11 +45,17 @@ final class DowngradeEnumExistsRector extends AbstractScopeAwareRector
* @var \Rector\Naming\Naming\VariableNaming
*/
private $variableNaming;
public function __construct(InlineCodeParser $inlineCodeParser, FunctionExistsFunCallAnalyzer $functionExistsFunCallAnalyzer, VariableNaming $variableNaming)
/**
* @readonly
* @var \Rector\PostRector\Collector\NodesToAddCollector
*/
private $nodesToAddCollector;
public function __construct(InlineCodeParser $inlineCodeParser, FunctionExistsFunCallAnalyzer $functionExistsFunCallAnalyzer, VariableNaming $variableNaming, NodesToAddCollector $nodesToAddCollector)
{
$this->inlineCodeParser = $inlineCodeParser;
$this->functionExistsFunCallAnalyzer = $functionExistsFunCallAnalyzer;
$this->variableNaming = $variableNaming;
$this->nodesToAddCollector = $nodesToAddCollector;
}
public function getRuleDefinition() : RuleDefinition
{

View File

@ -19,7 +19,6 @@ use Rector\Renaming\ValueObject\MethodCallRename;
use Rector\Renaming\ValueObject\RenameStaticMethod;
use Rector\Transform\Rector\Assign\DimFetchAssignToMethodCallRector;
use Rector\Transform\Rector\Assign\PropertyFetchToMethodCallRector;
use Rector\Transform\ValueObject\CallableInMethodCallToVariable;
use Rector\Transform\ValueObject\DimFetchAssignToMethodCall;
use Rector\Transform\ValueObject\PropertyFetchToMethodCall;
use Rector\TypeDeclaration\Rector\ClassMethod\AddParamTypeDeclarationRector;

View File

@ -17,6 +17,7 @@ use PHPStan\Reflection\ClassReflection;
use Rector\Core\Exception\ShouldNotHappenException;
use Rector\Core\Rector\AbstractRector;
use Rector\Core\Reflection\ReflectionResolver;
use Rector\PostRector\Collector\NodesToAddCollector;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
/**
@ -38,9 +39,15 @@ final class TranslateClassMethodToVariadicsRector extends AbstractRector
* @var \Rector\Core\Reflection\ReflectionResolver
*/
private $reflectionResolver;
public function __construct(ReflectionResolver $reflectionResolver)
/**
* @readonly
* @var \Rector\PostRector\Collector\NodesToAddCollector
*/
private $nodesToAddCollector;
public function __construct(ReflectionResolver $reflectionResolver, NodesToAddCollector $nodesToAddCollector)
{
$this->reflectionResolver = $reflectionResolver;
$this->nodesToAddCollector = $nodesToAddCollector;
}
public function getRuleDefinition() : RuleDefinition
{

View File

@ -15,6 +15,7 @@ use PHPStan\Type\ObjectType;
use Rector\Core\Exception\ShouldNotHappenException;
use Rector\Core\Rector\AbstractRector;
use Rector\NodeTypeResolver\Node\AttributeKey;
use Rector\PostRector\Collector\NodesToAddCollector;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
/**
@ -22,6 +23,15 @@ use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
*/
final class AddNextrasDatePickerToDateControlRector extends AbstractRector
{
/**
* @readonly
* @var \Rector\PostRector\Collector\NodesToAddCollector
*/
private $nodesToAddCollector;
public function __construct(NodesToAddCollector $nodesToAddCollector)
{
$this->nodesToAddCollector = $nodesToAddCollector;
}
public function getRuleDefinition() : RuleDefinition
{
return new RuleDefinition('Nextras/Form upgrade of addDatePicker method call to DateControl assign', [new CodeSample(<<<'CODE_SAMPLE'

View File

@ -10,6 +10,7 @@ use PhpParser\Node\Identifier;
use Rector\Core\Rector\AbstractRector;
use Rector\PHPUnit\NodeAnalyzer\TestsNodeAnalyzer;
use Rector\PHPUnit\NodeFactory\AssertCallFactory;
use Rector\PostRector\Collector\NodesToAddCollector;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
/**
@ -31,10 +32,16 @@ final class DelegateExceptionArgumentsRector extends AbstractRector
* @var \Rector\PHPUnit\NodeAnalyzer\TestsNodeAnalyzer
*/
private $testsNodeAnalyzer;
public function __construct(AssertCallFactory $assertCallFactory, TestsNodeAnalyzer $testsNodeAnalyzer)
/**
* @readonly
* @var \Rector\PostRector\Collector\NodesToAddCollector
*/
private $nodesToAddCollector;
public function __construct(AssertCallFactory $assertCallFactory, TestsNodeAnalyzer $testsNodeAnalyzer, NodesToAddCollector $nodesToAddCollector)
{
$this->assertCallFactory = $assertCallFactory;
$this->testsNodeAnalyzer = $testsNodeAnalyzer;
$this->nodesToAddCollector = $nodesToAddCollector;
}
public function getRuleDefinition() : RuleDefinition
{