Updated Rector to commit 743fef03d939a8a4fc4aa9364df057854e97e5c7

743fef03d9 [CodingStyle] Add StaticArrowFunctionRector (#2657)
This commit is contained in:
Tomas Votruba 2022-07-13 16:07:41 +00:00
parent 4ddedc166e
commit 2747e037dd
14 changed files with 114 additions and 47 deletions

View File

@ -3,6 +3,7 @@
declare (strict_types=1);
namespace RectorPrefix202207;
use Rector\CodingStyle\Rector\ArrowFunction\StaticArrowFunctionRector;
use Rector\CodingStyle\Rector\Assign\PHPStormVarAnnotationRector;
use Rector\CodingStyle\Rector\Assign\SplitDoubleAssignRector;
use Rector\CodingStyle\Rector\Catch_\CatchExceptionNameMatchingTypeRector;
@ -34,5 +35,5 @@ use Rector\Php55\Rector\String_\StringClassNameToClassConstantRector;
use Rector\Transform\Rector\FuncCall\FuncCallToConstFetchRector;
return static function (RectorConfig $rectorConfig) : void {
$rectorConfig->ruleWithConfiguration(FuncCallToConstFetchRector::class, ['php_sapi_name' => 'PHP_SAPI', 'pi' => 'M_PI']);
$rectorConfig->rules([SeparateMultiUseImportsRector::class, RemoveDoubleUnderscoreInMethodNameRector::class, PostIncDecToPreIncDecRector::class, UnSpreadOperatorRector::class, NewlineAfterStatementRector::class, RemoveFinalFromConstRector::class, PHPStormVarAnnotationRector::class, NullableCompareToNullRector::class, BinarySwitchToIfElseRector::class, ConsistentImplodeRector::class, TernaryConditionVariableAssignmentRector::class, SymplifyQuoteEscapeRector::class, SplitGroupedConstantsAndPropertiesRector::class, StringClassNameToClassConstantRector::class, ConsistentPregDelimiterRector::class, CatchExceptionNameMatchingTypeRector::class, UseIncrementAssignRector::class, SplitDoubleAssignRector::class, VarConstantCommentRector::class, EncapsedStringsToSprintfRector::class, WrapEncapsedVariableInCurlyBracesRector::class, NewlineBeforeNewAssignSetRector::class, AddArrayDefaultToArrayPropertyRector::class, AddFalseDefaultToBoolPropertyRector::class, MakeInheritedMethodVisibilitySameAsParentRector::class, CallUserFuncArrayToVariadicRector::class, VersionCompareFuncCallToConstantRector::class]);
$rectorConfig->rules([SeparateMultiUseImportsRector::class, RemoveDoubleUnderscoreInMethodNameRector::class, PostIncDecToPreIncDecRector::class, UnSpreadOperatorRector::class, NewlineAfterStatementRector::class, RemoveFinalFromConstRector::class, PHPStormVarAnnotationRector::class, NullableCompareToNullRector::class, BinarySwitchToIfElseRector::class, ConsistentImplodeRector::class, TernaryConditionVariableAssignmentRector::class, SymplifyQuoteEscapeRector::class, SplitGroupedConstantsAndPropertiesRector::class, StringClassNameToClassConstantRector::class, ConsistentPregDelimiterRector::class, CatchExceptionNameMatchingTypeRector::class, UseIncrementAssignRector::class, SplitDoubleAssignRector::class, VarConstantCommentRector::class, EncapsedStringsToSprintfRector::class, WrapEncapsedVariableInCurlyBracesRector::class, NewlineBeforeNewAssignSetRector::class, AddArrayDefaultToArrayPropertyRector::class, AddFalseDefaultToBoolPropertyRector::class, MakeInheritedMethodVisibilitySameAsParentRector::class, CallUserFuncArrayToVariadicRector::class, VersionCompareFuncCallToConstantRector::class, StaticArrowFunctionRector::class]);
};

View File

@ -0,0 +1,54 @@
<?php
declare (strict_types=1);
namespace Rector\CodingStyle\Rector\ArrowFunction;
use PhpParser\Node;
use PhpParser\Node\Expr\ArrowFunction;
use PhpParser\Node\Expr\Variable;
use Rector\Core\Rector\AbstractRector;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
/**
* @see \Rector\Tests\CodingStyle\Rector\ArrowFunction\StaticArrowFunctionRector\StaticArrowFunctionRectorTest
*/
final class StaticArrowFunctionRector extends AbstractRector
{
public function getRuleDefinition() : RuleDefinition
{
return new RuleDefinition('Changes ArrowFunction to be static when possible', [new CodeSample(<<<'CODE_SAMPLE'
fn (): string => 'test';
CODE_SAMPLE
, <<<'CODE_SAMPLE'
static fn (): string => 'test';
CODE_SAMPLE
)]);
}
/**
* @return array<class-string<Node>>
*/
public function getNodeTypes() : array
{
return [ArrowFunction::class];
}
/**
* @param ArrowFunction $node
*/
public function refactor(Node $node) : ?Node
{
if ($this->shouldSkip($node)) {
return null;
}
$node->static = \true;
return $node;
}
private function shouldSkip(ArrowFunction $arrowFunction) : bool
{
if ($arrowFunction->static) {
return \true;
}
return (bool) $this->betterNodeFinder->findFirst($arrowFunction->expr, static function (Node $subNode) : bool {
return $subNode instanceof Variable && $subNode->name === 'this';
});
}
}

View File

@ -17,12 +17,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = 'b1ae9a141523ee35af1f63aab39d945e8df03275';
public const PACKAGE_VERSION = '743fef03d939a8a4fc4aa9364df057854e97e5c7';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2022-07-11 15:34:22';
public const RELEASE_DATE = '2022-07-13 23:01:38';
/**
* @var int
*/

2
vendor/autoload.php vendored
View File

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

View File

@ -1426,6 +1426,7 @@ return array(
'Rector\\CodingStyle\\NodeAnalyzer\\UseImportNameMatcher' => $baseDir . '/rules/CodingStyle/NodeAnalyzer/UseImportNameMatcher.php',
'Rector\\CodingStyle\\NodeFactory\\ArrayCallableToMethodCallFactory' => $baseDir . '/rules/CodingStyle/NodeFactory/ArrayCallableToMethodCallFactory.php',
'Rector\\CodingStyle\\Node\\NameImporter' => $baseDir . '/rules/CodingStyle/Node/NameImporter.php',
'Rector\\CodingStyle\\Rector\\ArrowFunction\\StaticArrowFunctionRector' => $baseDir . '/rules/CodingStyle/Rector/ArrowFunction/StaticArrowFunctionRector.php',
'Rector\\CodingStyle\\Rector\\Assign\\PHPStormVarAnnotationRector' => $baseDir . '/rules/CodingStyle/Rector/Assign/PHPStormVarAnnotationRector.php',
'Rector\\CodingStyle\\Rector\\Assign\\SplitDoubleAssignRector' => $baseDir . '/rules/CodingStyle/Rector/Assign/SplitDoubleAssignRector.php',
'Rector\\CodingStyle\\Rector\\Catch_\\CatchExceptionNameMatchingTypeRector' => $baseDir . '/rules/CodingStyle/Rector/Catch_/CatchExceptionNameMatchingTypeRector.php',

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit48830c97cb52d30554c8140522d6fd70
class ComposerAutoloaderInit4e1afc3d4f5d211b8221b9d2f71bd119
{
private static $loader;
@ -22,19 +22,19 @@ class ComposerAutoloaderInit48830c97cb52d30554c8140522d6fd70
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit48830c97cb52d30554c8140522d6fd70', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit4e1afc3d4f5d211b8221b9d2f71bd119', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInit48830c97cb52d30554c8140522d6fd70', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit4e1afc3d4f5d211b8221b9d2f71bd119', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit48830c97cb52d30554c8140522d6fd70::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit4e1afc3d4f5d211b8221b9d2f71bd119::getInitializer($loader));
$loader->setClassMapAuthoritative(true);
$loader->register(true);
$includeFiles = \Composer\Autoload\ComposerStaticInit48830c97cb52d30554c8140522d6fd70::$files;
$includeFiles = \Composer\Autoload\ComposerStaticInit4e1afc3d4f5d211b8221b9d2f71bd119::$files;
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequire48830c97cb52d30554c8140522d6fd70($fileIdentifier, $file);
composerRequire4e1afc3d4f5d211b8221b9d2f71bd119($fileIdentifier, $file);
}
return $loader;
@ -46,7 +46,7 @@ class ComposerAutoloaderInit48830c97cb52d30554c8140522d6fd70
* @param string $file
* @return void
*/
function composerRequire48830c97cb52d30554c8140522d6fd70($fileIdentifier, $file)
function composerRequire4e1afc3d4f5d211b8221b9d2f71bd119($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 ComposerStaticInit48830c97cb52d30554c8140522d6fd70
class ComposerStaticInit4e1afc3d4f5d211b8221b9d2f71bd119
{
public static $files = array (
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
@ -1733,6 +1733,7 @@ class ComposerStaticInit48830c97cb52d30554c8140522d6fd70
'Rector\\CodingStyle\\NodeAnalyzer\\UseImportNameMatcher' => __DIR__ . '/../..' . '/rules/CodingStyle/NodeAnalyzer/UseImportNameMatcher.php',
'Rector\\CodingStyle\\NodeFactory\\ArrayCallableToMethodCallFactory' => __DIR__ . '/../..' . '/rules/CodingStyle/NodeFactory/ArrayCallableToMethodCallFactory.php',
'Rector\\CodingStyle\\Node\\NameImporter' => __DIR__ . '/../..' . '/rules/CodingStyle/Node/NameImporter.php',
'Rector\\CodingStyle\\Rector\\ArrowFunction\\StaticArrowFunctionRector' => __DIR__ . '/../..' . '/rules/CodingStyle/Rector/ArrowFunction/StaticArrowFunctionRector.php',
'Rector\\CodingStyle\\Rector\\Assign\\PHPStormVarAnnotationRector' => __DIR__ . '/../..' . '/rules/CodingStyle/Rector/Assign/PHPStormVarAnnotationRector.php',
'Rector\\CodingStyle\\Rector\\Assign\\SplitDoubleAssignRector' => __DIR__ . '/../..' . '/rules/CodingStyle/Rector/Assign/SplitDoubleAssignRector.php',
'Rector\\CodingStyle\\Rector\\Catch_\\CatchExceptionNameMatchingTypeRector' => __DIR__ . '/../..' . '/rules/CodingStyle/Rector/Catch_/CatchExceptionNameMatchingTypeRector.php',
@ -3414,9 +3415,9 @@ class ComposerStaticInit48830c97cb52d30554c8140522d6fd70
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit48830c97cb52d30554c8140522d6fd70::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit48830c97cb52d30554c8140522d6fd70::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit48830c97cb52d30554c8140522d6fd70::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInit4e1afc3d4f5d211b8221b9d2f71bd119::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit4e1afc3d4f5d211b8221b9d2f71bd119::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit4e1afc3d4f5d211b8221b9d2f71bd119::$classMap;
}, null, ClassLoader::class);
}

View File

@ -803,17 +803,17 @@
},
{
"name": "phpstan\/phpstan",
"version": "1.8.0",
"version_normalized": "1.8.0.0",
"version": "1.8.1",
"version_normalized": "1.8.1.0",
"source": {
"type": "git",
"url": "https:\/\/github.com\/phpstan\/phpstan.git",
"reference": "b7648d4ee9321665acaf112e49da9fd93df8fbd5"
"reference": "8dbba631fa32f4b289404469c2afd6122fd61d67"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/phpstan\/phpstan\/zipball\/b7648d4ee9321665acaf112e49da9fd93df8fbd5",
"reference": "b7648d4ee9321665acaf112e49da9fd93df8fbd5",
"url": "https:\/\/api.github.com\/repos\/phpstan\/phpstan\/zipball\/8dbba631fa32f4b289404469c2afd6122fd61d67",
"reference": "8dbba631fa32f4b289404469c2afd6122fd61d67",
"shasum": ""
},
"require": {
@ -822,7 +822,7 @@
"conflict": {
"phpstan\/phpstan-shim": "*"
},
"time": "2022-06-29T08:53:31+00:00",
"time": "2022-07-12T16:08:06+00:00",
"bin": [
"phpstan",
"phpstan.phar"
@ -841,7 +841,7 @@
"description": "PHPStan - PHP Static Analysis Tool",
"support": {
"issues": "https:\/\/github.com\/phpstan\/phpstan\/issues",
"source": "https:\/\/github.com\/phpstan\/phpstan\/tree\/1.8.0"
"source": "https:\/\/github.com\/phpstan\/phpstan\/tree\/1.8.1"
},
"funding": [
{
@ -2415,12 +2415,12 @@
"source": {
"type": "git",
"url": "https:\/\/github.com\/rectorphp\/rector-symfony.git",
"reference": "d4e61a176e612818a15ebb832369dcde9641df76"
"reference": "6dd877b709a89b0bb939bdadc757d1122cd0d017"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-symfony\/zipball\/d4e61a176e612818a15ebb832369dcde9641df76",
"reference": "d4e61a176e612818a15ebb832369dcde9641df76",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-symfony\/zipball\/6dd877b709a89b0bb939bdadc757d1122cd0d017",
"reference": "6dd877b709a89b0bb939bdadc757d1122cd0d017",
"shasum": ""
},
"require": {
@ -2449,7 +2449,7 @@
"symplify\/rule-doc-generator": "^11.0",
"symplify\/vendor-patches": "^11.0"
},
"time": "2022-07-01T09:38:14+00:00",
"time": "2022-07-12T13:16:54+00:00",
"default-branch": true,
"type": "rector-extension",
"extra": {

File diff suppressed because one or more lines are too long

View File

@ -77,6 +77,7 @@ All the documentation lives on the [phpstan.org website](https://phpstan.org/):
* [PHPDocs Basics](https://phpstan.org/writing-php-code/phpdocs-basics) & [PHPDoc Types](https://phpstan.org/writing-php-code/phpdoc-types)
* [Extension Library](https://phpstan.org/user-guide/extension-library)
* [Developing Extensions](https://phpstan.org/developing-extensions/extension-types)
* [API Reference](https://apiref.phpstan.org/)
## PHPStan Pro

Binary file not shown.

View File

@ -1,16 +1,16 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEE0yaA1ZV9xxFr4pwUzxoQjQ565yAFAmK8Ev8ACgkQzxoQjQ56
5yCHXw/+NBWL0CkzIv5liqpNl6EzEJVRQn/YzOV/TSnBo8sUPAoKiGwMpJhj2p5i
SW2Tq4hV3ZcfT1T4QkmQmWQLJkdc61vCsPyv/95DP8xi4LVC7bwcAuOoXcat98e4
tdApg4oIA/GyjJlfU+CHYu6bnp9RruBnTDI6PT5ayApDEoNOeMxHQn+jKQ8jTJyp
gmmgI4VoBhMuV7L3ViDNNhfkGj6Jnl3U+TpQFTDUBuRSqF+jsTuB0ILE1+YFH/gg
IZidm/c2jyxhBgomY7He86MsLhdbdBrhDewcppo7O73VarrSr8vc3hnfHVeKY7HT
el0XmmF2QaCnH0SoftaUGPQ55WRDtg6kHIR9QBGaybG8SdkfsPU+/uBQvc560jF4
6RQdBwtIGQm2NRwIUjXkO1NyK7BERjhvUDE+yRjt6ykFp4bQjdEhdIxkllg6fkLo
H/X3c2w4w65SmKLnT2qD1Je1w41URGMy1/hZAWx9BMiRmHYzwO5R5clCj8hQkd9e
sNcURx4Vdr1ZAjPtluQNMKaWTdhoK9RgvGEW2dIx1gdvrnwPBhOrx++1I6a7ubBu
l2nyhAEKQBBxAv+W0kYHuqLh9wjhGtaDY/t8PohBgC5iirgpUScZkQ2tFxVAMXSH
pVqBsxtHgWcQ/UbfwG4SpkspoMPv51LokK5Ptsk1XkdXGGqxJFc=
=rEtu
iQIzBAABCgAdFiEE0yaA1ZV9xxFr4pwUzxoQjQ565yAFAmLNnFgACgkQzxoQjQ56
5yBvLA//Y9vKwT9O1c1dWc/vEs2qCRedQLuFYJTJKbwTvqNJwJN5GT1umpsi7KCN
MCoDzfutVkITEVZAYmlEUKowi0U+STYSs52guw6VoepC0eTW+b8VLOREo1UpAASb
VrCvEsRf6xrfslKqWnbl1RNNhBHpn7+UMloZcawEy7Jpp5G7JIGRhmBGQOVkvymA
0+UDw/UiWr+rZFbO5h3JlwFkwRjgzcCVZeNeyrd2oIFKgp8DmN9Kwq6tulGD3V1j
oJJh/8liFQrj3DFUz6yIczZcuTtbGcWmIhTQxtlJJczZyGXlK8aXIqac3/YbBIqo
4tvCgpLJjGQ8WouVUURGy/AXiUJulnBpDGUAmbdWrwDE3oxx2IPJ+OrmtZVcK2Q1
30+jLvdb5NasGTRV84aB7lLKrifde6qFWaXh+s1b/A8znnjHdFMTvYn2F6/xFWdO
u0GU5wIcLrWMvmQNA7mRPiV8e7KtOoCggCm923TDJ9Ov56ZL5N+iPCW+7TZWOuM9
L2JLhN26WCZzVn/ODuxpIKzz07UGCTcaKzNFYL/V/+Oly7JEub6nNI90SNHRcOt4
Iq+EoO8/jW2WZsnBHqP8o88ii9I+DEOYt60csVGVp4sZ3RDgSwXiC5eV0rDvz/0F
32oPtYAe5cRIwVriKhGlLM74eozaLmENgtMLePkclpNarFtdwFg=
=AySM
-----END PGP SIGNATURE-----

View File

@ -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 86ab8c3'), '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 d61cca4'), '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 97f49a2'), '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 644d45b'), '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 425881a'), '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 bee7c19'), '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 d826618'), '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 81f779a'), '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 d4e61a1'));
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 86ab8c3'), '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 d61cca4'), '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 97f49a2'), '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 644d45b'), '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 425881a'), '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 bee7c19'), '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 d826618'), '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 81f779a'), '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 6dd877b'));
private function __construct()
{
}

View File

@ -28,15 +28,26 @@ return static function (RectorConfig $rectorConfig) : void {
$rectorConfig->rule(PropertyPathMapperToDataMapperRector::class);
# https://github.com/symfony/symfony/blob/5.x/UPGRADE-5.2.md#httpfoundation
$rectorConfig->rule(BinaryFileResponseCreateToNewInstanceRector::class);
# https://github.com/symfony/symfony/blob/5.x/UPGRADE-5.2.md#mime
$rectorConfig->ruleWithConfiguration(RenameMethodRector::class, [new MethodCallRename('Symfony\\Component\\Mime\\Address', 'fromString', 'create')]);
# https://github.com/symfony/symfony/blob/5.x/UPGRADE-5.2.md#propertyaccess
$rectorConfig->rule(PropertyAccessorCreationBooleanToFlagsRector::class);
# https://github.com/symfony/symfony/blob/5.x/UPGRADE-5.2.md#propertyinfo
$rectorConfig->rule(ReflectionExtractorEnableMagicCallExtractorRector::class);
# https://github.com/symfony/symfony/blob/5.x/UPGRADE-5.2.md#security
$rectorConfig->ruleWithConfiguration(RenameClassConstFetchRector::class, [new RenameClassAndConstFetch('Symfony\\Component\\Security\\Http\\Firewall\\AccessListener', 'PUBLIC_ACCESS', 'Symfony\\Component\\Security\\Core\\Authorization\\Voter\\AuthenticatedVoter', 'PUBLIC_ACCESS')]);
$rectorConfig->ruleWithConfiguration(RenameMethodRector::class, [new MethodCallRename('Symfony\\Component\\Security\\Core\\Authentication\\Token\\PreAuthenticatedToken', 'setProviderKey', 'setFirewallName'), new MethodCallRename('Symfony\\Component\\Security\\Core\\Authentication\\Token\\PreAuthenticatedToken', 'getProviderKey', 'getFirewallName'), new MethodCallRename('Symfony\\Component\\Security\\Core\\Authentication\\Token\\RememberMeToken', 'setProviderKey', 'setFirewallName'), new MethodCallRename('Symfony\\Component\\Security\\Core\\Authentication\\Token\\RememberMeToken', 'getProviderKey', 'getFirewallName'), new MethodCallRename('Symfony\\Component\\Security\\Core\\Authentication\\Token\\SwitchUserToken', 'setProviderKey', 'setFirewallName'), new MethodCallRename('Symfony\\Component\\Security\\Core\\Authentication\\Token\\SwitchUserToken', 'getProviderKey', 'getFirewallName'), new MethodCallRename('Symfony\\Component\\Security\\Core\\Authentication\\Token\\UsernamePasswordToken', 'setProviderKey', 'setFirewallName'), new MethodCallRename('Symfony\\Component\\Security\\Core\\Authentication\\Token\\UsernamePasswordToken', 'getProviderKey', 'getFirewallName'), new MethodCallRename('Symfony\\Component\\Security\\Http\\Authentication\\DefaultAuthenticationSuccessHandler', 'setProviderKey', 'setFirewallName'), new MethodCallRename('Symfony\\Component\\Security\\Http\\Authentication\\DefaultAuthenticationSuccessHandler', 'getProviderKey', 'getFirewallName')]);
$rectorConfig->ruleWithConfiguration(RenameMethodRector::class, [
# https://github.com/symfony/symfony/blob/5.x/UPGRADE-5.2.md#mime
new MethodCallRename('Symfony\\Component\\Mime\\Address', 'fromString', 'create'),
new MethodCallRename('Symfony\\Component\\Security\\Core\\Authentication\\Token\\PreAuthenticatedToken', 'setProviderKey', 'setFirewallName'),
new MethodCallRename('Symfony\\Component\\Security\\Core\\Authentication\\Token\\PreAuthenticatedToken', 'getProviderKey', 'getFirewallName'),
new MethodCallRename('Symfony\\Component\\Security\\Core\\Authentication\\Token\\RememberMeToken', 'setProviderKey', 'setFirewallName'),
new MethodCallRename('Symfony\\Component\\Security\\Core\\Authentication\\Token\\RememberMeToken', 'getProviderKey', 'getFirewallName'),
new MethodCallRename('Symfony\\Component\\Security\\Core\\Authentication\\Token\\SwitchUserToken', 'setProviderKey', 'setFirewallName'),
new MethodCallRename('Symfony\\Component\\Security\\Core\\Authentication\\Token\\SwitchUserToken', 'getProviderKey', 'getFirewallName'),
new MethodCallRename('Symfony\\Component\\Security\\Core\\Authentication\\Token\\UsernamePasswordToken', 'setProviderKey', 'setFirewallName'),
new MethodCallRename('Symfony\\Component\\Security\\Core\\Authentication\\Token\\UsernamePasswordToken', 'getProviderKey', 'getFirewallName'),
new MethodCallRename('Symfony\\Component\\Security\\Http\\Authentication\\DefaultAuthenticationSuccessHandler', 'setProviderKey', 'setFirewallName'),
new MethodCallRename('Symfony\\Component\\Security\\Http\\Authentication\\DefaultAuthenticationSuccessHandler', 'getProviderKey', 'getFirewallName'),
]);
# https://github.com/symfony/symfony/blob/5.x/UPGRADE-5.2.md#dependencyinjection
$rectorConfig->rule(DefinitionAliasSetPrivateToSetPublicRector::class);
# https://github.com/symfony/symfony/blob/5.x/UPGRADE-5.2.md#form
@ -44,9 +55,7 @@ return static function (RectorConfig $rectorConfig) : void {
# https://github.com/symfony/symfony/blob/5.x/UPGRADE-5.2.md#validator
$rectorConfig->rule(ValidatorBuilderEnableAnnotationMappingRector::class);
# https://github.com/symfony/symfony/blob/5.x/UPGRADE-5.2.md#notifier
$rectorConfig->ruleWithConfiguration(AddParamTypeDeclarationRector::class, [new AddParamTypeDeclaration('Symfony\\Component\\Notifier\\NotifierInterface', 'send', 1, new ObjectType('Symfony\\Component\\Notifier\\Recipient\\RecipientInterface')), new AddParamTypeDeclaration('Symfony\\Component\\Notifier\\Notifier', 'getChannels', 1, new ObjectType('Symfony\\Component\\Notifier\\Recipient\\RecipientInterface')), new AddParamTypeDeclaration('Symfony\\Component\\Notifier\\Channel\\ChannelInterface', 'notify', 1, new ObjectType('Symfony\\Component\\Notifier\\Recipient\\RecipientInterface')), new AddParamTypeDeclaration('Symfony\\Component\\Notifier\\Channel\\ChannelInterface', 'supports', 1, new ObjectType('Symfony\\Component\\Notifier\\Recipient\\RecipientInterface'))]);
# https://github.com/symfony/symfony/blob/5.x/UPGRADE-5.2.md#notifier
$rectorConfig->ruleWithConfiguration(AddParamTypeDeclarationRector::class, [new AddParamTypeDeclaration('Symfony\\Component\\Notifier\\Notification\\ChatNotificationInterface', 'asChatMessage', 0, new ObjectType('Symfony\\Component\\Notifier\\Recipient\\RecipientInterface')), new AddParamTypeDeclaration('Symfony\\Component\\Notifier\\Notification\\EmailNotificationInterface', 'asEmailMessage', 0, new ObjectType('Symfony\\Component\\Notifier\\Recipient\\EmailRecipientInterface')), new AddParamTypeDeclaration('Symfony\\Component\\Notifier\\Notification\\SmsNotificationInterface', 'asSmsMessage', 0, new ObjectType('Symfony\\Component\\Notifier\\Recipient\\SmsRecipientInterface'))]);
$rectorConfig->ruleWithConfiguration(AddParamTypeDeclarationRector::class, [new AddParamTypeDeclaration('Symfony\\Component\\Notifier\\NotifierInterface', 'send', 1, new ObjectType('Symfony\\Component\\Notifier\\Recipient\\RecipientInterface')), new AddParamTypeDeclaration('Symfony\\Component\\Notifier\\Notifier', 'getChannels', 1, new ObjectType('Symfony\\Component\\Notifier\\Recipient\\RecipientInterface')), new AddParamTypeDeclaration('Symfony\\Component\\Notifier\\Channel\\ChannelInterface', 'notify', 1, new ObjectType('Symfony\\Component\\Notifier\\Recipient\\RecipientInterface')), new AddParamTypeDeclaration('Symfony\\Component\\Notifier\\Channel\\ChannelInterface', 'supports', 1, new ObjectType('Symfony\\Component\\Notifier\\Recipient\\RecipientInterface')), new AddParamTypeDeclaration('Symfony\\Component\\Notifier\\Notification\\ChatNotificationInterface', 'asChatMessage', 0, new ObjectType('Symfony\\Component\\Notifier\\Recipient\\RecipientInterface')), new AddParamTypeDeclaration('Symfony\\Component\\Notifier\\Notification\\EmailNotificationInterface', 'asEmailMessage', 0, new ObjectType('Symfony\\Component\\Notifier\\Recipient\\EmailRecipientInterface')), new AddParamTypeDeclaration('Symfony\\Component\\Notifier\\Notification\\SmsNotificationInterface', 'asSmsMessage', 0, new ObjectType('Symfony\\Component\\Notifier\\Recipient\\SmsRecipientInterface'))]);
# https://github.com/symfony/symfony/blob/5.x/UPGRADE-5.2.md#security
$rectorConfig->ruleWithConfiguration(RenamePropertyRector::class, [new RenameProperty('Symfony\\Component\\Security\\Http\\RememberMe\\AbstractRememberMeServices', 'providerKey', 'firewallName')]);
};