Skip to content

Commit

Permalink
[Php71] Code Sample fix on CountOnNullRector (#2761)
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Aug 13, 2022
1 parent 3c88742 commit 526091f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build/target-repository/docs/rector_rules_overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -5127,7 +5127,7 @@ Changes `count()` on null to safe ternary check
```diff
$values = null;
-$count = count($values);
+count = $values === null ? 0 : count($values);
+$count = $values === null ? 0 : count($values);
```

<br>
Expand Down
2 changes: 1 addition & 1 deletion rules/Php71/Rector/FuncCall/CountOnNullRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function getRuleDefinition(): RuleDefinition
,
<<<'CODE_SAMPLE'
$values = null;
count = $values === null ? 0 : count($values);
$count = $values === null ? 0 : count($values);
CODE_SAMPLE
)]
);
Expand Down

0 comments on commit 526091f

Please sign in to comment.