Skip to content

Commit

Permalink
[automated] Re-Generate Nodes/Rectors Documentation (#1050)
Browse files Browse the repository at this point in the history
Co-authored-by: TomasVotruba <TomasVotruba@users.noreply.github.com>
  • Loading branch information
TomasVotruba and TomasVotruba committed Oct 24, 2021
1 parent ec90557 commit 7f73cf0
Showing 1 changed file with 48 additions and 20 deletions.
68 changes: 48 additions & 20 deletions build/target-repository/docs/rector_rules_overview.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 483 Rules Overview
# 485 Rules Overview

<br>

Expand All @@ -24,6 +24,8 @@

- [DowngradePhp53](#downgradephp53) (1)

- [DowngradePhp54](#downgradephp54) (1)

- [DowngradePhp70](#downgradephp70) (11)

- [DowngradePhp71](#downgradephp71) (10)
Expand Down Expand Up @@ -96,7 +98,7 @@

- [Transform](#transform) (35)

- [TypeDeclaration](#typedeclaration) (20)
- [TypeDeclaration](#typedeclaration) (21)

- [Visibility](#visibility) (2)

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
{
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 7f73cf0

Please sign in to comment.