mirror of
https://github.com/rectorphp/rector.git
synced 2024-05-31 08:20:53 +00:00
[automated] Re-Generate Nodes/Rectors Documentation (#2314)
* [automated] Re-Generate Nodes/Rectors Documentation * use option 2 Co-authored-by: TomasVotruba <TomasVotruba@users.noreply.github.com> Co-authored-by: Abdul Malik Ikhsan <samsonasik@gmail.com>
This commit is contained in:
parent
1d75b53e97
commit
96400215b5
|
@ -1,4 +1,4 @@
|
|||
# 511 Rules Overview
|
||||
# 512 Rules Overview
|
||||
|
||||
<br>
|
||||
|
||||
|
@ -74,6 +74,8 @@
|
|||
|
||||
- [Php81](#php81) (9)
|
||||
|
||||
- [Php82](#php82) (1)
|
||||
|
||||
- [PostRector](#postrector) (6)
|
||||
|
||||
- [Privatization](#privatization) (10)
|
||||
|
@ -5880,17 +5882,11 @@ Replace array spread with string key to array_merge function
|
|||
- class: [`Rector\DowngradePhp81\Rector\Array_\DowngradeArraySpreadStringKeyRector`](../rules/DowngradePhp81/Rector/Array_/DowngradeArraySpreadStringKeyRector.php)
|
||||
|
||||
```diff
|
||||
class SomeClass
|
||||
{
|
||||
public function run()
|
||||
{
|
||||
$parts = ['a' => 'b'];
|
||||
$parts2 = ['c' => 'd'];
|
||||
$parts = ['a' => 'b'];
|
||||
$parts2 = ['c' => 'd'];
|
||||
|
||||
- $result = [...$parts, ...$parts2];
|
||||
+ $result = array_merge($parts, $parts2);
|
||||
}
|
||||
}
|
||||
-$result = [...$parts, ...$parts2];
|
||||
+$result = array_merge($parts, $parts2);
|
||||
```
|
||||
|
||||
<br>
|
||||
|
@ -8610,6 +8606,28 @@ Refactor Spatie enum class to native Enum
|
|||
|
||||
<br>
|
||||
|
||||
## Php82
|
||||
|
||||
### ReadOnlyClassRector
|
||||
|
||||
Decorate read-only class with `readonly` attribute
|
||||
|
||||
- class: [`Rector\Php82\Rector\Class_\ReadOnlyClassRector`](../rules/Php82/Rector/Class_/ReadOnlyClassRector.php)
|
||||
|
||||
```diff
|
||||
-final class SomeClass
|
||||
+final readonly class SomeClass
|
||||
{
|
||||
public function __construct(
|
||||
- private readonly string $name
|
||||
+ private string $name
|
||||
) {
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
<br>
|
||||
|
||||
## PostRector
|
||||
|
||||
### ClassRenamingPostRector
|
||||
|
|
18
phpstan.neon
18
phpstan.neon
|
@ -5,12 +5,26 @@ includes:
|
|||
- vendor/symplify/phpstan-rules/config/forbidden-static-rules.neon
|
||||
- vendor/symplify/phpstan-rules/config/naming-rules.neon
|
||||
- vendor/symplify/phpstan-rules/config/regex-rules.neon
|
||||
- vendor/symplify/phpstan-rules/config/services-rules.neon
|
||||
- vendor/symplify/phpstan-rules/config/static-rules.neon
|
||||
- vendor/symplify/phpstan-rules/config/string-to-constant-rules.neon
|
||||
- vendor/symplify/phpstan-rules/packages/symfony/config/symfony-rules.neon
|
||||
- vendor/symplify/phpstan-rules/config/test-rules.neon
|
||||
|
||||
services:
|
||||
-
|
||||
class: Symplify\PHPStanRules\Rules\Enum\RequireConstantInMethodCallPositionRule
|
||||
tags: [phpstan.rules.rule]
|
||||
arguments:
|
||||
requiredConstantInMethodCall:
|
||||
Symfony\Component\Console\Command\Command:
|
||||
addArgument: [0]
|
||||
addOption: [0]
|
||||
Symfony\Component\Console\Input\InputInterface:
|
||||
getOption: [0]
|
||||
getArgument: [0]
|
||||
PhpParser\Node:
|
||||
getAttribute: [0]
|
||||
setAttribute: [0]
|
||||
|
||||
parameters:
|
||||
level: 8
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user