mirror of
https://github.com/rectorphp/rector.git
synced 2024-05-28 23:10:51 +00:00
[automated] Re-Generate Nodes/Rectors Documentation (#683)
* [automated] Re-Generate Nodes/Rectors Documentation * [ci-review] Rector Rectify Co-authored-by: TomasVotruba <TomasVotruba@users.noreply.github.com> Co-authored-by: GitHub Action <action@github.com>
This commit is contained in:
parent
85e02fd6d0
commit
e9d1172717
|
@ -1,4 +1,4 @@
|
|||
# 475 Rules Overview
|
||||
# 476 Rules Overview
|
||||
|
||||
<br>
|
||||
|
||||
|
@ -74,7 +74,7 @@
|
|||
|
||||
- [Php80](#php80) (17)
|
||||
|
||||
- [Php81](#php81) (4)
|
||||
- [Php81](#php81) (5)
|
||||
|
||||
- [PhpSpecToPHPUnit](#phpspectophpunit) (7)
|
||||
|
||||
|
@ -8097,6 +8097,31 @@ Decorate read-only property with `readonly` attribute
|
|||
|
||||
<br>
|
||||
|
||||
### SpatieEnumClassToEnumRector
|
||||
|
||||
Refactor Spatie enum class to native Enum
|
||||
|
||||
- class: [`Rector\Php81\Rector\Class_\SpatieEnumClassToEnumRector`](../rules/Php81/Rector/Class_/SpatieEnumClassToEnumRector.php)
|
||||
|
||||
```diff
|
||||
-use \Spatie\Enum\Enum;
|
||||
-
|
||||
-/**
|
||||
- * @method static self draft()
|
||||
- * @method static self published()
|
||||
- * @method static self archived()
|
||||
- */
|
||||
-class StatusEnum extends Enum
|
||||
+enum StatusEnum
|
||||
{
|
||||
+ case draft = 'draft';
|
||||
+ case published = 'published';
|
||||
+ case archived = 'archived';
|
||||
}
|
||||
```
|
||||
|
||||
<br>
|
||||
|
||||
## PhpSpecToPHPUnit
|
||||
|
||||
### AddMockPropertiesRector
|
||||
|
|
|
@ -242,11 +242,7 @@ CODE_SAMPLE
|
|||
if (! property_exists($nextNode->expr, self::NAME)) {
|
||||
return false;
|
||||
}
|
||||
if ($this->valueResolver->isNull($nextNode->expr)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
return ! $this->valueResolver->isNull($nextNode->expr);
|
||||
}
|
||||
|
||||
private function processIfMayInNextNode(?Node $nextNode = null): ?Node
|
||||
|
|
Loading…
Reference in New Issue
Block a user