Skip to content

Commit

Permalink
[automated] Re-Generate Nodes/Rectors Documentation (#3549)
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 Apr 2, 2023
1 parent 53f549d commit 1f8d359
Showing 1 changed file with 38 additions and 2 deletions.
40 changes: 38 additions & 2 deletions build/target-repository/docs/rector_rules_overview.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# 413 Rules Overview
# 414 Rules Overview

<br>

## Categories

- [Arguments](#arguments) (5)

- [CodeQuality](#codequality) (78)
- [CodeQuality](#codequality) (79)

- [CodingStyle](#codingstyle) (39)

Expand Down Expand Up @@ -1682,6 +1682,42 @@ Switch negated ternary condition rector

<br>

### SwitchTrueToIfRector

Change switch (true) to if statements

- class: [`Rector\CodeQuality\Rector\Switch_\SwitchTrueToIfRector`](../rules/CodeQuality/Rector/Switch_/SwitchTrueToIfRector.php)

```diff
class SomeClass
{
public function run()
{
- switch (true) {
- case $value === 0:
- return 'no';
- case $value === 1:
- return 'yes';
- case $value === 2:
- return 'maybe';
- };
+ if ($value === 0) {
+ return 'no';
+ }
+
+ if ($value === 1) {
+ return 'yes';
+ }
+
+ if ($value === 2) {
+ return 'maybe';
+ }
}
}
```

<br>

### TernaryEmptyArrayArrayDimFetchToCoalesceRector

Change ternary empty on array property with array dim fetch to coalesce operator
Expand Down

0 comments on commit 1f8d359

Please sign in to comment.