Updated Rector to commit baf8394798205ee0d9c6f27e72f018e0996e624f

baf8394798 Fix var/property usage for RemoveUnusedNonEmptyArrayBeforeForeachRector. (#3040)
This commit is contained in:
Tomas Votruba 2022-11-10 13:29:01 +00:00
parent d9e32f78d0
commit 728e63c6c2
12 changed files with 72 additions and 65 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 ComposerAutoloaderInit616d5e9225234d487d24cad0ea6ffd9f::getLoader();
return ComposerAutoloaderInitc4eb63e0c79df7b460329012e9250571::getLoader();

View File

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

View File

@ -733,17 +733,17 @@
},
{
"name": "phpstan\/phpstan",
"version": "1.9.1",
"version_normalized": "1.9.1.0",
"version": "1.9.2",
"version_normalized": "1.9.2.0",
"source": {
"type": "git",
"url": "https:\/\/github.com\/phpstan\/phpstan.git",
"reference": "a59c8b5bfd4a236f27efc8b5ce72c313c2b54b5f"
"reference": "d6fdf01c53978b6429f1393ba4afeca39cc68afa"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/phpstan\/phpstan\/zipball\/a59c8b5bfd4a236f27efc8b5ce72c313c2b54b5f",
"reference": "a59c8b5bfd4a236f27efc8b5ce72c313c2b54b5f",
"url": "https:\/\/api.github.com\/repos\/phpstan\/phpstan\/zipball\/d6fdf01c53978b6429f1393ba4afeca39cc68afa",
"reference": "d6fdf01c53978b6429f1393ba4afeca39cc68afa",
"shasum": ""
},
"require": {
@ -752,7 +752,7 @@
"conflict": {
"phpstan\/phpstan-shim": "*"
},
"time": "2022-11-04T13:35:59+00:00",
"time": "2022-11-10T09:56:11+00:00",
"bin": [
"phpstan",
"phpstan.phar"
@ -775,7 +775,7 @@
],
"support": {
"issues": "https:\/\/github.com\/phpstan\/phpstan\/issues",
"source": "https:\/\/github.com\/phpstan\/phpstan\/tree\/1.9.1"
"source": "https:\/\/github.com\/phpstan\/phpstan\/tree\/1.9.2"
},
"funding": [
{
@ -2128,12 +2128,12 @@
"source": {
"type": "git",
"url": "https:\/\/github.com\/rectorphp\/rector-symfony.git",
"reference": "5edba8c5bedcbe544cd4ac919e64a53546e0b8f7"
"reference": "370bf47bad5dd9b75c036df90397e27ccbcbc6f1"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-symfony\/zipball\/5edba8c5bedcbe544cd4ac919e64a53546e0b8f7",
"reference": "5edba8c5bedcbe544cd4ac919e64a53546e0b8f7",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-symfony\/zipball\/370bf47bad5dd9b75c036df90397e27ccbcbc6f1",
"reference": "370bf47bad5dd9b75c036df90397e27ccbcbc6f1",
"shasum": ""
},
"require": {
@ -2164,7 +2164,7 @@
"symplify\/rule-doc-generator": "^11.1",
"symplify\/vendor-patches": "^11.1"
},
"time": "2022-11-07T09:26:56+00:00",
"time": "2022-11-10T13:21:23+00:00",
"default-branch": true,
"type": "rector-extension",
"extra": {
@ -2778,17 +2778,17 @@
},
{
"name": "symfony\/polyfill-intl-normalizer",
"version": "v1.26.0",
"version_normalized": "1.26.0.0",
"version": "v1.27.0",
"version_normalized": "1.27.0.0",
"source": {
"type": "git",
"url": "https:\/\/github.com\/symfony\/polyfill-intl-normalizer.git",
"reference": "219aa369ceff116e673852dce47c3a41794c14bd"
"reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/symfony\/polyfill-intl-normalizer\/zipball\/219aa369ceff116e673852dce47c3a41794c14bd",
"reference": "219aa369ceff116e673852dce47c3a41794c14bd",
"url": "https:\/\/api.github.com\/repos\/symfony\/polyfill-intl-normalizer\/zipball\/19bd1e4fcd5b91116f14d8533c57831ed00571b6",
"reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6",
"shasum": ""
},
"require": {
@ -2797,11 +2797,11 @@
"suggest": {
"ext-intl": "For best performance"
},
"time": "2022-05-24T11:49:31+00:00",
"time": "2022-11-03T14:55:06+00:00",
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "1.26-dev"
"dev-main": "1.27-dev"
},
"thanks": {
"name": "symfony\/polyfill",
@ -2845,7 +2845,7 @@
"shim"
],
"support": {
"source": "https:\/\/github.com\/symfony\/polyfill-intl-normalizer\/tree\/v1.26.0"
"source": "https:\/\/github.com\/symfony\/polyfill-intl-normalizer\/tree\/v1.27.0"
},
"funding": [
{
@ -2865,17 +2865,17 @@
},
{
"name": "symfony\/polyfill-mbstring",
"version": "v1.26.0",
"version_normalized": "1.26.0.0",
"version": "v1.27.0",
"version_normalized": "1.27.0.0",
"source": {
"type": "git",
"url": "https:\/\/github.com\/symfony\/polyfill-mbstring.git",
"reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e"
"reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/symfony\/polyfill-mbstring\/zipball\/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
"reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
"url": "https:\/\/api.github.com\/repos\/symfony\/polyfill-mbstring\/zipball\/8ad114f6b39e2c98a8b0e3bd907732c207c2b534",
"reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534",
"shasum": ""
},
"require": {
@ -2887,11 +2887,11 @@
"suggest": {
"ext-mbstring": "For best performance"
},
"time": "2022-05-24T11:49:31+00:00",
"time": "2022-11-03T14:55:06+00:00",
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "1.26-dev"
"dev-main": "1.27-dev"
},
"thanks": {
"name": "symfony\/polyfill",
@ -2931,7 +2931,7 @@
"shim"
],
"support": {
"source": "https:\/\/github.com\/symfony\/polyfill-mbstring\/tree\/v1.26.0"
"source": "https:\/\/github.com\/symfony\/polyfill-mbstring\/tree\/v1.27.0"
},
"funding": [
{

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@ -1,16 +1,16 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEE0yaA1ZV9xxFr4pwUzxoQjQ565yAFAmNlFTAACgkQzxoQjQ56
5yAgcQ/+JgMr95MPwBMy12jeDyBKuLsU6+qCsMQloOvq2IFxq0iHROsxhGOthmQV
ZFSwFQT1u+4waHnGcUMPs0slurbW7WUkNxBwGIuzNaVauXsbSn7n+Su/wG/I28Si
9AmybTeanEVEpUe4eF3wSC9IU1Swm41EnMGZNdVFTg/dJs0sYjrJbkjqSKZ9nAXC
dSm3/YxXFe80nlbmpbZfm2zBYvaXkYYq0bd1qTim29fkQ90QViWMzSh5MHObvc3z
oF/oQKkJKjgH8VeXcWLj+N6BaCexsrXInUo20VOyou+af+60Qub9qctHkvRl48BS
95wP7xlI0sjC+AmX/EoC2SNnBAy+PcJlRwev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a4muZPmv1qybTluWP5Z4SXzJ38GiU8zZPuM=
=FymU
-----END PGP SIGNATURE-----

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 17bdb82'), '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 da1013f'), '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 9c21f5f'), '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 294de0c'), '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 0a98dbb'), '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 5edba8c'));
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 17bdb82'), '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 da1013f'), '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 9c21f5f'), '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 294de0c'), '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 0a98dbb'), '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 370bf47'));
private function __construct()
{
}

View File

@ -68,18 +68,21 @@ final class AddRouteAnnotationRector extends AbstractRector
}
$controllerReference = $this->resolveControllerReference($class, $node);
// is there a route for this annotation?
$symfonyRouteMetadata = $this->matchSymfonyRouteMetadataByControllerReference($controllerReference);
if (!$symfonyRouteMetadata instanceof SymfonyRouteMetadata) {
$symfonyRoutes = $this->matchSymfonyRouteMetadataByControllerReference($controllerReference);
if ($symfonyRoutes === []) {
return null;
}
// skip if already has an annotation
$phpDocInfo = $this->phpDocInfoFactory->createFromNodeOrEmpty($node);
$doctrineAnnotationTagValueNode = $phpDocInfo->getByAnnotationClass(SymfonyAnnotation::ROUTE);
if ($doctrineAnnotationTagValueNode !== null) {
return null;
}
$items = $this->createRouteItems($symfonyRouteMetadata);
$symfonyRouteTagValueNode = $this->symfonyRouteTagValueNodeFactory->createFromItems($items);
$phpDocInfo->addTagValueNode($symfonyRouteTagValueNode);
foreach ($symfonyRoutes as $symfonyRoute) {
$items = $this->createRouteItems($symfonyRoute);
$symfonyRouteTagValueNode = $this->symfonyRouteTagValueNodeFactory->createFromItems($items);
$phpDocInfo->addTagValueNode($symfonyRouteTagValueNode);
}
return $node;
}
public function getRuleDefinition() : RuleDefinition
@ -154,14 +157,18 @@ CODE_SAMPLE
}
return $arrayItemNodes;
}
private function matchSymfonyRouteMetadataByControllerReference(string $controllerReference) : ?SymfonyRouteMetadata
/**
* @return SymfonyRouteMetadata[]
*/
private function matchSymfonyRouteMetadataByControllerReference(string $controllerReference) : array
{
$matches = [];
foreach ($this->symfonyRoutesProvider->provide() as $symfonyRouteMetadata) {
if ($symfonyRouteMetadata->getControllerReference() === $controllerReference) {
return $symfonyRouteMetadata;
$matches[] = $symfonyRouteMetadata;
}
}
return null;
return $matches;
}
/**
* @param mixed[] $values

View File

@ -42,7 +42,7 @@
"minimum-stability": "dev",
"extra": {
"branch-alias": {
"dev-main": "1.26-dev"
"dev-main": "1.27-dev"
},
"thanks": {
"name": "symfony\/polyfill",

View File

@ -73,7 +73,7 @@ final class Mbstring
private static $internalEncoding = 'UTF-8';
public static function mb_convert_encoding($s, $toEncoding, $fromEncoding = null)
{
if (\is_array($fromEncoding) || $fromEncoding !== null && \false !== \strpos($fromEncoding, ',')) {
if (\is_array($fromEncoding) || null !== $fromEncoding && \false !== \strpos($fromEncoding, ',')) {
$fromEncoding = self::mb_detect_encoding($s, $fromEncoding);
} else {
$fromEncoding = self::getEncoding($fromEncoding);

View File

@ -41,7 +41,7 @@
"minimum-stability": "dev",
"extra": {
"branch-alias": {
"dev-main": "1.26-dev"
"dev-main": "1.27-dev"
},
"thanks": {
"name": "symfony\/polyfill",