[automated] Re-Generate Nodes/Rectors Documentation (#5162)

Co-authored-by: kodiakhq <kodiakhq@users.noreply.github.com>
This commit is contained in:
github-actions[bot] 2021-01-13 02:25:45 +01:00 committed by GitHub
parent 3840fb4135
commit 19c47b9f1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 74 additions and 4 deletions

View File

@ -1757,7 +1757,7 @@ return $class;
```php
final class ClassName extends ParentClass
final class ClassName extends \ParentClass
{
}
```

View File

@ -1,4 +1,4 @@
# 658 Rules Overview
# 660 Rules Overview
<br>
@ -18,7 +18,7 @@
- [CodingStyle](#codingstyle) (37)
- [DeadCode](#deadcode) (43)
- [DeadCode](#deadcode) (44)
- [DeadDocBlock](#deaddocblock) (3)
@ -120,7 +120,7 @@
- [PostRector](#postrector) (7)
- [Privatization](#privatization) (13)
- [Privatization](#privatization) (14)
- [RectorGenerator](#rectorgenerator) (1)
@ -3583,6 +3583,35 @@ Remove unused private properties
<br>
### RemoveUnusedPublicMethodRector
Remove unused public method
- class: `Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPublicMethodRector`
```diff
class SomeClass
{
- public function unusedpublicMethod()
- {
- // ...
- }
-
public function execute()
{
// ...
}
public function run()
{
$obj = new self;
$obj->execute();
}
}
```
<br>
### RemoveUnusedVariableAssignRector
Remove unused assigns to variables
@ -13798,6 +13827,47 @@ Replace repeated strings with constant
<br>
### ReplaceStringWithClassConstantRector
Replace string values in specific method call by constant of provided class
:wrench: **configure it!**
- class: `Rector\Privatization\Rector\MethodCall\ReplaceStringWithClassConstantRector`
```php
use Rector\Privatization\Rector\MethodCall\ReplaceStringWithClassConstantRector;
use Rector\Privatization\ValueObject\ReplaceStringWithClassConstant;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Symplify\SymfonyPhpConfig\ValueObjectInliner;
return static function (ContainerConfigurator $containerConfigurator): void {
$services = $containerConfigurator->services();
$services->set(ReplaceStringWithClassConstantRector::class)
->call('configure', [[
ReplaceStringWithClassConstantRector::REPLACE_STRING_WITH_CLASS_CONSTANT => ValueObjectInliner::inline([
new ReplaceStringWithClassConstant('SomeClass', 'call', 'Placeholder', 1),
]),
]]);
};
```
```diff
class SomeClass
{
public function run()
{
- $this->call('name');
+ $this->call(Placeholder::NAME);
}
}
```
<br>
## RectorGenerator
### AddNewServiceToSymfonyPhpConfigRector