Skip to content

Commit 348f392

Browse files
committed
Rector 0.12.11
1 parent 8e36a87 commit 348f392

File tree

9 files changed

+45
-29
lines changed

9 files changed

+45
-29
lines changed

vendor/autoload.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44

55
require_once __DIR__ . '/composer/autoload_real.php';
66

7-
return ComposerAutoloaderInitd2c47e9b1c523de03caede4ae2ea2722::getLoader();
7+
return ComposerAutoloaderInitd57d3b62cac2a6917f38b59e005d7804::getLoader();

vendor/composer/autoload_real.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
// autoload_real.php @generated by Composer
44

5-
class ComposerAutoloaderInitd2c47e9b1c523de03caede4ae2ea2722
5+
class ComposerAutoloaderInitd57d3b62cac2a6917f38b59e005d7804
66
{
77
private static $loader;
88

@@ -22,15 +22,15 @@ public static function getLoader()
2222
return self::$loader;
2323
}
2424

25-
spl_autoload_register(array('ComposerAutoloaderInitd2c47e9b1c523de03caede4ae2ea2722', 'loadClassLoader'), true, true);
25+
spl_autoload_register(array('ComposerAutoloaderInitd57d3b62cac2a6917f38b59e005d7804', 'loadClassLoader'), true, true);
2626
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
27-
spl_autoload_unregister(array('ComposerAutoloaderInitd2c47e9b1c523de03caede4ae2ea2722', 'loadClassLoader'));
27+
spl_autoload_unregister(array('ComposerAutoloaderInitd57d3b62cac2a6917f38b59e005d7804', 'loadClassLoader'));
2828

2929
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
3030
if ($useStaticLoader) {
3131
require __DIR__ . '/autoload_static.php';
3232

33-
call_user_func(\Composer\Autoload\ComposerStaticInitd2c47e9b1c523de03caede4ae2ea2722::getInitializer($loader));
33+
call_user_func(\Composer\Autoload\ComposerStaticInitd57d3b62cac2a6917f38b59e005d7804::getInitializer($loader));
3434
} else {
3535
$classMap = require __DIR__ . '/autoload_classmap.php';
3636
if ($classMap) {
@@ -42,12 +42,12 @@ public static function getLoader()
4242
$loader->register(true);
4343

4444
if ($useStaticLoader) {
45-
$includeFiles = Composer\Autoload\ComposerStaticInitd2c47e9b1c523de03caede4ae2ea2722::$files;
45+
$includeFiles = Composer\Autoload\ComposerStaticInitd57d3b62cac2a6917f38b59e005d7804::$files;
4646
} else {
4747
$includeFiles = require __DIR__ . '/autoload_files.php';
4848
}
4949
foreach ($includeFiles as $fileIdentifier => $file) {
50-
composerRequired2c47e9b1c523de03caede4ae2ea2722($fileIdentifier, $file);
50+
composerRequired57d3b62cac2a6917f38b59e005d7804($fileIdentifier, $file);
5151
}
5252

5353
return $loader;
@@ -59,7 +59,7 @@ public static function getLoader()
5959
* @param string $file
6060
* @return void
6161
*/
62-
function composerRequired2c47e9b1c523de03caede4ae2ea2722($fileIdentifier, $file)
62+
function composerRequired57d3b62cac2a6917f38b59e005d7804($fileIdentifier, $file)
6363
{
6464
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
6565
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;

vendor/composer/autoload_static.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace Composer\Autoload;
66

7-
class ComposerStaticInitd2c47e9b1c523de03caede4ae2ea2722
7+
class ComposerStaticInitd57d3b62cac2a6917f38b59e005d7804
88
{
99
public static $files = array (
1010
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
@@ -3851,9 +3851,9 @@ class ComposerStaticInitd2c47e9b1c523de03caede4ae2ea2722
38513851
public static function getInitializer(ClassLoader $loader)
38523852
{
38533853
return \Closure::bind(function () use ($loader) {
3854-
$loader->prefixLengthsPsr4 = ComposerStaticInitd2c47e9b1c523de03caede4ae2ea2722::$prefixLengthsPsr4;
3855-
$loader->prefixDirsPsr4 = ComposerStaticInitd2c47e9b1c523de03caede4ae2ea2722::$prefixDirsPsr4;
3856-
$loader->classMap = ComposerStaticInitd2c47e9b1c523de03caede4ae2ea2722::$classMap;
3854+
$loader->prefixLengthsPsr4 = ComposerStaticInitd57d3b62cac2a6917f38b59e005d7804::$prefixLengthsPsr4;
3855+
$loader->prefixDirsPsr4 = ComposerStaticInitd57d3b62cac2a6917f38b59e005d7804::$prefixDirsPsr4;
3856+
$loader->classMap = ComposerStaticInitd57d3b62cac2a6917f38b59e005d7804::$classMap;
38573857

38583858
}, null, ClassLoader::class);
38593859
}

vendor/composer/installed.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2590,12 +2590,12 @@
25902590
"source": {
25912591
"type": "git",
25922592
"url": "https:\/\/github.com\/rectorphp\/rector-symfony.git",
2593-
"reference": "91fd3f3882171c6f0c7e60c44e689e8d7d8ad0a4"
2593+
"reference": "b0933bccdb38883e82152dc785a9ba208d1dd922"
25942594
},
25952595
"dist": {
25962596
"type": "zip",
2597-
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-symfony\/zipball\/91fd3f3882171c6f0c7e60c44e689e8d7d8ad0a4",
2598-
"reference": "91fd3f3882171c6f0c7e60c44e689e8d7d8ad0a4",
2597+
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-symfony\/zipball\/b0933bccdb38883e82152dc785a9ba208d1dd922",
2598+
"reference": "b0933bccdb38883e82152dc785a9ba208d1dd922",
25992599
"shasum": ""
26002600
},
26012601
"require": {
@@ -2623,7 +2623,7 @@
26232623
"symplify\/rule-doc-generator": "^10.0",
26242624
"symplify\/vendor-patches": "^10.0"
26252625
},
2626-
"time": "2022-01-04T15:19:59+00:00",
2626+
"time": "2022-01-05T18:19:57+00:00",
26272627
"default-branch": true,
26282628
"type": "rector-extension",
26292629
"extra": {

vendor/composer/installed.php

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

vendor/rector/extension-installer/src/GeneratedConfig.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*/
1010
final class GeneratedConfig
1111
{
12-
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 f601f07'), '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 d65a9b0'), '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 36d651e'), '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 96d50d4'), '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 eb859a5'), '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 3f56f3b'), '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 cd2eb3d'), '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 91fd3f3'), '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 0233a19'));
12+
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 f601f07'), '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 d65a9b0'), '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 36d651e'), '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 96d50d4'), '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 eb859a5'), '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 3f56f3b'), '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 cd2eb3d'), '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 b0933bc'), '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 0233a19'));
1313
private function __construct()
1414
{
1515
}

vendor/rector/rector-symfony/rector.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
\Rector\DeadCode\Rector\If_\RemoveDeadInstanceOfRector::class,
2020
'*/Fixture/*',
2121
'*/Source/*',
22+
'*/Source*/*',
2223
]);
2324
$services = $containerConfigurator->services();
2425
$services->set(\Rector\Php55\Rector\String_\StringClassNameToClassConstantRector::class)->configure(['Symfony\\*', 'Twig_*', 'Swift_*']);

vendor/rector/rector-symfony/src/Rector/Class_/MakeCommandLazyRector.php

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@
55

66
use PhpParser\Node;
77
use PhpParser\Node\Expr;
8+
use PhpParser\Node\Expr\ClassConstFetch;
9+
use PhpParser\Node\Expr\ConstFetch;
810
use PhpParser\Node\Expr\MethodCall;
911
use PhpParser\Node\Expr\StaticCall;
1012
use PhpParser\Node\Param;
13+
use PhpParser\Node\Scalar\String_;
1114
use PhpParser\Node\Stmt\Class_;
1215
use PhpParser\Node\Stmt\ClassMethod;
1316
use PhpParser\Node\Stmt\Expression;
@@ -40,7 +43,7 @@ public function getRuleDefinition() : \Symplify\RuleDocGenerator\ValueObject\Rul
4043
return new \Symplify\RuleDocGenerator\ValueObject\RuleDefinition('Make Symfony commands lazy', [new \Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample(<<<'CODE_SAMPLE'
4144
use Symfony\Component\Console\Command\Command
4245
43-
class SunshineCommand extends Command
46+
final class SunshineCommand extends Command
4447
{
4548
public function configure()
4649
{
@@ -51,7 +54,7 @@ public function configure()
5154
, <<<'CODE_SAMPLE'
5255
use Symfony\Component\Console\Command\Command
5356
54-
class SunshineCommand extends Command
57+
final class SunshineCommand extends Command
5558
{
5659
protected static $defaultName = 'sunshine';
5760
public function configure()
@@ -76,21 +79,28 @@ public function refactor(\PhpParser\Node $node) : ?\PhpParser\Node
7679
if (!$this->isObjectType($node, new \PHPStan\Type\ObjectType('Symfony\\Component\\Console\\Command\\Command'))) {
7780
return null;
7881
}
79-
$commandName = $this->resolveCommandNameAndRemove($node);
82+
$defaultNameProperty = $node->getProperty('defaultName');
83+
if ($defaultNameProperty instanceof \PhpParser\Node\Stmt\Property) {
84+
return null;
85+
}
86+
$commandName = $this->resolveCommandName($node);
8087
if (!$commandName instanceof \PhpParser\Node) {
8188
return null;
8289
}
90+
if (!$commandName instanceof \PhpParser\Node\Scalar\String_ && !$commandName instanceof \PhpParser\Node\Expr\ClassConstFetch) {
91+
return null;
92+
}
93+
$this->removeConstructorIfHasOnlySetNameMethodCall($node);
8394
$defaultNameProperty = $this->createStaticProtectedPropertyWithDefault('defaultName', $commandName);
8495
$node->stmts = \array_merge([$defaultNameProperty], $node->stmts);
8596
return $node;
8697
}
87-
private function resolveCommandNameAndRemove(\PhpParser\Node\Stmt\Class_ $class) : ?\PhpParser\Node
98+
private function resolveCommandName(\PhpParser\Node\Stmt\Class_ $class) : ?\PhpParser\Node
8899
{
89100
$commandName = $this->resolveCommandNameFromConstructor($class);
90101
if (!$commandName instanceof \PhpParser\Node) {
91-
$commandName = $this->resolveCommandNameFromSetName($class);
102+
return $this->resolveCommandNameFromSetName($class);
92103
}
93-
$this->removeConstructorIfHasOnlySetNameMethodCall($class);
94104
return $commandName;
95105
}
96106
private function resolveCommandNameFromConstructor(\PhpParser\Node\Stmt\Class_ $class) : ?\PhpParser\Node
@@ -107,6 +117,11 @@ private function resolveCommandNameFromConstructor(\PhpParser\Node\Stmt\Class_ $
107117
if (!$commandName instanceof \PhpParser\Node\Expr) {
108118
return null;
109119
}
120+
// only valid static property values for name
121+
if (!$commandName instanceof \PhpParser\Node\Scalar\String_ && !$commandName instanceof \PhpParser\Node\Expr\ConstFetch) {
122+
return null;
123+
}
124+
// remove if parent name is not string
110125
\array_shift($node->args);
111126
});
112127
return $commandName;

vendor/scoper-autoload.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
if (!class_exists('AutoloadIncluder', false) && !interface_exists('AutoloadIncluder', false) && !trait_exists('AutoloadIncluder', false)) {
1010
spl_autoload_call('RectorPrefix20220105\AutoloadIncluder');
1111
}
12-
if (!class_exists('ComposerAutoloaderInitd2c47e9b1c523de03caede4ae2ea2722', false) && !interface_exists('ComposerAutoloaderInitd2c47e9b1c523de03caede4ae2ea2722', false) && !trait_exists('ComposerAutoloaderInitd2c47e9b1c523de03caede4ae2ea2722', false)) {
13-
spl_autoload_call('RectorPrefix20220105\ComposerAutoloaderInitd2c47e9b1c523de03caede4ae2ea2722');
12+
if (!class_exists('ComposerAutoloaderInitd57d3b62cac2a6917f38b59e005d7804', false) && !interface_exists('ComposerAutoloaderInitd57d3b62cac2a6917f38b59e005d7804', false) && !trait_exists('ComposerAutoloaderInitd57d3b62cac2a6917f38b59e005d7804', false)) {
13+
spl_autoload_call('RectorPrefix20220105\ComposerAutoloaderInitd57d3b62cac2a6917f38b59e005d7804');
1414
}
1515
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)) {
1616
spl_autoload_call('RectorPrefix20220105\Helmich\TypoScriptParser\Parser\AST\Statement');
@@ -71,9 +71,9 @@ function print_node() {
7171
return \RectorPrefix20220105\print_node(...func_get_args());
7272
}
7373
}
74-
if (!function_exists('composerRequired2c47e9b1c523de03caede4ae2ea2722')) {
75-
function composerRequired2c47e9b1c523de03caede4ae2ea2722() {
76-
return \RectorPrefix20220105\composerRequired2c47e9b1c523de03caede4ae2ea2722(...func_get_args());
74+
if (!function_exists('composerRequired57d3b62cac2a6917f38b59e005d7804')) {
75+
function composerRequired57d3b62cac2a6917f38b59e005d7804() {
76+
return \RectorPrefix20220105\composerRequired57d3b62cac2a6917f38b59e005d7804(...func_get_args());
7777
}
7878
}
7979
if (!function_exists('scanPath')) {

0 commit comments

Comments
 (0)