Updated Rector to commit 84f7ebde040f998fd32bad2eb45cedb5ae9c7a33

84f7ebde04 Add StaticCall support to RemoveMethodCallParamRector (#1916)
This commit is contained in:
Tomas Votruba 2022-03-08 11:38:18 +00:00
parent cdb921dc9f
commit ee3e3a0181
8 changed files with 42 additions and 30 deletions

2
vendor/autoload.php vendored
View File

@ -4,4 +4,4 @@
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInita5b2b34f62d456ceba5c0b0e7a6b0f3e::getLoader();
return ComposerAutoloaderInitc2c60947cd617b24463689e1336687a6::getLoader();

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInita5b2b34f62d456ceba5c0b0e7a6b0f3e
class ComposerAutoloaderInitc2c60947cd617b24463689e1336687a6
{
private static $loader;
@ -22,15 +22,15 @@ class ComposerAutoloaderInita5b2b34f62d456ceba5c0b0e7a6b0f3e
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInita5b2b34f62d456ceba5c0b0e7a6b0f3e', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInitc2c60947cd617b24463689e1336687a6', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
spl_autoload_unregister(array('ComposerAutoloaderInita5b2b34f62d456ceba5c0b0e7a6b0f3e', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInitc2c60947cd617b24463689e1336687a6', 'loadClassLoader'));
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
if ($useStaticLoader) {
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInita5b2b34f62d456ceba5c0b0e7a6b0f3e::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInitc2c60947cd617b24463689e1336687a6::getInitializer($loader));
} else {
$classMap = require __DIR__ . '/autoload_classmap.php';
if ($classMap) {
@ -42,12 +42,12 @@ class ComposerAutoloaderInita5b2b34f62d456ceba5c0b0e7a6b0f3e
$loader->register(true);
if ($useStaticLoader) {
$includeFiles = Composer\Autoload\ComposerStaticInita5b2b34f62d456ceba5c0b0e7a6b0f3e::$files;
$includeFiles = Composer\Autoload\ComposerStaticInitc2c60947cd617b24463689e1336687a6::$files;
} else {
$includeFiles = require __DIR__ . '/autoload_files.php';
}
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequirea5b2b34f62d456ceba5c0b0e7a6b0f3e($fileIdentifier, $file);
composerRequirec2c60947cd617b24463689e1336687a6($fileIdentifier, $file);
}
return $loader;
@ -59,7 +59,7 @@ class ComposerAutoloaderInita5b2b34f62d456ceba5c0b0e7a6b0f3e
* @param string $file
* @return void
*/
function composerRequirea5b2b34f62d456ceba5c0b0e7a6b0f3e($fileIdentifier, $file)
function composerRequirec2c60947cd617b24463689e1336687a6($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 ComposerStaticInita5b2b34f62d456ceba5c0b0e7a6b0f3e
class ComposerStaticInitc2c60947cd617b24463689e1336687a6
{
public static $files = array (
'320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php',
@ -3836,9 +3836,9 @@ class ComposerStaticInita5b2b34f62d456ceba5c0b0e7a6b0f3e
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInita5b2b34f62d456ceba5c0b0e7a6b0f3e::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInita5b2b34f62d456ceba5c0b0e7a6b0f3e::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInita5b2b34f62d456ceba5c0b0e7a6b0f3e::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInitc2c60947cd617b24463689e1336687a6::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitc2c60947cd617b24463689e1336687a6::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitc2c60947cd617b24463689e1336687a6::$classMap;
}, null, ClassLoader::class);
}

View File

@ -2484,12 +2484,12 @@
"source": {
"type": "git",
"url": "https:\/\/github.com\/rectorphp\/rector-nette.git",
"reference": "9f5b55eeec377fa50560f162e3f24aadd0d42435"
"reference": "c0fea715fb38488274f6a203e56c64bc9abb7968"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-nette\/zipball\/9f5b55eeec377fa50560f162e3f24aadd0d42435",
"reference": "9f5b55eeec377fa50560f162e3f24aadd0d42435",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-nette\/zipball\/c0fea715fb38488274f6a203e56c64bc9abb7968",
"reference": "c0fea715fb38488274f6a203e56c64bc9abb7968",
"shasum": ""
},
"require": {
@ -2521,7 +2521,7 @@
"symplify\/rule-doc-generator": "^10.0",
"symplify\/vendor-patches": "^10.0"
},
"time": "2022-03-07T00:04:53+00:00",
"time": "2022-03-08T10:55:16+00:00",
"default-branch": true,
"type": "rector-extension",
"extra": {
@ -2695,12 +2695,12 @@
"source": {
"type": "git",
"url": "https:\/\/github.com\/rectorphp\/rector-symfony.git",
"reference": "6cc95d15525e4b6a086114bb37dc7bc938f8863b"
"reference": "9c5de0f9350d3b96d9f9abd46db56686eedc992e"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-symfony\/zipball\/6cc95d15525e4b6a086114bb37dc7bc938f8863b",
"reference": "6cc95d15525e4b6a086114bb37dc7bc938f8863b",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-symfony\/zipball\/9c5de0f9350d3b96d9f9abd46db56686eedc992e",
"reference": "9c5de0f9350d3b96d9f9abd46db56686eedc992e",
"shasum": ""
},
"require": {
@ -2728,7 +2728,7 @@
"symplify\/rule-doc-generator": "^10.0",
"symplify\/vendor-patches": "^10.0"
},
"time": "2022-03-07T09:59:21+00:00",
"time": "2022-03-08T10:33:37+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 d1fa93d'), '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 96ff8cb'), '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 df58e86'), '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 6bee428'), '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 9f5b55e'), '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 f23c4bf'), '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 5952218'), '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 6cc95d1'), 'ssch/typo3-rector' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/ssch/typo3-rector', 'relative_install_path' => '../../../ssch/typo3-rector', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main b88a7c1'));
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 d1fa93d'), '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 96ff8cb'), '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 df58e86'), '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 6bee428'), '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 c0fea71'), '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 f23c4bf'), '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 5952218'), '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 9c5de0f'), 'ssch/typo3-rector' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/ssch/typo3-rector', 'relative_install_path' => '../../../ssch/typo3-rector', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main b88a7c1'));
private function __construct()
{
}

View File

@ -8,6 +8,7 @@ use PhpParser\Node\Expr\PropertyFetch;
use PhpParser\Node\Stmt\Class_;
use PhpParser\Node\Stmt\Property;
use PHPStan\Type\ObjectType;
use Rector\Core\NodeManipulator\PropertyManipulator;
use Rector\Core\PhpParser\Node\BetterNodeFinder;
use Rector\Core\PhpParser\Node\NodeFactory;
use Rector\Naming\Naming\PropertyNaming;
@ -52,7 +53,12 @@ final class DependencyInjectionMethodCallAnalyzer
* @var \Rector\NodeNameResolver\NodeNameResolver
*/
private $nodeNameResolver;
public function __construct(\Rector\Naming\Naming\PropertyNaming $propertyNaming, \Rector\Symfony\NodeAnalyzer\ServiceTypeMethodCallResolver $serviceTypeMethodCallResolver, \Rector\Core\PhpParser\Node\NodeFactory $nodeFactory, \Rector\PostRector\Collector\PropertyToAddCollector $propertyToAddCollector, \Rector\Core\PhpParser\Node\BetterNodeFinder $betterNodeFinder, \Rector\Php80\NodeAnalyzer\PromotedPropertyResolver $promotedPropertyResolver, \Rector\NodeNameResolver\NodeNameResolver $nodeNameResolver)
/**
* @readonly
* @var \Rector\Core\NodeManipulator\PropertyManipulator
*/
private $propertyManipulator;
public function __construct(\Rector\Naming\Naming\PropertyNaming $propertyNaming, \Rector\Symfony\NodeAnalyzer\ServiceTypeMethodCallResolver $serviceTypeMethodCallResolver, \Rector\Core\PhpParser\Node\NodeFactory $nodeFactory, \Rector\PostRector\Collector\PropertyToAddCollector $propertyToAddCollector, \Rector\Core\PhpParser\Node\BetterNodeFinder $betterNodeFinder, \Rector\Php80\NodeAnalyzer\PromotedPropertyResolver $promotedPropertyResolver, \Rector\NodeNameResolver\NodeNameResolver $nodeNameResolver, \Rector\Core\NodeManipulator\PropertyManipulator $propertyManipulator)
{
$this->propertyNaming = $propertyNaming;
$this->serviceTypeMethodCallResolver = $serviceTypeMethodCallResolver;
@ -61,6 +67,7 @@ final class DependencyInjectionMethodCallAnalyzer
$this->betterNodeFinder = $betterNodeFinder;
$this->promotedPropertyResolver = $promotedPropertyResolver;
$this->nodeNameResolver = $nodeNameResolver;
$this->propertyManipulator = $propertyManipulator;
}
public function replaceMethodCallWithPropertyFetchAndDependency(\PhpParser\Node\Expr\MethodCall $methodCall) : ?\PhpParser\Node\Expr\PropertyFetch
{
@ -72,8 +79,13 @@ final class DependencyInjectionMethodCallAnalyzer
if (!$class instanceof \PhpParser\Node\Stmt\Class_) {
return null;
}
$propertyName = $this->propertyNaming->fqnToVariableName($serviceType);
$propertyName = $this->resolveNewPropertyNameWhenExists($class, $propertyName, $propertyName);
$resolvedPropertyNameByType = $this->propertyManipulator->resolveExistingClassPropertyNameByType($class, $serviceType);
if (\is_string($resolvedPropertyNameByType)) {
$propertyName = $resolvedPropertyNameByType;
} else {
$propertyName = $this->propertyNaming->fqnToVariableName($serviceType);
$propertyName = $this->resolveNewPropertyNameWhenExists($class, $propertyName, $propertyName);
}
$propertyMetadata = new \Rector\PostRector\ValueObject\PropertyMetadata($propertyName, $serviceType, \PhpParser\Node\Stmt\Class_::MODIFIER_PRIVATE);
$this->propertyToAddCollector->addPropertyToClass($class, $propertyMetadata);
return $this->nodeFactory->createPropertyFetch('this', $propertyName);

View File

@ -9,8 +9,8 @@ $loader = require_once __DIR__.'/autoload.php';
if (!class_exists('AutoloadIncluder', false) && !interface_exists('AutoloadIncluder', false) && !trait_exists('AutoloadIncluder', false)) {
spl_autoload_call('RectorPrefix20220308\AutoloadIncluder');
}
if (!class_exists('ComposerAutoloaderInita5b2b34f62d456ceba5c0b0e7a6b0f3e', false) && !interface_exists('ComposerAutoloaderInita5b2b34f62d456ceba5c0b0e7a6b0f3e', false) && !trait_exists('ComposerAutoloaderInita5b2b34f62d456ceba5c0b0e7a6b0f3e', false)) {
spl_autoload_call('RectorPrefix20220308\ComposerAutoloaderInita5b2b34f62d456ceba5c0b0e7a6b0f3e');
if (!class_exists('ComposerAutoloaderInitc2c60947cd617b24463689e1336687a6', false) && !interface_exists('ComposerAutoloaderInitc2c60947cd617b24463689e1336687a6', false) && !trait_exists('ComposerAutoloaderInitc2c60947cd617b24463689e1336687a6', false)) {
spl_autoload_call('RectorPrefix20220308\ComposerAutoloaderInitc2c60947cd617b24463689e1336687a6');
}
if (!class_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false) && !interface_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false) && !trait_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false)) {
spl_autoload_call('RectorPrefix20220308\Helmich\TypoScriptParser\Parser\AST\Statement');
@ -59,9 +59,9 @@ if (!function_exists('print_node')) {
return \RectorPrefix20220308\print_node(...func_get_args());
}
}
if (!function_exists('composerRequirea5b2b34f62d456ceba5c0b0e7a6b0f3e')) {
function composerRequirea5b2b34f62d456ceba5c0b0e7a6b0f3e() {
return \RectorPrefix20220308\composerRequirea5b2b34f62d456ceba5c0b0e7a6b0f3e(...func_get_args());
if (!function_exists('composerRequirec2c60947cd617b24463689e1336687a6')) {
function composerRequirec2c60947cd617b24463689e1336687a6() {
return \RectorPrefix20220308\composerRequirec2c60947cd617b24463689e1336687a6(...func_get_args());
}
}
if (!function_exists('scanPath')) {