Skip to content
Permalink
Browse files

Explain bool assertions (#2528)

  • Loading branch information
ruudk authored and muglug committed Dec 29, 2019
1 parent d3fb018 commit ca31931a53d5f7db2fe667aa5b14b6fd57292803
Showing with 12 additions and 0 deletions.
  1. +12 −0 docs/annotating_code/assertion_syntax.md
@@ -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

0 comments on commit ca31931

Please sign in to comment.
You can’t perform that action at this time.