Skip to content

Commit

Permalink
Update docs (#238)
Browse files Browse the repository at this point in the history
  • Loading branch information
GeniJaho authored Jul 31, 2024
1 parent 0385bc9 commit bfcbd20
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/rector_rules_overview.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 63 Rules Overview
# 64 Rules Overview

## AbortIfRector

Expand Down Expand Up @@ -364,7 +364,7 @@ Avoid negated conditionals in `filter()` by using `reject()`, or vice versa.
-$collection->filter(fn (?int $number): bool => ! $number);
-$collection->reject(fn (?int $number) => ! $number > 0);
+$collection->reject(fn (?int $number): bool => is_null($number)); // Avoid negation
+$collection->reject(fn (?int $number): bool => (bool) $number); // Ensures explicit cast
+$collection->reject(fn (?int $number): bool => (bool) $number); // Explicitly cast
+$collection->filter(fn (?int $number): bool => $number > 0); // Adds return type
```

Expand Down

0 comments on commit bfcbd20

Please sign in to comment.