mirror of https://github.com/rectorphp/rector.git
[automated] Re-Generate Nodes/Rectors Documentation (#619)
Co-authored-by: TomasVotruba <TomasVotruba@users.noreply.github.com>
This commit is contained in:
parent
1ac0bf7dbe
commit
a8b01f217b
|
@ -1,4 +1,4 @@
|
||||||
# 475 Rules Overview
|
# 474 Rules Overview
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
|
@ -12,8 +12,6 @@
|
||||||
|
|
||||||
- [CodeQuality](#codequality) (68)
|
- [CodeQuality](#codequality) (68)
|
||||||
|
|
||||||
- [CodeQualityStrict](#codequalitystrict) (1)
|
|
||||||
|
|
||||||
- [CodingStyle](#codingstyle) (38)
|
- [CodingStyle](#codingstyle) (38)
|
||||||
|
|
||||||
- [Composer](#composer) (6)
|
- [Composer](#composer) (6)
|
||||||
|
@ -1813,24 +1811,6 @@ Use ===/!== over ==/!=, it values have the same type
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
## CodeQualityStrict
|
|
||||||
|
|
||||||
### MoveVariableDeclarationNearReferenceRector
|
|
||||||
|
|
||||||
Move variable declaration near its reference
|
|
||||||
|
|
||||||
- class: [`Rector\CodeQualityStrict\Rector\Variable\MoveVariableDeclarationNearReferenceRector`](../rules/CodeQualityStrict/Rector/Variable/MoveVariableDeclarationNearReferenceRector.php)
|
|
||||||
|
|
||||||
```diff
|
|
||||||
-$var = 1;
|
|
||||||
if ($condition === null) {
|
|
||||||
+ $var = 1;
|
|
||||||
return $var;
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
<br>
|
|
||||||
|
|
||||||
## CodingStyle
|
## CodingStyle
|
||||||
|
|
||||||
### AddArrayDefaultToArrayPropertyRector
|
### AddArrayDefaultToArrayPropertyRector
|
||||||
|
@ -2266,6 +2246,7 @@ Changes `$this->...` and static:: to self:: or vise versa for given types
|
||||||
- class: [`Rector\CodingStyle\Rector\MethodCall\PreferThisOrSelfMethodCallRector`](../rules/CodingStyle/Rector/MethodCall/PreferThisOrSelfMethodCallRector.php)
|
- class: [`Rector\CodingStyle\Rector\MethodCall\PreferThisOrSelfMethodCallRector`](../rules/CodingStyle/Rector/MethodCall/PreferThisOrSelfMethodCallRector.php)
|
||||||
|
|
||||||
```php
|
```php
|
||||||
|
use PHPUnit\Framework\TestCase;
|
||||||
use Rector\CodingStyle\Enum\PreferenceSelfThis;
|
use Rector\CodingStyle\Enum\PreferenceSelfThis;
|
||||||
use Rector\CodingStyle\Rector\MethodCall\PreferThisOrSelfMethodCallRector;
|
use Rector\CodingStyle\Rector\MethodCall\PreferThisOrSelfMethodCallRector;
|
||||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||||
|
@ -2276,10 +2257,10 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
||||||
|
|
||||||
$services->set(PreferThisOrSelfMethodCallRector::class)
|
$services->set(PreferThisOrSelfMethodCallRector::class)
|
||||||
->call('configure', [[
|
->call('configure', [[
|
||||||
PreferThisOrSelfMethodCallRector::TYPE_TO_PREFERENCE => ValueObjectInliner::inline([
|
PreferThisOrSelfMethodCallRector::TYPE_TO_PREFERENCE => [
|
||||||
PreferenceSelfThis::PREFER_SELF(),
|
TestCase::class => ValueObjectInliner::inline(PreferenceSelfThis::PREFER_SELF()),
|
||||||
]),
|
|
||||||
]]);
|
], ]]);
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -9321,7 +9302,6 @@ Replaces defined class constants in their calls.
|
||||||
```php
|
```php
|
||||||
use Rector\Renaming\Rector\ClassConstFetch\RenameClassConstFetchRector;
|
use Rector\Renaming\Rector\ClassConstFetch\RenameClassConstFetchRector;
|
||||||
use Rector\Renaming\ValueObject\RenameClassAndConstFetch;
|
use Rector\Renaming\ValueObject\RenameClassAndConstFetch;
|
||||||
use Rector\Renaming\ValueObject\RenameClassConstFetch;
|
|
||||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||||
use Symplify\SymfonyPhpConfig\ValueObjectInliner;
|
use Symplify\SymfonyPhpConfig\ValueObjectInliner;
|
||||||
|
|
||||||
|
@ -9331,7 +9311,6 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
||||||
$services->set(RenameClassConstFetchRector::class)
|
$services->set(RenameClassConstFetchRector::class)
|
||||||
->call('configure', [[
|
->call('configure', [[
|
||||||
RenameClassConstFetchRector::CLASS_CONSTANT_RENAME => ValueObjectInliner::inline([
|
RenameClassConstFetchRector::CLASS_CONSTANT_RENAME => ValueObjectInliner::inline([
|
||||||
new RenameClassConstFetch('SomeClass', 'OLD_CONSTANT', 'NEW_CONSTANT'),
|
|
||||||
new RenameClassAndConstFetch('SomeClass', 'OTHER_OLD_CONSTANT', 'DifferentClass', 'NEW_CONSTANT'),
|
new RenameClassAndConstFetch('SomeClass', 'OTHER_OLD_CONSTANT', 'DifferentClass', 'NEW_CONSTANT'),
|
||||||
]),
|
]),
|
||||||
]]);
|
]]);
|
||||||
|
@ -10062,7 +10041,6 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
||||||
$services->set(ClassConstFetchToValueRector::class)
|
$services->set(ClassConstFetchToValueRector::class)
|
||||||
->call('configure', [[
|
->call('configure', [[
|
||||||
ClassConstFetchToValueRector::CLASS_CONST_FETCHES_TO_VALUES => ValueObjectInliner::inline([
|
ClassConstFetchToValueRector::CLASS_CONST_FETCHES_TO_VALUES => ValueObjectInliner::inline([
|
||||||
new ClassConstFetchToValue('Nette\Configurator', 'DEVELOPMENT', 'development'),
|
|
||||||
new ClassConstFetchToValue('Nette\Configurator', 'PRODUCTION', 'production'),
|
new ClassConstFetchToValue('Nette\Configurator', 'PRODUCTION', 'production'),
|
||||||
]),
|
]),
|
||||||
]]);
|
]]);
|
||||||
|
@ -11642,7 +11620,7 @@ Change `@param` types to type declarations if not a BC-break
|
||||||
- class: [`Rector\TypeDeclaration\Rector\FunctionLike\ParamTypeDeclarationRector`](../rules/TypeDeclaration/Rector/FunctionLike/ParamTypeDeclarationRector.php)
|
- class: [`Rector\TypeDeclaration\Rector\FunctionLike\ParamTypeDeclarationRector`](../rules/TypeDeclaration/Rector/FunctionLike/ParamTypeDeclarationRector.php)
|
||||||
|
|
||||||
```diff
|
```diff
|
||||||
class ParentClass
|
abstract class VendorParentClass
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @param int $number
|
* @param int $number
|
||||||
|
@ -11652,7 +11630,7 @@ Change `@param` types to type declarations if not a BC-break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final class ChildClass extends ParentClass
|
final class ChildClass extends VendorParentClass
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @param int $number
|
* @param int $number
|
||||||
|
|
Loading…
Reference in New Issue