mirror of
https://github.com/danog/psalm.git
synced 2025-01-21 21:31:13 +01:00
Explain bool assertions (#2528)
This commit is contained in:
parent
d3fb0181cb
commit
ca31931a53
@ -64,6 +64,18 @@ This asserts that `$bar` is not an object of type `SomeObjectType`:
|
||||
/** @psalm-assert !SomeObjectType $bar */
|
||||
```
|
||||
|
||||
## Bool assertions
|
||||
|
||||
This asserts that `$bar` is `true`:
|
||||
```php
|
||||
/** @psalm-assert true $bar */
|
||||
```
|
||||
|
||||
This asserts that `$bar` is not `false`:
|
||||
```php
|
||||
/** @psalm-assert !false $bar */
|
||||
```
|
||||
|
||||
## Equality assertions
|
||||
|
||||
Psalm also supports the equivalent of `assert($some_int === $other_int)` in the form
|
||||
|
Loading…
x
Reference in New Issue
Block a user