mirror of
https://github.com/danog/psalm.git
synced 2025-01-22 13:51:54 +01:00
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.
…
Psalm
Psalm is a static analysis tool for finding errors in PHP applications.
Installation
To get started, check out the installation guide.
Live Demo
You can play around with Psalm on its website.
Documentation
Documentation is available on Psalm’s website, generated from the docs folder.
Interested in contributing?
Have a look at CONTRIBUTING.md.
Who made this
Built by Matt Brown (@muglug).
Maintained by Orklah (@orklah) and Bruce Weirdan (@weirdan).
The engineering team at Vimeo have provided a lot encouragement, especially @nbeliard, @erunion and @nickyr.
Languages
PHP
100%