Updated Rector to commit de008767d91ad6cd5ed77bdc259454665e4bbde9

de008767d9 Replace static with self for private constants (#3178)
This commit is contained in:
Tomas Votruba 2022-12-13 07:34:24 +00:00
parent 5a40891bc0
commit d2059134fe
9 changed files with 56 additions and 31 deletions

2
vendor/autoload.php vendored
View File

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

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit314f9626f269cfac8261df18b48b68e2
class ComposerAutoloaderInit3f30daaa94190933b9e2885c83a2ecbe
{
private static $loader;
@ -22,19 +22,19 @@ class ComposerAutoloaderInit314f9626f269cfac8261df18b48b68e2
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit314f9626f269cfac8261df18b48b68e2', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit3f30daaa94190933b9e2885c83a2ecbe', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInit314f9626f269cfac8261df18b48b68e2', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit3f30daaa94190933b9e2885c83a2ecbe', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit314f9626f269cfac8261df18b48b68e2::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit3f30daaa94190933b9e2885c83a2ecbe::getInitializer($loader));
$loader->setClassMapAuthoritative(true);
$loader->register(true);
$includeFiles = \Composer\Autoload\ComposerStaticInit314f9626f269cfac8261df18b48b68e2::$files;
$includeFiles = \Composer\Autoload\ComposerStaticInit3f30daaa94190933b9e2885c83a2ecbe::$files;
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequire314f9626f269cfac8261df18b48b68e2($fileIdentifier, $file);
composerRequire3f30daaa94190933b9e2885c83a2ecbe($fileIdentifier, $file);
}
return $loader;
@ -46,7 +46,7 @@ class ComposerAutoloaderInit314f9626f269cfac8261df18b48b68e2
* @param string $file
* @return void
*/
function composerRequire314f9626f269cfac8261df18b48b68e2($fileIdentifier, $file)
function composerRequire3f30daaa94190933b9e2885c83a2ecbe($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 ComposerStaticInit314f9626f269cfac8261df18b48b68e2
class ComposerStaticInit3f30daaa94190933b9e2885c83a2ecbe
{
public static $files = array (
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
@ -3027,9 +3027,9 @@ class ComposerStaticInit314f9626f269cfac8261df18b48b68e2
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit314f9626f269cfac8261df18b48b68e2::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit314f9626f269cfac8261df18b48b68e2::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit314f9626f269cfac8261df18b48b68e2::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInit3f30daaa94190933b9e2885c83a2ecbe::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit3f30daaa94190933b9e2885c83a2ecbe::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit3f30daaa94190933b9e2885c83a2ecbe::$classMap;
}, null, ClassLoader::class);
}

View File

@ -2058,12 +2058,12 @@
"source": {
"type": "git",
"url": "https:\/\/github.com\/rectorphp\/rector-symfony.git",
"reference": "2142ee12ff1e6fbef11ef9d86c778fc9e30a8a74"
"reference": "8242133d713b915aa951ce384ab6631edd11480c"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-symfony\/zipball\/2142ee12ff1e6fbef11ef9d86c778fc9e30a8a74",
"reference": "2142ee12ff1e6fbef11ef9d86c778fc9e30a8a74",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-symfony\/zipball\/8242133d713b915aa951ce384ab6631edd11480c",
"reference": "8242133d713b915aa951ce384ab6631edd11480c",
"shasum": ""
},
"require": {
@ -2093,7 +2093,7 @@
"symplify\/rule-doc-generator": "^11.1",
"symplify\/vendor-patches": "^11.1"
},
"time": "2022-12-12T13:57:47+00:00",
"time": "2022-12-12T17:18:59+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-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 6163431'), '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 b1ca6d7'), 'rector/rector-php-parser' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-php-parser', 'relative_install_path' => '../../rector-php-parser', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 9ea5f62'), '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 2520dbc'), '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 2142ee1'));
public const EXTENSIONS = array('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 6163431'), '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 b1ca6d7'), 'rector/rector-php-parser' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-php-parser', 'relative_install_path' => '../../rector-php-parser', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 9ea5f62'), '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 2520dbc'), '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 8242133'));
private function __construct()
{
}

View File

@ -5,9 +5,9 @@ namespace Rector\Symfony\Rector\MethodCall;
use PhpParser\Node;
use PhpParser\Node\Arg;
use PhpParser\Node\Expr\FuncCall;
use PhpParser\Node\Expr\MethodCall;
use PhpParser\Node\Expr\StaticCall;
use PhpParser\Node\Identifier;
use PhpParser\Node\Scalar\String_;
use Rector\Core\Rector\AbstractRector;
use Rector\PHPUnit\NodeAnalyzer\TestsNodeAnalyzer;
@ -95,10 +95,15 @@ CODE_SAMPLE
$newArgs = [];
// When we had a custom message argument we want to add it to the new assert.
if (isset($args[2])) {
$newArgs[] = new Arg(new String_($this->valueResolver->getValue($args[2]->value, \true)));
if ($args[2]->value instanceof FuncCall) {
$newArgs[] = $args[2]->value;
} else {
$newArgs[] = new Arg(new String_($this->valueResolver->getValue($args[2]->value, \true)));
}
}
$node->name = new Identifier('assertResponseIsSuccessful');
$node->args = $newArgs;
return $node;
if ($node instanceof StaticCall) {
return $this->nodeFactory->createStaticCall('self', 'assertResponseIsSuccessful', $newArgs);
}
return $this->nodeFactory->createLocalMethodCall('assertResponseIsSuccessful', $newArgs);
}
}

View File

@ -5,6 +5,7 @@ namespace Rector\Symfony\Rector\MethodCall;
use PhpParser\Node;
use PhpParser\Node\Expr;
use PhpParser\Node\Expr\FuncCall;
use PhpParser\Node\Expr\MethodCall;
use PhpParser\Node\Expr\StaticCall;
use PHPStan\Type\ObjectType;
@ -81,7 +82,6 @@ CODE_SAMPLE
if (!$this->symfonyTestCaseAnalyzer->isInWebTestCase($node)) {
return null;
}
// assertResponseStatusCodeSame
$newMethodCall = $this->processAssertResponseStatusCodeSame($node);
if ($newMethodCall !== null) {
return $newMethodCall;
@ -136,7 +136,11 @@ CODE_SAMPLE
$newArgs = [$methodCall->args[0]];
// When we had a custom message argument we want to add it to the new assert.
if (isset($args[2])) {
$newArgs[] = $this->valueResolver->getValue($args[2]->value, \true);
if ($args[2]->value instanceof FuncCall) {
$newArgs[] = $args[2]->value;
} else {
$newArgs[] = $this->valueResolver->getValue($args[2]->value, \true);
}
}
if ($methodCall instanceof StaticCall) {
return $this->nodeFactory->createStaticCall('self', 'assertResponseStatusCodeSame', $newArgs);
@ -161,7 +165,11 @@ CODE_SAMPLE
if (isset($args[2])) {
// When we had a $message argument we want to add it to the new assert together with $expectedCode null.
$newArgs[] = null;
$newArgs[] = $this->valueResolver->getValue($args[2]->value, \true);
if ($args[2]->value instanceof FuncCall) {
$newArgs[] = $args[2]->value;
} else {
$newArgs[] = $this->valueResolver->getValue($args[2]->value, \true);
}
}
if ($methodCall instanceof StaticCall) {
return $this->nodeFactory->createStaticCall('self', 'assertResponseRedirects', $newArgs);

View File

@ -5,9 +5,9 @@ namespace Rector\Symfony\Rector\MethodCall;
use PhpParser\Node;
use PhpParser\Node\Arg;
use PhpParser\Node\Expr\FuncCall;
use PhpParser\Node\Expr\MethodCall;
use PhpParser\Node\Expr\StaticCall;
use PhpParser\Node\Identifier;
use PhpParser\Node\Scalar\String_;
use Rector\Core\Rector\AbstractRector;
use Rector\PHPUnit\NodeAnalyzer\TestsNodeAnalyzer;
@ -104,10 +104,22 @@ CODE_SAMPLE
$newArgs = [$nestedMethodCall->args[0], $args[0]];
// When we had a custom message argument we want to add it to the new assert.
if (isset($args[2])) {
$newArgs[] = new Arg(new String_($this->valueResolver->getValue($args[2]->value, \true)));
if ($args[2]->value instanceof FuncCall) {
$newArgs[] = $args[2]->value;
} else {
$newArgs[] = new Arg(new String_($this->valueResolver->getValue($args[2]->value, \true)));
}
}
$node->name = new Identifier('assertSelectorTextContains');
$node->args = $newArgs;
return $node;
return $this->replaceFunctionCall($node, $newArgs);
}
/**
* @param Node[] $newArgs
*/
private function replaceFunctionCall(Node $node, array $newArgs) : Node
{
if ($node instanceof StaticCall) {
return $this->nodeFactory->createStaticCall('self', 'assertSelectorTextContains', $newArgs);
}
return $this->nodeFactory->createLocalMethodCall('assertSelectorTextContains', $newArgs);
}
}