Skip to content

Commit

Permalink
Readme: fix & improve AllowComparingOnlyComparableTypesRule (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
janedbal committed Aug 1, 2022
1 parent f97f513 commit e6e64fc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,15 @@ Rarely, some rules are reliable only when some other rule is enabled.

```neon
rules:
- ShipMonk\PHPStan\Rule\ForbidTrickyComparisonRule
- ShipMonk\PHPStan\Rule\AllowComparingOnlyComparableTypesRule
```
```php
function example1(Money $fee1, Money $fee2) {
if ($fee1 > $fee2) {} // comparing objects is denied
}

new DateTime() > '2040-01-02'; // comparing different types is denied
200 > '1e2'; // comparing different types is denied
```

### AllowNamedArgumentOnlyInAttributesRule
Expand Down

0 comments on commit e6e64fc

Please sign in to comment.