Updated Rector to commit e87ee7e0b358fcbdb752bac8ec8b870dde54a7d3

e87ee7e0b3 Move LocallyCalledStaticMethodToNonStaticRector to CodeQuality namespace, to avoid dumping removed static set (#4242)
This commit is contained in:
Tomas Votruba 2023-06-16 14:09:13 +00:00
parent 8ae00bd588
commit 5a6b4888cf
8 changed files with 42 additions and 46 deletions

View File

@ -13,6 +13,7 @@ use Rector\CodeQuality\Rector\Class_\CompleteDynamicPropertiesRector;
use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
use Rector\CodeQuality\Rector\ClassConstFetch\ConvertStaticPrivateConstantToSelfRector;
use Rector\CodeQuality\Rector\ClassMethod\InlineArrayReturnAssignRector;
use Rector\CodeQuality\Rector\ClassMethod\LocallyCalledStaticMethodToNonStaticRector;
use Rector\CodeQuality\Rector\ClassMethod\OptionalParametersAfterRequiredRector;
use Rector\CodeQuality\Rector\ClassMethod\ReturnTypeFromStrictScalarReturnExprRector;
use Rector\CodeQuality\Rector\Concat\JoinStringConcatRector;
@ -80,7 +81,6 @@ use Rector\CodingStyle\Rector\FuncCall\CountArrayToEmptyArrayComparisonRector;
use Rector\Config\RectorConfig;
use Rector\Php52\Rector\Property\VarToPublicPropertyRector;
use Rector\Php71\Rector\FuncCall\RemoveExtraParametersRector;
use Rector\RemovingStatic\Rector\ClassMethod\LocallyCalledStaticMethodToNonStaticRector;
use Rector\Renaming\Rector\FuncCall\RenameFunctionRector;
use Rector\Strict\Rector\Empty_\DisallowedEmptyRuleFixerRector;
return static function (RectorConfig $rectorConfig) : void {

View File

@ -6,7 +6,7 @@
- [Arguments](#arguments) (5)
- [CodeQuality](#codequality) (71)
- [CodeQuality](#codequality) (72)
- [CodingStyle](#codingstyle) (32)
@ -50,8 +50,6 @@
- [Removing](#removing) (6)
- [RemovingStatic](#removingstatic) (1)
- [Renaming](#renaming) (10)
- [Strict](#strict) (5)
@ -928,6 +926,30 @@ Joins concat of 2 strings, unless the length is too long
<br>
### LocallyCalledStaticMethodToNonStaticRector
Change static method and local-only calls to non-static
- class: [`Rector\CodeQuality\Rector\ClassMethod\LocallyCalledStaticMethodToNonStaticRector`](../rules/CodeQuality/Rector/ClassMethod/LocallyCalledStaticMethodToNonStaticRector.php)
```diff
class SomeClass
{
public function run()
{
- self::someStatic();
+ $this->someStatic();
}
- private static function someStatic()
+ private function someStatic()
{
}
}
```
<br>
### LogicalToBooleanRector
Change OR, AND to ||, && with more common understanding
@ -6074,32 +6096,6 @@ return static function (RectorConfig $rectorConfig): void {
<br>
## RemovingStatic
### LocallyCalledStaticMethodToNonStaticRector
Change static method and local-only calls to non-static
- class: [`Rector\RemovingStatic\Rector\ClassMethod\LocallyCalledStaticMethodToNonStaticRector`](../rules/RemovingStatic/Rector/ClassMethod/LocallyCalledStaticMethodToNonStaticRector.php)
```diff
class SomeClass
{
public function run()
{
- self::someStatic();
+ $this->someStatic();
}
- private static function someStatic()
+ private function someStatic()
{
}
}
```
<br>
## Renaming
### PseudoNamespaceToNamespaceRector

View File

@ -1,7 +1,7 @@
<?php
declare (strict_types=1);
namespace Rector\RemovingStatic\Rector\ClassMethod;
namespace Rector\CodeQuality\Rector\ClassMethod;
use PhpParser\Node;
use PhpParser\Node\Expr\MethodCall;
@ -17,7 +17,7 @@ use Rector\Privatization\VisibilityGuard\ClassMethodVisibilityGuard;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
/**
* @see \Rector\Tests\RemovingStatic\Rector\ClassMethod\LocallyCalledStaticMethodToNonStaticRector\LocallyCalledStaticMethodToNonStaticRectorTest
* @see \Rector\Tests\CodeQuality\Rector\ClassMethod\LocallyCalledStaticMethodToNonStaticRector\LocallyCalledStaticMethodToNonStaticRectorTest
*/
final class LocallyCalledStaticMethodToNonStaticRector extends AbstractRector
{

View File

@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = 'a8339a34c179105fe8073266998abdc5479486dd';
public const PACKAGE_VERSION = 'e87ee7e0b358fcbdb752bac8ec8b870dde54a7d3';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2023-06-16 15:00:57';
public const RELEASE_DATE = '2023-06-16 15:04:42';
/**
* @var int
*/

2
vendor/autoload.php vendored
View File

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

View File

@ -1370,6 +1370,7 @@ return array(
'Rector\\CodeQuality\\Rector\\Catch_\\ThrowWithPreviousExceptionRector' => $baseDir . '/rules/CodeQuality/Rector/Catch_/ThrowWithPreviousExceptionRector.php',
'Rector\\CodeQuality\\Rector\\ClassConstFetch\\ConvertStaticPrivateConstantToSelfRector' => $baseDir . '/rules/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector.php',
'Rector\\CodeQuality\\Rector\\ClassMethod\\InlineArrayReturnAssignRector' => $baseDir . '/rules/CodeQuality/Rector/ClassMethod/InlineArrayReturnAssignRector.php',
'Rector\\CodeQuality\\Rector\\ClassMethod\\LocallyCalledStaticMethodToNonStaticRector' => $baseDir . '/rules/CodeQuality/Rector/ClassMethod/LocallyCalledStaticMethodToNonStaticRector.php',
'Rector\\CodeQuality\\Rector\\ClassMethod\\OptionalParametersAfterRequiredRector' => $baseDir . '/rules/CodeQuality/Rector/ClassMethod/OptionalParametersAfterRequiredRector.php',
'Rector\\CodeQuality\\Rector\\ClassMethod\\ReturnTypeFromStrictScalarReturnExprRector' => $baseDir . '/rules/CodeQuality/Rector/ClassMethod/ReturnTypeFromStrictScalarReturnExprRector.php',
'Rector\\CodeQuality\\Rector\\Class_\\CompleteDynamicPropertiesRector' => $baseDir . '/rules/CodeQuality/Rector/Class_/CompleteDynamicPropertiesRector.php',
@ -2412,7 +2413,6 @@ return array(
'Rector\\RectorInstaller\\LocalFilesystem' => $vendorDir . '/rector/extension-installer/src/LocalFilesystem.php',
'Rector\\RectorInstaller\\Plugin' => $vendorDir . '/rector/extension-installer/src/Plugin.php',
'Rector\\RectorInstaller\\PluginInstaller' => $vendorDir . '/rector/extension-installer/src/PluginInstaller.php',
'Rector\\RemovingStatic\\Rector\\ClassMethod\\LocallyCalledStaticMethodToNonStaticRector' => $baseDir . '/rules/RemovingStatic/Rector/ClassMethod/LocallyCalledStaticMethodToNonStaticRector.php',
'Rector\\Removing\\NodeManipulator\\ComplexNodeRemover' => $baseDir . '/rules/Removing/NodeManipulator/ComplexNodeRemover.php',
'Rector\\Removing\\Rector\\ClassMethod\\ArgumentRemoverRector' => $baseDir . '/rules/Removing/Rector/ClassMethod/ArgumentRemoverRector.php',
'Rector\\Removing\\Rector\\Class_\\RemoveInterfacesRector' => $baseDir . '/rules/Removing/Rector/Class_/RemoveInterfacesRector.php',

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit7cddc50cf9b5b4c496c72c09a638ee61
class ComposerAutoloaderInitb05cad95b9370307f3474d410cb5a407
{
private static $loader;
@ -22,17 +22,17 @@ class ComposerAutoloaderInit7cddc50cf9b5b4c496c72c09a638ee61
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit7cddc50cf9b5b4c496c72c09a638ee61', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInitb05cad95b9370307f3474d410cb5a407', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInit7cddc50cf9b5b4c496c72c09a638ee61', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInitb05cad95b9370307f3474d410cb5a407', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit7cddc50cf9b5b4c496c72c09a638ee61::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInitb05cad95b9370307f3474d410cb5a407::getInitializer($loader));
$loader->setClassMapAuthoritative(true);
$loader->register(true);
$filesToLoad = \Composer\Autoload\ComposerStaticInit7cddc50cf9b5b4c496c72c09a638ee61::$files;
$filesToLoad = \Composer\Autoload\ComposerStaticInitb05cad95b9370307f3474d410cb5a407::$files;
$requireFile = \Closure::bind(static function ($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 ComposerStaticInit7cddc50cf9b5b4c496c72c09a638ee61
class ComposerStaticInitb05cad95b9370307f3474d410cb5a407
{
public static $files = array (
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
@ -1621,6 +1621,7 @@ class ComposerStaticInit7cddc50cf9b5b4c496c72c09a638ee61
'Rector\\CodeQuality\\Rector\\Catch_\\ThrowWithPreviousExceptionRector' => __DIR__ . '/../..' . '/rules/CodeQuality/Rector/Catch_/ThrowWithPreviousExceptionRector.php',
'Rector\\CodeQuality\\Rector\\ClassConstFetch\\ConvertStaticPrivateConstantToSelfRector' => __DIR__ . '/../..' . '/rules/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector.php',
'Rector\\CodeQuality\\Rector\\ClassMethod\\InlineArrayReturnAssignRector' => __DIR__ . '/../..' . '/rules/CodeQuality/Rector/ClassMethod/InlineArrayReturnAssignRector.php',
'Rector\\CodeQuality\\Rector\\ClassMethod\\LocallyCalledStaticMethodToNonStaticRector' => __DIR__ . '/../..' . '/rules/CodeQuality/Rector/ClassMethod/LocallyCalledStaticMethodToNonStaticRector.php',
'Rector\\CodeQuality\\Rector\\ClassMethod\\OptionalParametersAfterRequiredRector' => __DIR__ . '/../..' . '/rules/CodeQuality/Rector/ClassMethod/OptionalParametersAfterRequiredRector.php',
'Rector\\CodeQuality\\Rector\\ClassMethod\\ReturnTypeFromStrictScalarReturnExprRector' => __DIR__ . '/../..' . '/rules/CodeQuality/Rector/ClassMethod/ReturnTypeFromStrictScalarReturnExprRector.php',
'Rector\\CodeQuality\\Rector\\Class_\\CompleteDynamicPropertiesRector' => __DIR__ . '/../..' . '/rules/CodeQuality/Rector/Class_/CompleteDynamicPropertiesRector.php',
@ -2663,7 +2664,6 @@ class ComposerStaticInit7cddc50cf9b5b4c496c72c09a638ee61
'Rector\\RectorInstaller\\LocalFilesystem' => __DIR__ . '/..' . '/rector/extension-installer/src/LocalFilesystem.php',
'Rector\\RectorInstaller\\Plugin' => __DIR__ . '/..' . '/rector/extension-installer/src/Plugin.php',
'Rector\\RectorInstaller\\PluginInstaller' => __DIR__ . '/..' . '/rector/extension-installer/src/PluginInstaller.php',
'Rector\\RemovingStatic\\Rector\\ClassMethod\\LocallyCalledStaticMethodToNonStaticRector' => __DIR__ . '/../..' . '/rules/RemovingStatic/Rector/ClassMethod/LocallyCalledStaticMethodToNonStaticRector.php',
'Rector\\Removing\\NodeManipulator\\ComplexNodeRemover' => __DIR__ . '/../..' . '/rules/Removing/NodeManipulator/ComplexNodeRemover.php',
'Rector\\Removing\\Rector\\ClassMethod\\ArgumentRemoverRector' => __DIR__ . '/../..' . '/rules/Removing/Rector/ClassMethod/ArgumentRemoverRector.php',
'Rector\\Removing\\Rector\\Class_\\RemoveInterfacesRector' => __DIR__ . '/../..' . '/rules/Removing/Rector/Class_/RemoveInterfacesRector.php',
@ -3092,9 +3092,9 @@ class ComposerStaticInit7cddc50cf9b5b4c496c72c09a638ee61
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit7cddc50cf9b5b4c496c72c09a638ee61::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit7cddc50cf9b5b4c496c72c09a638ee61::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit7cddc50cf9b5b4c496c72c09a638ee61::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInitb05cad95b9370307f3474d410cb5a407::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitb05cad95b9370307f3474d410cb5a407::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitb05cad95b9370307f3474d410cb5a407::$classMap;
}, null, ClassLoader::class);
}