mirror of
https://github.com/danog/psalm.git
synced 2024-12-04 10:38:49 +01:00
16 lines
262 B
Markdown
16 lines
262 B
Markdown
# RedundantIdentityWithTrue
|
|
|
|
Emitted when comparing a known boolean with true and the `strictBinaryOperands` flag is set to true.
|
|
|
|
```php
|
|
<?php
|
|
|
|
function returnsABool(): bool {
|
|
return rand(1, 2) === 1;
|
|
}
|
|
|
|
if (returnsABool() === true) {
|
|
echo "hi!";
|
|
}
|
|
```
|