[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:
Tomas Votruba 2021-08-15 02:18:18 +02:00 committed by GitHub
parent 85e02fd6d0
commit e9d1172717
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 7 deletions

View File

@ -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

View File

@ -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