Skip to content

Commit

Permalink
[automated] Re-Generate Nodes/Rectors Documentation (#683)
Browse files Browse the repository at this point in the history
* [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>
  • Loading branch information
3 people committed Aug 15, 2021
1 parent 85e02fd commit e9d1172
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 7 deletions.
29 changes: 27 additions & 2 deletions build/target-repository/docs/rector_rules_overview.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 475 Rules Overview
# 476 Rules Overview

<br>

Expand Down Expand Up @@ -74,7 +74,7 @@

- [Php80](#php80) (17)

- [Php81](#php81) (4)
- [Php81](#php81) (5)

- [PhpSpecToPHPUnit](#phpspectophpunit) (7)

Expand Down Expand Up @@ -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
Expand Down
6 changes: 1 addition & 5 deletions rules/Php80/Rector/If_/NullsafeOperatorRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,11 +242,7 @@ private function shouldProcessAssignInCurrentNode(Assign $assign, Node $nextNode
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
Expand Down

0 comments on commit e9d1172

Please sign in to comment.