mirror of
https://github.com/rectorphp/rector.git
synced 2025-02-23 19:24:48 +01:00
Updated Rector to commit 27b891b219cc9bfed6540a6abfbfa762e1cc2aaf
27b891b219
Make ServiceGetterToConstructorInjectionRector report only if node has changed, retarget to Class_ node with higher priority (#2772)
This commit is contained in:
parent
050ff0c044
commit
616efdc680
2
vendor/autoload.php
vendored
2
vendor/autoload.php
vendored
@ -9,4 +9,4 @@ if (PHP_VERSION_ID < 50600) {
|
||||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInitb0226f9b6c3d5c00015fe6143e127539::getLoader();
|
||||
return ComposerAutoloaderInit07a353cd3656c99e464230759f47fb9c::getLoader();
|
||||
|
14
vendor/composer/autoload_real.php
vendored
14
vendor/composer/autoload_real.php
vendored
@ -2,7 +2,7 @@
|
||||
|
||||
// autoload_real.php @generated by Composer
|
||||
|
||||
class ComposerAutoloaderInitb0226f9b6c3d5c00015fe6143e127539
|
||||
class ComposerAutoloaderInit07a353cd3656c99e464230759f47fb9c
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
@ -22,19 +22,19 @@ class ComposerAutoloaderInitb0226f9b6c3d5c00015fe6143e127539
|
||||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInitb0226f9b6c3d5c00015fe6143e127539', 'loadClassLoader'), true, true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInit07a353cd3656c99e464230759f47fb9c', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInitb0226f9b6c3d5c00015fe6143e127539', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit07a353cd3656c99e464230759f47fb9c', 'loadClassLoader'));
|
||||
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInitb0226f9b6c3d5c00015fe6143e127539::getInitializer($loader));
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit07a353cd3656c99e464230759f47fb9c::getInitializer($loader));
|
||||
|
||||
$loader->setClassMapAuthoritative(true);
|
||||
$loader->register(true);
|
||||
|
||||
$includeFiles = \Composer\Autoload\ComposerStaticInitb0226f9b6c3d5c00015fe6143e127539::$files;
|
||||
$includeFiles = \Composer\Autoload\ComposerStaticInit07a353cd3656c99e464230759f47fb9c::$files;
|
||||
foreach ($includeFiles as $fileIdentifier => $file) {
|
||||
composerRequireb0226f9b6c3d5c00015fe6143e127539($fileIdentifier, $file);
|
||||
composerRequire07a353cd3656c99e464230759f47fb9c($fileIdentifier, $file);
|
||||
}
|
||||
|
||||
return $loader;
|
||||
@ -46,7 +46,7 @@ class ComposerAutoloaderInitb0226f9b6c3d5c00015fe6143e127539
|
||||
* @param string $file
|
||||
* @return void
|
||||
*/
|
||||
function composerRequireb0226f9b6c3d5c00015fe6143e127539($fileIdentifier, $file)
|
||||
function composerRequire07a353cd3656c99e464230759f47fb9c($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 ComposerStaticInitb0226f9b6c3d5c00015fe6143e127539
|
||||
class ComposerStaticInit07a353cd3656c99e464230759f47fb9c
|
||||
{
|
||||
public static $files = array (
|
||||
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
|
||||
@ -3250,9 +3250,9 @@ class ComposerStaticInitb0226f9b6c3d5c00015fe6143e127539
|
||||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInitb0226f9b6c3d5c00015fe6143e127539::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInitb0226f9b6c3d5c00015fe6143e127539::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInitb0226f9b6c3d5c00015fe6143e127539::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit07a353cd3656c99e464230759f47fb9c::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit07a353cd3656c99e464230759f47fb9c::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit07a353cd3656c99e464230759f47fb9c::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
8
vendor/composer/installed.json
vendored
8
vendor/composer/installed.json
vendored
@ -2267,12 +2267,12 @@
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/rectorphp\/rector-symfony.git",
|
||||
"reference": "87b368b3928a3748527d6cc6acecc1902a43d875"
|
||||
"reference": "d72eecf1510871773a0564b2aff00119b401d8cc"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-symfony\/zipball\/87b368b3928a3748527d6cc6acecc1902a43d875",
|
||||
"reference": "87b368b3928a3748527d6cc6acecc1902a43d875",
|
||||
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-symfony\/zipball\/d72eecf1510871773a0564b2aff00119b401d8cc",
|
||||
"reference": "d72eecf1510871773a0564b2aff00119b401d8cc",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -2301,7 +2301,7 @@
|
||||
"symplify\/rule-doc-generator": "^11.0",
|
||||
"symplify\/vendor-patches": "^11.0"
|
||||
},
|
||||
"time": "2022-08-12T21:58:01+00:00",
|
||||
"time": "2022-08-17T13:32:59+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-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 c2ec06c'), '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 49ba991'), '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 efc7ddf'), '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 38440b9'), '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 20edb95'), '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 3638a66'), '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 528d313'), '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 87b368b'));
|
||||
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 c2ec06c'), '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 49ba991'), '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 efc7ddf'), '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 38440b9'), '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 20edb95'), '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 3638a66'), '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 528d313'), '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 d72eecf'));
|
||||
private function __construct()
|
||||
{
|
||||
}
|
||||
|
@ -6,13 +6,13 @@ namespace Rector\Symfony\Rector\ClassMethod;
|
||||
use RectorPrefix202208\Nette\Utils\Strings;
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr;
|
||||
use PhpParser\Node\Stmt\Class_;
|
||||
use PhpParser\Node\Stmt\ClassLike;
|
||||
use PhpParser\Node\Stmt\ClassMethod;
|
||||
use PhpParser\Node\Stmt\Return_;
|
||||
use PHPStan\Type\ObjectType;
|
||||
use PHPStan\Analyser\Scope;
|
||||
use PHPStan\Reflection\ClassReflection;
|
||||
use Rector\Core\Exception\ShouldNotHappenException;
|
||||
use Rector\Core\Rector\AbstractRector;
|
||||
use Rector\Core\Rector\AbstractScopeAwareRector;
|
||||
use RectorPrefix202208\Symfony\Component\String\UnicodeString;
|
||||
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
|
||||
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
|
||||
@ -21,7 +21,7 @@ use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
|
||||
*
|
||||
* @see \Rector\Symfony\Tests\Rector\ClassMethod\RemoveDefaultGetBlockPrefixRector\RemoveDefaultGetBlockPrefixRectorTest
|
||||
*/
|
||||
final class RemoveDefaultGetBlockPrefixRector extends AbstractRector
|
||||
final class RemoveDefaultGetBlockPrefixRector extends AbstractScopeAwareRector
|
||||
{
|
||||
public function getRuleDefinition() : RuleDefinition
|
||||
{
|
||||
@ -55,9 +55,9 @@ CODE_SAMPLE
|
||||
/**
|
||||
* @param ClassMethod $node
|
||||
*/
|
||||
public function refactor(Node $node) : ?Node
|
||||
public function refactorWithScope(Node $node, Scope $scope) : ?Node
|
||||
{
|
||||
if (!$this->isObjectMethodNameMatch($node)) {
|
||||
if (!$this->isObjectMethodNameMatch($node, $scope)) {
|
||||
return null;
|
||||
}
|
||||
$returnedExpr = $this->resolveOnlyStmtReturnExpr($node);
|
||||
@ -85,16 +85,21 @@ CODE_SAMPLE
|
||||
$this->removeNode($node);
|
||||
return null;
|
||||
}
|
||||
private function isObjectMethodNameMatch(ClassMethod $classMethod) : bool
|
||||
private function isObjectMethodNameMatch(ClassMethod $classMethod, Scope $scope) : bool
|
||||
{
|
||||
$class = $this->betterNodeFinder->findParentType($classMethod, Class_::class);
|
||||
if (!$class instanceof Class_) {
|
||||
$classReflection = $scope->getClassReflection();
|
||||
if (!$classReflection instanceof ClassReflection) {
|
||||
return \false;
|
||||
}
|
||||
if (!$this->isObjectType($classMethod, new ObjectType('Symfony\\Component\\Form\\AbstractType'))) {
|
||||
// refactoring only direct inheritors, so allow override of custom children
|
||||
$parentClassReflection = $classReflection->getParentClass();
|
||||
if (!$parentClassReflection instanceof ClassReflection) {
|
||||
return \false;
|
||||
}
|
||||
return $this->isName($classMethod->name, 'getBlockPrefix');
|
||||
if ($parentClassReflection->getName() !== 'Symfony\\Component\\Form\\AbstractType') {
|
||||
return \false;
|
||||
}
|
||||
return $classMethod->name->toString() === 'getBlockPrefix';
|
||||
}
|
||||
/**
|
||||
* return <$thisValue>;
|
||||
|
Loading…
x
Reference in New Issue
Block a user