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

Co-authored-by: TomasVotruba <TomasVotruba@users.noreply.github.com>
This commit is contained in:
Tomas Votruba 2021-10-24 02:18:14 +02:00 committed by GitHub
parent ec905575c7
commit 7f73cf0172
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,4 @@
# 483 Rules Overview
# 485 Rules Overview
<br>
@ -24,6 +24,8 @@
- [DowngradePhp53](#downgradephp53) (1)
- [DowngradePhp54](#downgradephp54) (1)
- [DowngradePhp70](#downgradephp70) (11)
- [DowngradePhp71](#downgradephp71) (10)
@ -96,7 +98,7 @@
- [Transform](#transform) (35)
- [TypeDeclaration](#typedeclaration) (20)
- [TypeDeclaration](#typedeclaration) (21)
- [Visibility](#visibility) (2)
@ -4264,6 +4266,29 @@ Refactor __DIR__ to dirname(__FILE__)
<br>
## DowngradePhp54
### DowngradeStaticClosureRector
Remove static from closure
- class: [`Rector\DowngradePhp54\Rector\Closure\DowngradeStaticClosureRector`](../rules/DowngradePhp54/Rector/Closure/DowngradeStaticClosureRector.php)
```diff
final class SomeClass
{
public function run()
{
- return static function () {
+ return function () {
return true;
};
}
}
```
<br>
## DowngradePhp70
### DowngradeAnonymousClassRector
@ -11537,26 +11562,8 @@ Add known return type to functions
Change param type to strict type of passed expression
:wrench: **configure it!**
- class: [`Rector\TypeDeclaration\Rector\ClassMethod\AddMethodCallBasedStrictParamTypeRector`](../rules/TypeDeclaration/Rector/ClassMethod/AddMethodCallBasedStrictParamTypeRector.php)
```php
use Rector\TypeDeclaration\Rector\ClassMethod\AddMethodCallBasedStrictParamTypeRector;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
return static function (ContainerConfigurator $containerConfigurator): void {
$services = $containerConfigurator->services();
$services->set(AddMethodCallBasedStrictParamTypeRector::class)
->call('configure', [[
AddMethodCallBasedStrictParamTypeRector::TRUST_DOC_BLOCKS => false,
]]);
};
```
```diff
class SomeClass
{
@ -12017,6 +12024,27 @@ Add typed properties based only on strict constructor types
<br>
### TypedPropertyFromStrictGetterMethodReturnTypeRector
Complete property type based on getter strict types
- class: [`Rector\TypeDeclaration\Rector\Property\TypedPropertyFromStrictGetterMethodReturnTypeRector`](../rules/TypeDeclaration/Rector/Property/TypedPropertyFromStrictGetterMethodReturnTypeRector.php)
```diff
final class SomeClass
{
- public $name;
+ public ?string $name;
public function getName(): string|null
{
return $this->name;
}
}
```
<br>
## Visibility
### ChangeConstantVisibilityRector