1
0
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:
Ruud Kamphuis 2019-12-29 15:22:09 +01:00 committed by Matthew Brown
parent d3fb0181cb
commit ca31931a53

View File

@ -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