mirror of
https://github.com/rectorphp/rector.git
synced 2024-05-28 23:10:51 +00:00
Updated Rector to commit 2d24210c3f
2d24210c3f
[automated] Re-Generate Nodes/Rectors Documentation (#1394)
This commit is contained in:
parent
e6aa910018
commit
560c118ef7
|
@ -1,4 +1,4 @@
|
|||
# 502 Rules Overview
|
||||
# 504 Rules Overview
|
||||
|
||||
<br>
|
||||
|
||||
|
@ -40,9 +40,9 @@
|
|||
|
||||
- [DowngradePhp74](#downgradephp74) (11)
|
||||
|
||||
- [DowngradePhp80](#downgradephp80) (19)
|
||||
- [DowngradePhp80](#downgradephp80) (20)
|
||||
|
||||
- [DowngradePhp81](#downgradephp81) (7)
|
||||
- [DowngradePhp81](#downgradephp81) (8)
|
||||
|
||||
- [EarlyReturn](#earlyreturn) (11)
|
||||
|
||||
|
@ -127,9 +127,11 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
|||
$services = $containerConfigurator->services();
|
||||
|
||||
$services->set(ArgumentAdderRector::class)
|
||||
->configure([
|
||||
new ArgumentAdder('SomeExampleClass', 'someMethod', 0, 'someArgument', true, new ObjectType('SomeType')),
|
||||
]);
|
||||
->call('configure', [[
|
||||
ArgumentAdderRector::ADDED_ARGUMENTS => ValueObjectInliner::inline([
|
||||
new ArgumentAdder('SomeExampleClass', 'someMethod', 0, 'someArgument', true, new ObjectType('SomeType')),
|
||||
]),
|
||||
]]);
|
||||
};
|
||||
```
|
||||
|
||||
|
@ -5254,6 +5256,24 @@ Remove "abstract" from private methods in traits and adds an empty function body
|
|||
|
||||
<br>
|
||||
|
||||
### DowngradeArbitraryExpressionsSupportRector
|
||||
|
||||
Replace arbitrary expressions used with new or instanceof.
|
||||
|
||||
- class: [`Rector\DowngradePhp80\Rector\New_\DowngradeArbitraryExpressionsSupportRector`](../rules/DowngradePhp80/Rector/New_/DowngradeArbitraryExpressionsSupportRector.php)
|
||||
|
||||
```diff
|
||||
function getObjectClassName() {
|
||||
return stdClass::class;
|
||||
}
|
||||
|
||||
-$object = new (getObjectClassName());
|
||||
+$className = getObjectClassName();
|
||||
+$object = new $className();
|
||||
```
|
||||
|
||||
<br>
|
||||
|
||||
### DowngradeAttributeToAnnotationRector
|
||||
|
||||
Refactor PHP attribute markers to annotations notation
|
||||
|
@ -5659,6 +5679,28 @@ Removes union type property type definition, adding `@var` annotations instead.
|
|||
|
||||
## DowngradePhp81
|
||||
|
||||
### DowngradeArraySpreadStringKeyRector
|
||||
|
||||
Replace array spread with string key to array_merge function
|
||||
|
||||
- class: [`Rector\DowngradePhp81\Rector\Array_\DowngradeArraySpreadStringKeyRector`](../rules/DowngradePhp81/Rector/Array_/DowngradeArraySpreadStringKeyRector.php)
|
||||
|
||||
```diff
|
||||
class SomeClass
|
||||
{
|
||||
public function run()
|
||||
{
|
||||
$parts = ['a' => 'b'];
|
||||
$parts2 = ['c' => 'd'];
|
||||
|
||||
- $result = [...$parts, ...$parts2];
|
||||
+ $result = array_merge($parts, $parts2);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
<br>
|
||||
|
||||
### DowngradeFinalizePublicClassConstantRector
|
||||
|
||||
Remove final from class constants
|
||||
|
@ -7619,7 +7661,7 @@ Change `array_key_exists()` on property to `property_exists()`
|
|||
|
||||
### ArraySpreadInsteadOfArrayMergeRector
|
||||
|
||||
Change `array_merge()` to spread operator, except values with possible string key values
|
||||
Change `array_merge()` to spread operator
|
||||
|
||||
- class: [`Rector\Php74\Rector\FuncCall\ArraySpreadInsteadOfArrayMergeRector`](../rules/Php74/Rector/FuncCall/ArraySpreadInsteadOfArrayMergeRector.php)
|
||||
|
||||
|
@ -8372,7 +8414,7 @@ Refactor MyCLabs enum class to native Enum
|
|||
-use MyCLabs\Enum\Enum;
|
||||
-
|
||||
-final class Action extends Enum
|
||||
+enum Action
|
||||
+enum Action : string
|
||||
{
|
||||
- private const VIEW = 'view';
|
||||
- private const EDIT = 'edit';
|
||||
|
@ -8477,7 +8519,7 @@ Refactor Spatie enum class to native Enum
|
|||
- * @method static self archived()
|
||||
- */
|
||||
-class StatusEnum extends Enum
|
||||
+enum StatusEnum
|
||||
+enum StatusEnum : string
|
||||
{
|
||||
+ case draft = 'draft';
|
||||
+ case published = 'published';
|
||||
|
@ -9501,18 +9543,19 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
|||
$services = $containerConfigurator->services();
|
||||
|
||||
$services->set(RenameAnnotationRector::class)
|
||||
->call('configure', [[
|
||||
RenameAnnotationRector::RENAMED_ANNOTATIONS => ValueObjectInliner::inline([
|
||||
new RenameAnnotationByType('PHPUnit\Framework\TestCase', 'test', 'scenario'),
|
||||
]),
|
||||
]]);
|
||||
->call(
|
||||
'configure',
|
||||
[[ValueObjectInliner::inline(new RenameAnnotationByType('PHPUnit\Framework\TestCase', 'test', 'scenario'))]]
|
||||
);
|
||||
};
|
||||
```
|
||||
|
||||
↓
|
||||
|
||||
```diff
|
||||
class SomeTest extends PHPUnit\Framework\TestCase
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
final class SomeTest extends TestCase
|
||||
{
|
||||
/**
|
||||
- * @test
|
||||
|
|
|
@ -16,11 +16,11 @@ final class VersionResolver
|
|||
/**
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = '2fbc1d4742f67806c06d27d427b6cbcaa6a5be0f';
|
||||
public const PACKAGE_VERSION = '2d24210c3f0bd9ae33d74c4ba429b357d5f5d193';
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2021-12-05 00:19:49';
|
||||
public const RELEASE_DATE = '2021-12-05 00:20:18';
|
||||
public static function resolvePackageVersion() : string
|
||||
{
|
||||
$process = new \RectorPrefix20211205\Symfony\Component\Process\Process(['git', 'log', '--pretty="%H"', '-n1', 'HEAD'], __DIR__);
|
||||
|
|
2
vendor/autoload.php
vendored
2
vendor/autoload.php
vendored
|
@ -4,4 +4,4 @@
|
|||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInit245cf1c212a743105f238cffe6695d2e::getLoader();
|
||||
return ComposerAutoloaderInit1944a655981f1ebe826ad68bf0e4dfb6::getLoader();
|
||||
|
|
14
vendor/composer/autoload_real.php
vendored
14
vendor/composer/autoload_real.php
vendored
|
@ -2,7 +2,7 @@
|
|||
|
||||
// autoload_real.php @generated by Composer
|
||||
|
||||
class ComposerAutoloaderInit245cf1c212a743105f238cffe6695d2e
|
||||
class ComposerAutoloaderInit1944a655981f1ebe826ad68bf0e4dfb6
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
|
@ -22,15 +22,15 @@ class ComposerAutoloaderInit245cf1c212a743105f238cffe6695d2e
|
|||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInit245cf1c212a743105f238cffe6695d2e', 'loadClassLoader'), true, true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInit1944a655981f1ebe826ad68bf0e4dfb6', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit245cf1c212a743105f238cffe6695d2e', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit1944a655981f1ebe826ad68bf0e4dfb6', '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\ComposerStaticInit245cf1c212a743105f238cffe6695d2e::getInitializer($loader));
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit1944a655981f1ebe826ad68bf0e4dfb6::getInitializer($loader));
|
||||
} else {
|
||||
$classMap = require __DIR__ . '/autoload_classmap.php';
|
||||
if ($classMap) {
|
||||
|
@ -42,19 +42,19 @@ class ComposerAutoloaderInit245cf1c212a743105f238cffe6695d2e
|
|||
$loader->register(true);
|
||||
|
||||
if ($useStaticLoader) {
|
||||
$includeFiles = Composer\Autoload\ComposerStaticInit245cf1c212a743105f238cffe6695d2e::$files;
|
||||
$includeFiles = Composer\Autoload\ComposerStaticInit1944a655981f1ebe826ad68bf0e4dfb6::$files;
|
||||
} else {
|
||||
$includeFiles = require __DIR__ . '/autoload_files.php';
|
||||
}
|
||||
foreach ($includeFiles as $fileIdentifier => $file) {
|
||||
composerRequire245cf1c212a743105f238cffe6695d2e($fileIdentifier, $file);
|
||||
composerRequire1944a655981f1ebe826ad68bf0e4dfb6($fileIdentifier, $file);
|
||||
}
|
||||
|
||||
return $loader;
|
||||
}
|
||||
}
|
||||
|
||||
function composerRequire245cf1c212a743105f238cffe6695d2e($fileIdentifier, $file)
|
||||
function composerRequire1944a655981f1ebe826ad68bf0e4dfb6($fileIdentifier, $file)
|
||||
{
|
||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||
require $file;
|
||||
|
|
8
vendor/composer/autoload_static.php
vendored
8
vendor/composer/autoload_static.php
vendored
|
@ -4,7 +4,7 @@
|
|||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
class ComposerStaticInit245cf1c212a743105f238cffe6695d2e
|
||||
class ComposerStaticInit1944a655981f1ebe826ad68bf0e4dfb6
|
||||
{
|
||||
public static $files = array (
|
||||
'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php',
|
||||
|
@ -3798,9 +3798,9 @@ class ComposerStaticInit245cf1c212a743105f238cffe6695d2e
|
|||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit245cf1c212a743105f238cffe6695d2e::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit245cf1c212a743105f238cffe6695d2e::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit245cf1c212a743105f238cffe6695d2e::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit1944a655981f1ebe826ad68bf0e4dfb6::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit1944a655981f1ebe826ad68bf0e4dfb6::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit1944a655981f1ebe826ad68bf0e4dfb6::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
|
10
vendor/scoper-autoload.php
vendored
10
vendor/scoper-autoload.php
vendored
|
@ -12,8 +12,8 @@ if (!class_exists('GenerateChangelogCommand', false) && !interface_exists('Gener
|
|||
if (!class_exists('AutoloadIncluder', false) && !interface_exists('AutoloadIncluder', false) && !trait_exists('AutoloadIncluder', false)) {
|
||||
spl_autoload_call('RectorPrefix20211205\AutoloadIncluder');
|
||||
}
|
||||
if (!class_exists('ComposerAutoloaderInit245cf1c212a743105f238cffe6695d2e', false) && !interface_exists('ComposerAutoloaderInit245cf1c212a743105f238cffe6695d2e', false) && !trait_exists('ComposerAutoloaderInit245cf1c212a743105f238cffe6695d2e', false)) {
|
||||
spl_autoload_call('RectorPrefix20211205\ComposerAutoloaderInit245cf1c212a743105f238cffe6695d2e');
|
||||
if (!class_exists('ComposerAutoloaderInit1944a655981f1ebe826ad68bf0e4dfb6', false) && !interface_exists('ComposerAutoloaderInit1944a655981f1ebe826ad68bf0e4dfb6', false) && !trait_exists('ComposerAutoloaderInit1944a655981f1ebe826ad68bf0e4dfb6', false)) {
|
||||
spl_autoload_call('RectorPrefix20211205\ComposerAutoloaderInit1944a655981f1ebe826ad68bf0e4dfb6');
|
||||
}
|
||||
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('RectorPrefix20211205\Helmich\TypoScriptParser\Parser\AST\Statement');
|
||||
|
@ -81,9 +81,9 @@ if (!function_exists('print_node')) {
|
|||
return \RectorPrefix20211205\print_node(...func_get_args());
|
||||
}
|
||||
}
|
||||
if (!function_exists('composerRequire245cf1c212a743105f238cffe6695d2e')) {
|
||||
function composerRequire245cf1c212a743105f238cffe6695d2e() {
|
||||
return \RectorPrefix20211205\composerRequire245cf1c212a743105f238cffe6695d2e(...func_get_args());
|
||||
if (!function_exists('composerRequire1944a655981f1ebe826ad68bf0e4dfb6')) {
|
||||
function composerRequire1944a655981f1ebe826ad68bf0e4dfb6() {
|
||||
return \RectorPrefix20211205\composerRequire1944a655981f1ebe826ad68bf0e4dfb6(...func_get_args());
|
||||
}
|
||||
}
|
||||
if (!function_exists('scanPath')) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user