Updated Rector to commit 5f4653c9f6

5f4653c9f6 Move DowngradeSelfTypeDeclarationRector to downgrade-php70 (#623)
This commit is contained in:
Tomas Votruba 2021-08-08 20:04:42 +00:00
parent 1f913af9d4
commit 4c5b41a7fe
10 changed files with 64 additions and 48 deletions

View File

@ -5,6 +5,7 @@ namespace RectorPrefix20210808;
use Rector\Core\Configuration\Option;
use Rector\Core\ValueObject\PhpVersion;
use Rector\DowngradePhp70\Rector\ClassMethod\DowngradeSelfTypeDeclarationRector;
use Rector\DowngradePhp70\Rector\Coalesce\DowngradeNullCoalesceRector;
use Rector\DowngradePhp70\Rector\Declare_\DowngradeStrictTypeDeclarationRector;
use Rector\DowngradePhp70\Rector\Expression\DowngradeDefineArrayConstantRector;
@ -21,6 +22,7 @@ return static function (\Symfony\Component\DependencyInjection\Loader\Configurat
$services = $containerConfigurator->services();
$services->set(\Rector\DowngradePhp70\Rector\FunctionLike\DowngradeScalarTypeDeclarationRector::class);
$services->set(\Rector\DowngradePhp70\Rector\Declare_\DowngradeStrictTypeDeclarationRector::class);
$services->set(\Rector\DowngradePhp70\Rector\ClassMethod\DowngradeSelfTypeDeclarationRector::class);
$services->set(\Rector\DowngradePhp70\Rector\New_\DowngradeAnonymousClassRector::class);
$services->set(\Rector\DowngradePhp70\Rector\Coalesce\DowngradeNullCoalesceRector::class);
$services->set(\Rector\DowngradePhp70\Rector\Spaceship\DowngradeSpaceshipRector::class);

View File

@ -9,7 +9,6 @@ use Rector\DowngradePhp74\Rector\Array_\DowngradeArraySpreadRector;
use Rector\DowngradePhp74\Rector\ArrowFunction\ArrowFunctionToAnonymousFunctionRector;
use Rector\DowngradePhp74\Rector\ClassMethod\DowngradeContravariantArgumentTypeRector;
use Rector\DowngradePhp74\Rector\ClassMethod\DowngradeCovariantReturnTypeRector;
use Rector\DowngradePhp74\Rector\ClassMethod\DowngradeSelfTypeDeclarationRector;
use Rector\DowngradePhp74\Rector\Coalesce\DowngradeNullCoalescingOperatorRector;
use Rector\DowngradePhp74\Rector\FuncCall\DowngradeArrayMergeCallWithoutArgumentsRector;
use Rector\DowngradePhp74\Rector\FuncCall\DowngradeStripTagsCallWithArrayRector;
@ -31,5 +30,4 @@ return static function (\Symfony\Component\DependencyInjection\Loader\Configurat
$services->set(\Rector\DowngradePhp74\Rector\Array_\DowngradeArraySpreadRector::class);
$services->set(\Rector\DowngradePhp74\Rector\FuncCall\DowngradeArrayMergeCallWithoutArgumentsRector::class);
$services->set(\Rector\DowngradePhp74\Rector\Identical\DowngradeFreadFwriteFalsyToNegationRector::class);
$services->set(\Rector\DowngradePhp74\Rector\ClassMethod\DowngradeSelfTypeDeclarationRector::class);
};

View File

@ -1,4 +1,4 @@
# 474 Rules Overview
# 475 Rules Overview
<br>
@ -24,7 +24,7 @@
- [DowngradePhp53](#downgradephp53) (1)
- [DowngradePhp70](#downgradephp70) (9)
- [DowngradePhp70](#downgradephp70) (10)
- [DowngradePhp71](#downgradephp71) (9)
@ -32,9 +32,9 @@
- [DowngradePhp73](#downgradephp73) (6)
- [DowngradePhp74](#downgradephp74) (11)
- [DowngradePhp74](#downgradephp74) (10)
- [DowngradePhp80](#downgradephp80) (17)
- [DowngradePhp80](#downgradephp80) (18)
- [DowngradePhp81](#downgradephp81) (1)
@ -4333,6 +4333,25 @@ Remove the type params and return type, add `@param` and `@return` tags instead
<br>
### DowngradeSelfTypeDeclarationRector
Remove "self" return type, add a `"@return` self" tag instead
- class: [`Rector\DowngradePhp70\Rector\ClassMethod\DowngradeSelfTypeDeclarationRector`](../rules/DowngradePhp70/Rector/ClassMethod/DowngradeSelfTypeDeclarationRector.php)
```diff
class SomeClass
{
- public function foo(): self
+ public function foo()
{
return $this;
}
}
```
<br>
### DowngradeSessionStartArrayOptionsRector
Move array option of session_start($options) to before statement's `ini_set()`
@ -5014,25 +5033,6 @@ Remove "_" as thousands separator in numbers
<br>
### DowngradeSelfTypeDeclarationRector
Remove "self" return type, add a `"@return` self" tag instead
- class: [`Rector\DowngradePhp74\Rector\ClassMethod\DowngradeSelfTypeDeclarationRector`](../rules/DowngradePhp74/Rector/ClassMethod/DowngradeSelfTypeDeclarationRector.php)
```diff
class SomeClass
{
- public function foo(): self
+ public function foo()
{
return $this;
}
}
```
<br>
### DowngradeStripTagsCallWithArrayRector
Convert 2nd param to `strip_tags` from array to string
@ -5084,6 +5084,22 @@ Changes property type definition from type definitions to `@var` annotations.
## DowngradePhp80
### DowngradeAbstractPrivateMethodInTraitRector
Remove "abstract" from private methods in traits and adds an empty function body
- class: [`Rector\DowngradePhp80\Rector\ClassMethod\DowngradeAbstractPrivateMethodInTraitRector`](../rules/DowngradePhp80/Rector/ClassMethod/DowngradeAbstractPrivateMethodInTraitRector.php)
```diff
trait SomeTrait
{
- abstract private function someAbstractPrivateFunction();
+ private function someAbstractPrivateFunction() {}
}
```
<br>
### DowngradeAttributeToAnnotationRector
Refactor PHP attribute markers to annotations notation

View File

@ -1,7 +1,7 @@
<?php
declare (strict_types=1);
namespace Rector\DowngradePhp74\Rector\ClassMethod;
namespace Rector\DowngradePhp70\Rector\ClassMethod;
use PhpParser\Node;
use PhpParser\Node\Stmt\ClassMethod;
@ -14,7 +14,7 @@ use Rector\NodeTypeResolver\Node\AttributeKey;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
/**
* @see \Rector\Tests\DowngradePhp74\Rector\ClassMethod\DowngradeSelfTypeDeclarationRector\DowngradeSelfTypeDeclarationRectorTest
* @see \Rector\Tests\DowngradePhp70\Rector\ClassMethod\DowngradeSelfTypeDeclarationRector\DowngradeSelfTypeDeclarationRectorTest
*/
final class DowngradeSelfTypeDeclarationRector extends \Rector\Core\Rector\AbstractRector
{

View File

@ -16,11 +16,11 @@ final class VersionResolver
/**
* @var string
*/
public const PACKAGE_VERSION = 'b6f1b7d9f03a764867618a6e408e7c60a2ba80d0';
public const PACKAGE_VERSION = '5f4653c9f68bd0801930e204ee216af256670ec7';
/**
* @var string
*/
public const RELEASE_DATE = '2021-08-08 21:38:55';
public const RELEASE_DATE = '2021-08-08 21:53:24';
public static function resolvePackageVersion() : string
{
$process = new \RectorPrefix20210808\Symfony\Component\Process\Process(['git', 'log', '--pretty="%H"', '-n1', 'HEAD'], __DIR__);

2
vendor/autoload.php vendored
View File

@ -4,4 +4,4 @@
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInit5263c070cdb8afe2ea70078714eddf6c::getLoader();
return ComposerAutoloaderInit89adf417ed66cf1cfdaea05540290f65::getLoader();

View File

@ -2114,6 +2114,7 @@ return array(
'Rector\\Doctrine\\ValueObject\\PropertyNamesAndPhpDocInfos' => $vendorDir . '/rector/rector-doctrine/src/ValueObject/PropertyNamesAndPhpDocInfos.php',
'Rector\\DowngradePhp53\\Rector\\Dir\\DirConstToFileConstRector' => $baseDir . '/rules/DowngradePhp53/Rector/Dir/DirConstToFileConstRector.php',
'Rector\\DowngradePhp70\\NodeFactory\\ClassFromAnonymousFactory' => $baseDir . '/rules/DowngradePhp70/NodeFactory/ClassFromAnonymousFactory.php',
'Rector\\DowngradePhp70\\Rector\\ClassMethod\\DowngradeSelfTypeDeclarationRector' => $baseDir . '/rules/DowngradePhp70/Rector/ClassMethod/DowngradeSelfTypeDeclarationRector.php',
'Rector\\DowngradePhp70\\Rector\\Coalesce\\DowngradeNullCoalesceRector' => $baseDir . '/rules/DowngradePhp70/Rector/Coalesce/DowngradeNullCoalesceRector.php',
'Rector\\DowngradePhp70\\Rector\\Declare_\\DowngradeStrictTypeDeclarationRector' => $baseDir . '/rules/DowngradePhp70/Rector/Declare_/DowngradeStrictTypeDeclarationRector.php',
'Rector\\DowngradePhp70\\Rector\\Expression\\DowngradeDefineArrayConstantRector' => $baseDir . '/rules/DowngradePhp70/Rector/Expression/DowngradeDefineArrayConstantRector.php',
@ -2151,7 +2152,6 @@ return array(
'Rector\\DowngradePhp74\\Rector\\ArrowFunction\\ArrowFunctionToAnonymousFunctionRector' => $baseDir . '/rules/DowngradePhp74/Rector/ArrowFunction/ArrowFunctionToAnonymousFunctionRector.php',
'Rector\\DowngradePhp74\\Rector\\ClassMethod\\DowngradeContravariantArgumentTypeRector' => $baseDir . '/rules/DowngradePhp74/Rector/ClassMethod/DowngradeContravariantArgumentTypeRector.php',
'Rector\\DowngradePhp74\\Rector\\ClassMethod\\DowngradeCovariantReturnTypeRector' => $baseDir . '/rules/DowngradePhp74/Rector/ClassMethod/DowngradeCovariantReturnTypeRector.php',
'Rector\\DowngradePhp74\\Rector\\ClassMethod\\DowngradeSelfTypeDeclarationRector' => $baseDir . '/rules/DowngradePhp74/Rector/ClassMethod/DowngradeSelfTypeDeclarationRector.php',
'Rector\\DowngradePhp74\\Rector\\Coalesce\\DowngradeNullCoalescingOperatorRector' => $baseDir . '/rules/DowngradePhp74/Rector/Coalesce/DowngradeNullCoalescingOperatorRector.php',
'Rector\\DowngradePhp74\\Rector\\FuncCall\\DowngradeArrayMergeCallWithoutArgumentsRector' => $baseDir . '/rules/DowngradePhp74/Rector/FuncCall/DowngradeArrayMergeCallWithoutArgumentsRector.php',
'Rector\\DowngradePhp74\\Rector\\FuncCall\\DowngradeStripTagsCallWithArrayRector' => $baseDir . '/rules/DowngradePhp74/Rector/FuncCall/DowngradeStripTagsCallWithArrayRector.php',

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit5263c070cdb8afe2ea70078714eddf6c
class ComposerAutoloaderInit89adf417ed66cf1cfdaea05540290f65
{
private static $loader;
@ -22,15 +22,15 @@ class ComposerAutoloaderInit5263c070cdb8afe2ea70078714eddf6c
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit5263c070cdb8afe2ea70078714eddf6c', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit89adf417ed66cf1cfdaea05540290f65', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
spl_autoload_unregister(array('ComposerAutoloaderInit5263c070cdb8afe2ea70078714eddf6c', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit89adf417ed66cf1cfdaea05540290f65', '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\ComposerStaticInit5263c070cdb8afe2ea70078714eddf6c::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit89adf417ed66cf1cfdaea05540290f65::getInitializer($loader));
} else {
$classMap = require __DIR__ . '/autoload_classmap.php';
if ($classMap) {
@ -42,19 +42,19 @@ class ComposerAutoloaderInit5263c070cdb8afe2ea70078714eddf6c
$loader->register(true);
if ($useStaticLoader) {
$includeFiles = Composer\Autoload\ComposerStaticInit5263c070cdb8afe2ea70078714eddf6c::$files;
$includeFiles = Composer\Autoload\ComposerStaticInit89adf417ed66cf1cfdaea05540290f65::$files;
} else {
$includeFiles = require __DIR__ . '/autoload_files.php';
}
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequire5263c070cdb8afe2ea70078714eddf6c($fileIdentifier, $file);
composerRequire89adf417ed66cf1cfdaea05540290f65($fileIdentifier, $file);
}
return $loader;
}
}
function composerRequire5263c070cdb8afe2ea70078714eddf6c($fileIdentifier, $file)
function composerRequire89adf417ed66cf1cfdaea05540290f65($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
require $file;

View File

@ -4,7 +4,7 @@
namespace Composer\Autoload;
class ComposerStaticInit5263c070cdb8afe2ea70078714eddf6c
class ComposerStaticInit89adf417ed66cf1cfdaea05540290f65
{
public static $files = array (
'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php',
@ -2474,6 +2474,7 @@ class ComposerStaticInit5263c070cdb8afe2ea70078714eddf6c
'Rector\\Doctrine\\ValueObject\\PropertyNamesAndPhpDocInfos' => __DIR__ . '/..' . '/rector/rector-doctrine/src/ValueObject/PropertyNamesAndPhpDocInfos.php',
'Rector\\DowngradePhp53\\Rector\\Dir\\DirConstToFileConstRector' => __DIR__ . '/../..' . '/rules/DowngradePhp53/Rector/Dir/DirConstToFileConstRector.php',
'Rector\\DowngradePhp70\\NodeFactory\\ClassFromAnonymousFactory' => __DIR__ . '/../..' . '/rules/DowngradePhp70/NodeFactory/ClassFromAnonymousFactory.php',
'Rector\\DowngradePhp70\\Rector\\ClassMethod\\DowngradeSelfTypeDeclarationRector' => __DIR__ . '/../..' . '/rules/DowngradePhp70/Rector/ClassMethod/DowngradeSelfTypeDeclarationRector.php',
'Rector\\DowngradePhp70\\Rector\\Coalesce\\DowngradeNullCoalesceRector' => __DIR__ . '/../..' . '/rules/DowngradePhp70/Rector/Coalesce/DowngradeNullCoalesceRector.php',
'Rector\\DowngradePhp70\\Rector\\Declare_\\DowngradeStrictTypeDeclarationRector' => __DIR__ . '/../..' . '/rules/DowngradePhp70/Rector/Declare_/DowngradeStrictTypeDeclarationRector.php',
'Rector\\DowngradePhp70\\Rector\\Expression\\DowngradeDefineArrayConstantRector' => __DIR__ . '/../..' . '/rules/DowngradePhp70/Rector/Expression/DowngradeDefineArrayConstantRector.php',
@ -2511,7 +2512,6 @@ class ComposerStaticInit5263c070cdb8afe2ea70078714eddf6c
'Rector\\DowngradePhp74\\Rector\\ArrowFunction\\ArrowFunctionToAnonymousFunctionRector' => __DIR__ . '/../..' . '/rules/DowngradePhp74/Rector/ArrowFunction/ArrowFunctionToAnonymousFunctionRector.php',
'Rector\\DowngradePhp74\\Rector\\ClassMethod\\DowngradeContravariantArgumentTypeRector' => __DIR__ . '/../..' . '/rules/DowngradePhp74/Rector/ClassMethod/DowngradeContravariantArgumentTypeRector.php',
'Rector\\DowngradePhp74\\Rector\\ClassMethod\\DowngradeCovariantReturnTypeRector' => __DIR__ . '/../..' . '/rules/DowngradePhp74/Rector/ClassMethod/DowngradeCovariantReturnTypeRector.php',
'Rector\\DowngradePhp74\\Rector\\ClassMethod\\DowngradeSelfTypeDeclarationRector' => __DIR__ . '/../..' . '/rules/DowngradePhp74/Rector/ClassMethod/DowngradeSelfTypeDeclarationRector.php',
'Rector\\DowngradePhp74\\Rector\\Coalesce\\DowngradeNullCoalescingOperatorRector' => __DIR__ . '/../..' . '/rules/DowngradePhp74/Rector/Coalesce/DowngradeNullCoalescingOperatorRector.php',
'Rector\\DowngradePhp74\\Rector\\FuncCall\\DowngradeArrayMergeCallWithoutArgumentsRector' => __DIR__ . '/../..' . '/rules/DowngradePhp74/Rector/FuncCall/DowngradeArrayMergeCallWithoutArgumentsRector.php',
'Rector\\DowngradePhp74\\Rector\\FuncCall\\DowngradeStripTagsCallWithArrayRector' => __DIR__ . '/../..' . '/rules/DowngradePhp74/Rector/FuncCall/DowngradeStripTagsCallWithArrayRector.php',
@ -3847,9 +3847,9 @@ class ComposerStaticInit5263c070cdb8afe2ea70078714eddf6c
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit5263c070cdb8afe2ea70078714eddf6c::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit5263c070cdb8afe2ea70078714eddf6c::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit5263c070cdb8afe2ea70078714eddf6c::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInit89adf417ed66cf1cfdaea05540290f65::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit89adf417ed66cf1cfdaea05540290f65::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit89adf417ed66cf1cfdaea05540290f65::$classMap;
}, null, ClassLoader::class);
}

View File

@ -9,8 +9,8 @@ $loader = require_once __DIR__.'/autoload.php';
if (!class_exists('AutoloadIncluder', false) && !interface_exists('AutoloadIncluder', false) && !trait_exists('AutoloadIncluder', false)) {
spl_autoload_call('RectorPrefix20210808\AutoloadIncluder');
}
if (!class_exists('ComposerAutoloaderInit5263c070cdb8afe2ea70078714eddf6c', false) && !interface_exists('ComposerAutoloaderInit5263c070cdb8afe2ea70078714eddf6c', false) && !trait_exists('ComposerAutoloaderInit5263c070cdb8afe2ea70078714eddf6c', false)) {
spl_autoload_call('RectorPrefix20210808\ComposerAutoloaderInit5263c070cdb8afe2ea70078714eddf6c');
if (!class_exists('ComposerAutoloaderInit89adf417ed66cf1cfdaea05540290f65', false) && !interface_exists('ComposerAutoloaderInit89adf417ed66cf1cfdaea05540290f65', false) && !trait_exists('ComposerAutoloaderInit89adf417ed66cf1cfdaea05540290f65', false)) {
spl_autoload_call('RectorPrefix20210808\ComposerAutoloaderInit89adf417ed66cf1cfdaea05540290f65');
}
if (!class_exists('AjaxLogin', false) && !interface_exists('AjaxLogin', false) && !trait_exists('AjaxLogin', false)) {
spl_autoload_call('RectorPrefix20210808\AjaxLogin');
@ -3305,9 +3305,9 @@ if (!function_exists('print_node')) {
return \RectorPrefix20210808\print_node(...func_get_args());
}
}
if (!function_exists('composerRequire5263c070cdb8afe2ea70078714eddf6c')) {
function composerRequire5263c070cdb8afe2ea70078714eddf6c() {
return \RectorPrefix20210808\composerRequire5263c070cdb8afe2ea70078714eddf6c(...func_get_args());
if (!function_exists('composerRequire89adf417ed66cf1cfdaea05540290f65')) {
function composerRequire89adf417ed66cf1cfdaea05540290f65() {
return \RectorPrefix20210808\composerRequire89adf417ed66cf1cfdaea05540290f65(...func_get_args());
}
}
if (!function_exists('parseArgs')) {