mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-03 18:00:50 +00:00
Updated Rector to commit 5c0397910fbd9735c375c4632ec116ebe8609f25
5c0397910f
Add missing rule doc (#5426)
This commit is contained in:
parent
350042dba4
commit
1daa932d00
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
- [CodingStyle](#codingstyle) (28)
|
- [CodingStyle](#codingstyle) (28)
|
||||||
|
|
||||||
- [DeadCode](#deadcode) (43)
|
- [DeadCode](#deadcode) (42)
|
||||||
|
|
||||||
- [EarlyReturn](#earlyreturn) (9)
|
- [EarlyReturn](#earlyreturn) (9)
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@
|
||||||
|
|
||||||
- [Php83](#php83) (3)
|
- [Php83](#php83) (3)
|
||||||
|
|
||||||
- [Privatization](#privatization) (4)
|
- [Privatization](#privatization) (5)
|
||||||
|
|
||||||
- [Removing](#removing) (5)
|
- [Removing](#removing) (5)
|
||||||
|
|
||||||
|
@ -2464,29 +2464,6 @@ Remove empty class methods not required by parents
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
### RemoveJustPropertyFetchForAssignRector
|
|
||||||
|
|
||||||
Remove assign of property, just for value assign
|
|
||||||
|
|
||||||
- class: [`Rector\DeadCode\Rector\StmtsAwareInterface\RemoveJustPropertyFetchForAssignRector`](../rules/DeadCode/Rector/StmtsAwareInterface/RemoveJustPropertyFetchForAssignRector.php)
|
|
||||||
|
|
||||||
```diff
|
|
||||||
class SomeClass
|
|
||||||
{
|
|
||||||
private $items = [];
|
|
||||||
|
|
||||||
public function run()
|
|
||||||
{
|
|
||||||
- $items = $this->items;
|
|
||||||
- $items[] = 1000;
|
|
||||||
- $this->items = $items ;
|
|
||||||
+ $this->items[] = 1000;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
<br>
|
|
||||||
|
|
||||||
### RemoveNonExistingVarAnnotationRector
|
### RemoveNonExistingVarAnnotationRector
|
||||||
|
|
||||||
Removes non-existing `@var` annotations above the code
|
Removes non-existing `@var` annotations above the code
|
||||||
|
@ -5327,6 +5304,25 @@ Combine separated host and port on `ldap_connect()` args
|
||||||
|
|
||||||
## Privatization
|
## Privatization
|
||||||
|
|
||||||
|
### FinalizeClassesWithoutChildrenCollectorRector
|
||||||
|
|
||||||
|
Finalize classes without children using collectors
|
||||||
|
|
||||||
|
- class: [`Rector\Privatization\Rector\Class_\FinalizeClassesWithoutChildrenCollectorRector`](../rules/Privatization/Rector/Class_/FinalizeClassesWithoutChildrenCollectorRector.php)
|
||||||
|
|
||||||
|
```diff
|
||||||
|
-class FirstClass extends SecondClass
|
||||||
|
+final class FirstClass extends SecondClass
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
class SecondClass
|
||||||
|
{
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
### FinalizeClassesWithoutChildrenRector
|
### FinalizeClassesWithoutChildrenRector
|
||||||
|
|
||||||
Finalize every class that has no children
|
Finalize every class that has no children
|
||||||
|
@ -5334,19 +5330,14 @@ Finalize every class that has no children
|
||||||
- class: [`Rector\Privatization\Rector\Class_\FinalizeClassesWithoutChildrenRector`](../rules/Privatization/Rector/Class_/FinalizeClassesWithoutChildrenRector.php)
|
- class: [`Rector\Privatization\Rector\Class_\FinalizeClassesWithoutChildrenRector`](../rules/Privatization/Rector/Class_/FinalizeClassesWithoutChildrenRector.php)
|
||||||
|
|
||||||
```diff
|
```diff
|
||||||
-class FirstClass
|
-class FirstClass extends SecondClass
|
||||||
+final class FirstClass
|
+final class FirstClass extends SecondClass
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
class SecondClass
|
class SecondClass
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
-class ThirdClass extends SecondClass
|
|
||||||
+final class ThirdClass extends SecondClass
|
|
||||||
{
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
|
@ -15,6 +15,7 @@ use Rector\NodeTypeResolver\Node\AttributeKey;
|
||||||
use Rector\Privatization\NodeManipulator\VisibilityManipulator;
|
use Rector\Privatization\NodeManipulator\VisibilityManipulator;
|
||||||
use Rector\Rector\AbstractCollectorRector;
|
use Rector\Rector\AbstractCollectorRector;
|
||||||
use Rector\Reflection\ReflectionResolver;
|
use Rector\Reflection\ReflectionResolver;
|
||||||
|
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
|
||||||
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
|
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
|
||||||
/**
|
/**
|
||||||
* @see \Rector\Tests\Privatization\Rector\Class_\FinalizeClassesWithoutChildrenCollectorRector\FinalizeClassesWithoutChildrenCollectorRectorTest
|
* @see \Rector\Tests\Privatization\Rector\Class_\FinalizeClassesWithoutChildrenCollectorRector\FinalizeClassesWithoutChildrenCollectorRectorTest
|
||||||
|
@ -87,7 +88,25 @@ final class FinalizeClassesWithoutChildrenCollectorRector extends AbstractCollec
|
||||||
}
|
}
|
||||||
public function getRuleDefinition() : RuleDefinition
|
public function getRuleDefinition() : RuleDefinition
|
||||||
{
|
{
|
||||||
return new RuleDefinition('...', []);
|
return new RuleDefinition('Finalize classes without children using collectors', [new CodeSample(<<<'CODE_SAMPLE'
|
||||||
|
class FirstClass extends SecondClass
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
class SecondClass
|
||||||
|
{
|
||||||
|
}
|
||||||
|
CODE_SAMPLE
|
||||||
|
, <<<'CODE_SAMPLE'
|
||||||
|
final class FirstClass extends SecondClass
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
class SecondClass
|
||||||
|
{
|
||||||
|
}
|
||||||
|
CODE_SAMPLE
|
||||||
|
)]);
|
||||||
}
|
}
|
||||||
private function shouldSkipClass(Class_ $class) : bool
|
private function shouldSkipClass(Class_ $class) : bool
|
||||||
{
|
{
|
||||||
|
|
|
@ -56,30 +56,22 @@ final class FinalizeClassesWithoutChildrenRector extends AbstractRector
|
||||||
public function getRuleDefinition() : RuleDefinition
|
public function getRuleDefinition() : RuleDefinition
|
||||||
{
|
{
|
||||||
return new RuleDefinition('Finalize every class that has no children', [new CodeSample(<<<'CODE_SAMPLE'
|
return new RuleDefinition('Finalize every class that has no children', [new CodeSample(<<<'CODE_SAMPLE'
|
||||||
class FirstClass
|
class FirstClass extends SecondClass
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
class SecondClass
|
class SecondClass
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
class ThirdClass extends SecondClass
|
|
||||||
{
|
|
||||||
}
|
|
||||||
CODE_SAMPLE
|
CODE_SAMPLE
|
||||||
, <<<'CODE_SAMPLE'
|
, <<<'CODE_SAMPLE'
|
||||||
final class FirstClass
|
final class FirstClass extends SecondClass
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
class SecondClass
|
class SecondClass
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
final class ThirdClass extends SecondClass
|
|
||||||
{
|
|
||||||
}
|
|
||||||
CODE_SAMPLE
|
CODE_SAMPLE
|
||||||
)]);
|
)]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,12 +19,12 @@ final class VersionResolver
|
||||||
* @api
|
* @api
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public const PACKAGE_VERSION = '9144efc05cf4d084d4af69f4df0be9d7a66e5869';
|
public const PACKAGE_VERSION = '5c0397910fbd9735c375c4632ec116ebe8609f25';
|
||||||
/**
|
/**
|
||||||
* @api
|
* @api
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public const RELEASE_DATE = '2024-01-02 20:41:33';
|
public const RELEASE_DATE = '2024-01-02 21:36:20';
|
||||||
/**
|
/**
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
|
|
2
vendor/autoload.php
vendored
2
vendor/autoload.php
vendored
|
@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) {
|
||||||
|
|
||||||
require_once __DIR__ . '/composer/autoload_real.php';
|
require_once __DIR__ . '/composer/autoload_real.php';
|
||||||
|
|
||||||
return ComposerAutoloaderInitbb976c8093699e6523d42b3a6d444634::getLoader();
|
return ComposerAutoloaderInit8c7215074e107c54fa988078cf9a09f8::getLoader();
|
||||||
|
|
10
vendor/composer/autoload_real.php
vendored
10
vendor/composer/autoload_real.php
vendored
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
// autoload_real.php @generated by Composer
|
// autoload_real.php @generated by Composer
|
||||||
|
|
||||||
class ComposerAutoloaderInitbb976c8093699e6523d42b3a6d444634
|
class ComposerAutoloaderInit8c7215074e107c54fa988078cf9a09f8
|
||||||
{
|
{
|
||||||
private static $loader;
|
private static $loader;
|
||||||
|
|
||||||
|
@ -22,17 +22,17 @@ class ComposerAutoloaderInitbb976c8093699e6523d42b3a6d444634
|
||||||
return self::$loader;
|
return self::$loader;
|
||||||
}
|
}
|
||||||
|
|
||||||
spl_autoload_register(array('ComposerAutoloaderInitbb976c8093699e6523d42b3a6d444634', 'loadClassLoader'), true, true);
|
spl_autoload_register(array('ComposerAutoloaderInit8c7215074e107c54fa988078cf9a09f8', 'loadClassLoader'), true, true);
|
||||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
||||||
spl_autoload_unregister(array('ComposerAutoloaderInitbb976c8093699e6523d42b3a6d444634', 'loadClassLoader'));
|
spl_autoload_unregister(array('ComposerAutoloaderInit8c7215074e107c54fa988078cf9a09f8', 'loadClassLoader'));
|
||||||
|
|
||||||
require __DIR__ . '/autoload_static.php';
|
require __DIR__ . '/autoload_static.php';
|
||||||
call_user_func(\Composer\Autoload\ComposerStaticInitbb976c8093699e6523d42b3a6d444634::getInitializer($loader));
|
call_user_func(\Composer\Autoload\ComposerStaticInit8c7215074e107c54fa988078cf9a09f8::getInitializer($loader));
|
||||||
|
|
||||||
$loader->setClassMapAuthoritative(true);
|
$loader->setClassMapAuthoritative(true);
|
||||||
$loader->register(true);
|
$loader->register(true);
|
||||||
|
|
||||||
$filesToLoad = \Composer\Autoload\ComposerStaticInitbb976c8093699e6523d42b3a6d444634::$files;
|
$filesToLoad = \Composer\Autoload\ComposerStaticInit8c7215074e107c54fa988078cf9a09f8::$files;
|
||||||
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
|
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
|
||||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||||
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
||||||
|
|
8
vendor/composer/autoload_static.php
vendored
8
vendor/composer/autoload_static.php
vendored
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
namespace Composer\Autoload;
|
namespace Composer\Autoload;
|
||||||
|
|
||||||
class ComposerStaticInitbb976c8093699e6523d42b3a6d444634
|
class ComposerStaticInit8c7215074e107c54fa988078cf9a09f8
|
||||||
{
|
{
|
||||||
public static $files = array (
|
public static $files = array (
|
||||||
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
|
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
|
||||||
|
@ -2644,9 +2644,9 @@ class ComposerStaticInitbb976c8093699e6523d42b3a6d444634
|
||||||
public static function getInitializer(ClassLoader $loader)
|
public static function getInitializer(ClassLoader $loader)
|
||||||
{
|
{
|
||||||
return \Closure::bind(function () use ($loader) {
|
return \Closure::bind(function () use ($loader) {
|
||||||
$loader->prefixLengthsPsr4 = ComposerStaticInitbb976c8093699e6523d42b3a6d444634::$prefixLengthsPsr4;
|
$loader->prefixLengthsPsr4 = ComposerStaticInit8c7215074e107c54fa988078cf9a09f8::$prefixLengthsPsr4;
|
||||||
$loader->prefixDirsPsr4 = ComposerStaticInitbb976c8093699e6523d42b3a6d444634::$prefixDirsPsr4;
|
$loader->prefixDirsPsr4 = ComposerStaticInit8c7215074e107c54fa988078cf9a09f8::$prefixDirsPsr4;
|
||||||
$loader->classMap = ComposerStaticInitbb976c8093699e6523d42b3a6d444634::$classMap;
|
$loader->classMap = ComposerStaticInit8c7215074e107c54fa988078cf9a09f8::$classMap;
|
||||||
|
|
||||||
}, null, ClassLoader::class);
|
}, null, ClassLoader::class);
|
||||||
}
|
}
|
||||||
|
|
2
vendor/scoper-autoload.php
vendored
2
vendor/scoper-autoload.php
vendored
|
@ -30,7 +30,7 @@ if (!function_exists('humbug_phpscoper_expose_class')) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
humbug_phpscoper_expose_class('AutoloadIncluder', 'RectorPrefix202401\AutoloadIncluder');
|
humbug_phpscoper_expose_class('AutoloadIncluder', 'RectorPrefix202401\AutoloadIncluder');
|
||||||
humbug_phpscoper_expose_class('ComposerAutoloaderInitbb976c8093699e6523d42b3a6d444634', 'RectorPrefix202401\ComposerAutoloaderInitbb976c8093699e6523d42b3a6d444634');
|
humbug_phpscoper_expose_class('ComposerAutoloaderInit8c7215074e107c54fa988078cf9a09f8', 'RectorPrefix202401\ComposerAutoloaderInit8c7215074e107c54fa988078cf9a09f8');
|
||||||
humbug_phpscoper_expose_class('Product', 'RectorPrefix202401\Product');
|
humbug_phpscoper_expose_class('Product', 'RectorPrefix202401\Product');
|
||||||
|
|
||||||
// Function aliases. For more information see:
|
// Function aliases. For more information see:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user