1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 12:55:26 +01:00
psalm/docs/annotating_code
AndrolGenhald d09e420939 Add @psalm-check-type and @psalm-check-type-exact.
I initially added these as part of my TryAnalyzer rewrite to allow testing complicated `finally` types like this:
```
$foo = 1;
try {
        $foo = 2;
} catch (Exception $_) {
        $foo = 3;
} finally {
        $bar = $foo;
        /** @psalm-check-type-exact $bar = 1|2|3 */;
}
/** @psalm-check-type-exact $bar = 2|3 */;
```
Using the `'assertions'` in tests doesn't work since the type is different inside the `finally`.

I decided to extract the new annotation from the rest of my changes and do a separate pull request since I think others may find it useful, and it should be much easier to review than the entire TryAnalyzer rewrite.
2022-02-17 10:37:13 -06:00
..
type_syntax remove totallyTyped 2022-02-12 10:19:14 +01:00
adding_assertions.md Add template support to @psalm-self-out 2021-10-28 10:44:37 +02:00
assertion_syntax.md Add opening <?php tags to all PHP snippets 2020-03-21 09:24:41 -04:00
supported_annotations.md Add @psalm-check-type and @psalm-check-type-exact. 2022-02-17 10:37:13 -06:00
templated_annotations.md Added test to enforce that all supported annotations are documented (#4723) 2020-11-27 21:48:16 -05:00
typing_in_psalm.md Fix broken links in documentation (#4730) 2020-11-28 21:03:09 -05:00