Skip to content

Commit

Permalink
Rector 0.12.11
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Jan 5, 2022
1 parent 8e36a87 commit 348f392
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 29 deletions.
2 changes: 1 addition & 1 deletion vendor/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

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

return ComposerAutoloaderInitd2c47e9b1c523de03caede4ae2ea2722::getLoader();
return ComposerAutoloaderInitd57d3b62cac2a6917f38b59e005d7804::getLoader();
14 changes: 7 additions & 7 deletions vendor/composer/autoload_real.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// autoload_real.php @generated by Composer

class ComposerAutoloaderInitd2c47e9b1c523de03caede4ae2ea2722
class ComposerAutoloaderInitd57d3b62cac2a6917f38b59e005d7804
{
private static $loader;

Expand All @@ -22,15 +22,15 @@ public static function getLoader()
return self::$loader;
}

spl_autoload_register(array('ComposerAutoloaderInitd2c47e9b1c523de03caede4ae2ea2722', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInitd57d3b62cac2a6917f38b59e005d7804', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
spl_autoload_unregister(array('ComposerAutoloaderInitd2c47e9b1c523de03caede4ae2ea2722', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInitd57d3b62cac2a6917f38b59e005d7804', '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\ComposerStaticInitd2c47e9b1c523de03caede4ae2ea2722::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInitd57d3b62cac2a6917f38b59e005d7804::getInitializer($loader));
} else {
$classMap = require __DIR__ . '/autoload_classmap.php';
if ($classMap) {
Expand All @@ -42,12 +42,12 @@ public static function getLoader()
$loader->register(true);

if ($useStaticLoader) {
$includeFiles = Composer\Autoload\ComposerStaticInitd2c47e9b1c523de03caede4ae2ea2722::$files;
$includeFiles = Composer\Autoload\ComposerStaticInitd57d3b62cac2a6917f38b59e005d7804::$files;
} else {
$includeFiles = require __DIR__ . '/autoload_files.php';
}
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequired2c47e9b1c523de03caede4ae2ea2722($fileIdentifier, $file);
composerRequired57d3b62cac2a6917f38b59e005d7804($fileIdentifier, $file);
}

return $loader;
Expand All @@ -59,7 +59,7 @@ public static function getLoader()
* @param string $file
* @return void
*/
function composerRequired2c47e9b1c523de03caede4ae2ea2722($fileIdentifier, $file)
function composerRequired57d3b62cac2a6917f38b59e005d7804($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
Expand Down
8 changes: 4 additions & 4 deletions vendor/composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Composer\Autoload;

class ComposerStaticInitd2c47e9b1c523de03caede4ae2ea2722
class ComposerStaticInitd57d3b62cac2a6917f38b59e005d7804
{
public static $files = array (
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
Expand Down Expand Up @@ -3851,9 +3851,9 @@ class ComposerStaticInitd2c47e9b1c523de03caede4ae2ea2722
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInitd2c47e9b1c523de03caede4ae2ea2722::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitd2c47e9b1c523de03caede4ae2ea2722::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitd2c47e9b1c523de03caede4ae2ea2722::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInitd57d3b62cac2a6917f38b59e005d7804::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitd57d3b62cac2a6917f38b59e005d7804::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitd57d3b62cac2a6917f38b59e005d7804::$classMap;

}, null, ClassLoader::class);
}
Expand Down
8 changes: 4 additions & 4 deletions vendor/composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -2590,12 +2590,12 @@
"source": {
"type": "git",
"url": "https:\/\/github.com\/rectorphp\/rector-symfony.git",
"reference": "91fd3f3882171c6f0c7e60c44e689e8d7d8ad0a4"
"reference": "b0933bccdb38883e82152dc785a9ba208d1dd922"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-symfony\/zipball\/91fd3f3882171c6f0c7e60c44e689e8d7d8ad0a4",
"reference": "91fd3f3882171c6f0c7e60c44e689e8d7d8ad0a4",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-symfony\/zipball\/b0933bccdb38883e82152dc785a9ba208d1dd922",
"reference": "b0933bccdb38883e82152dc785a9ba208d1dd922",
"shasum": ""
},
"require": {
Expand Down Expand Up @@ -2623,7 +2623,7 @@
"symplify\/rule-doc-generator": "^10.0",
"symplify\/vendor-patches": "^10.0"
},
"time": "2022-01-04T15:19:59+00:00",
"time": "2022-01-05T18:19:57+00:00",
"default-branch": true,
"type": "rector-extension",
"extra": {
Expand Down
2 changes: 1 addition & 1 deletion vendor/composer/installed.php

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion vendor/rector/extension-installer/src/GeneratedConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/
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 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'));
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'));
private function __construct()
{
}
Expand Down
1 change: 1 addition & 0 deletions vendor/rector/rector-symfony/rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
\Rector\DeadCode\Rector\If_\RemoveDeadInstanceOfRector::class,
'*/Fixture/*',
'*/Source/*',
'*/Source*/*',
]);
$services = $containerConfigurator->services();
$services->set(\Rector\Php55\Rector\String_\StringClassNameToClassConstantRector::class)->configure(['Symfony\\*', 'Twig_*', 'Swift_*']);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@

use PhpParser\Node;
use PhpParser\Node\Expr;
use PhpParser\Node\Expr\ClassConstFetch;
use PhpParser\Node\Expr\ConstFetch;
use PhpParser\Node\Expr\MethodCall;
use PhpParser\Node\Expr\StaticCall;
use PhpParser\Node\Param;
use PhpParser\Node\Scalar\String_;
use PhpParser\Node\Stmt\Class_;
use PhpParser\Node\Stmt\ClassMethod;
use PhpParser\Node\Stmt\Expression;
Expand Down Expand Up @@ -40,7 +43,7 @@ public function getRuleDefinition() : \Symplify\RuleDocGenerator\ValueObject\Rul
return new \Symplify\RuleDocGenerator\ValueObject\RuleDefinition('Make Symfony commands lazy', [new \Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample(<<<'CODE_SAMPLE'
use Symfony\Component\Console\Command\Command
class SunshineCommand extends Command
final class SunshineCommand extends Command
{
public function configure()
{
Expand All @@ -51,7 +54,7 @@ public function configure()
, <<<'CODE_SAMPLE'
use Symfony\Component\Console\Command\Command
class SunshineCommand extends Command
final class SunshineCommand extends Command
{
protected static $defaultName = 'sunshine';
public function configure()
Expand All @@ -76,21 +79,28 @@ public function refactor(\PhpParser\Node $node) : ?\PhpParser\Node
if (!$this->isObjectType($node, new \PHPStan\Type\ObjectType('Symfony\\Component\\Console\\Command\\Command'))) {
return null;
}
$commandName = $this->resolveCommandNameAndRemove($node);
$defaultNameProperty = $node->getProperty('defaultName');
if ($defaultNameProperty instanceof \PhpParser\Node\Stmt\Property) {
return null;
}
$commandName = $this->resolveCommandName($node);
if (!$commandName instanceof \PhpParser\Node) {
return null;
}
if (!$commandName instanceof \PhpParser\Node\Scalar\String_ && !$commandName instanceof \PhpParser\Node\Expr\ClassConstFetch) {
return null;
}
$this->removeConstructorIfHasOnlySetNameMethodCall($node);
$defaultNameProperty = $this->createStaticProtectedPropertyWithDefault('defaultName', $commandName);
$node->stmts = \array_merge([$defaultNameProperty], $node->stmts);
return $node;
}
private function resolveCommandNameAndRemove(\PhpParser\Node\Stmt\Class_ $class) : ?\PhpParser\Node
private function resolveCommandName(\PhpParser\Node\Stmt\Class_ $class) : ?\PhpParser\Node
{
$commandName = $this->resolveCommandNameFromConstructor($class);
if (!$commandName instanceof \PhpParser\Node) {
$commandName = $this->resolveCommandNameFromSetName($class);
return $this->resolveCommandNameFromSetName($class);
}
$this->removeConstructorIfHasOnlySetNameMethodCall($class);
return $commandName;
}
private function resolveCommandNameFromConstructor(\PhpParser\Node\Stmt\Class_ $class) : ?\PhpParser\Node
Expand All @@ -107,6 +117,11 @@ private function resolveCommandNameFromConstructor(\PhpParser\Node\Stmt\Class_ $
if (!$commandName instanceof \PhpParser\Node\Expr) {
return null;
}
// only valid static property values for name
if (!$commandName instanceof \PhpParser\Node\Scalar\String_ && !$commandName instanceof \PhpParser\Node\Expr\ConstFetch) {
return null;
}
// remove if parent name is not string
\array_shift($node->args);
});
return $commandName;
Expand Down
10 changes: 5 additions & 5 deletions vendor/scoper-autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
if (!class_exists('AutoloadIncluder', false) && !interface_exists('AutoloadIncluder', false) && !trait_exists('AutoloadIncluder', false)) {
spl_autoload_call('RectorPrefix20220105\AutoloadIncluder');
}
if (!class_exists('ComposerAutoloaderInitd2c47e9b1c523de03caede4ae2ea2722', false) && !interface_exists('ComposerAutoloaderInitd2c47e9b1c523de03caede4ae2ea2722', false) && !trait_exists('ComposerAutoloaderInitd2c47e9b1c523de03caede4ae2ea2722', false)) {
spl_autoload_call('RectorPrefix20220105\ComposerAutoloaderInitd2c47e9b1c523de03caede4ae2ea2722');
if (!class_exists('ComposerAutoloaderInitd57d3b62cac2a6917f38b59e005d7804', false) && !interface_exists('ComposerAutoloaderInitd57d3b62cac2a6917f38b59e005d7804', false) && !trait_exists('ComposerAutoloaderInitd57d3b62cac2a6917f38b59e005d7804', false)) {
spl_autoload_call('RectorPrefix20220105\ComposerAutoloaderInitd57d3b62cac2a6917f38b59e005d7804');
}
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('RectorPrefix20220105\Helmich\TypoScriptParser\Parser\AST\Statement');
Expand Down Expand Up @@ -71,9 +71,9 @@ function print_node() {
return \RectorPrefix20220105\print_node(...func_get_args());
}
}
if (!function_exists('composerRequired2c47e9b1c523de03caede4ae2ea2722')) {
function composerRequired2c47e9b1c523de03caede4ae2ea2722() {
return \RectorPrefix20220105\composerRequired2c47e9b1c523de03caede4ae2ea2722(...func_get_args());
if (!function_exists('composerRequired57d3b62cac2a6917f38b59e005d7804')) {
function composerRequired57d3b62cac2a6917f38b59e005d7804() {
return \RectorPrefix20220105\composerRequired57d3b62cac2a6917f38b59e005d7804(...func_get_args());
}
}
if (!function_exists('scanPath')) {
Expand Down

0 comments on commit 348f392

Please sign in to comment.