mirror of
https://github.com/rectorphp/rector.git
synced 2024-05-31 00:10:51 +00:00
[automated] Re-Generate Nodes/Rectors Documentation (#5162)
Co-authored-by: kodiakhq <kodiakhq@users.noreply.github.com>
This commit is contained in:
parent
3840fb4135
commit
19c47b9f1f
|
@ -1757,7 +1757,7 @@ return $class;
|
|||
↓
|
||||
|
||||
```php
|
||||
final class ClassName extends ParentClass
|
||||
final class ClassName extends \ParentClass
|
||||
{
|
||||
}
|
||||
```
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user