3 ms·
Scalar type declarations don't help detect usage of undefined variables, as an example. Phan is the only tool I've found that does, but it's a very heavyweight
by bpicolo 9y ago
Scalar type declarations don't help detect usage of undefined variables, as an example. Phan is the only tool I've found that does, but it's a very heavyweight thing, given how necessary it is to prevent undefined variable exceptions.
- CiPHPerCoder 9y agoThat's a separate concern from truthiness. And if you aren't using nullable types (a 7.1+ feature), passing NULL gives you a TypeError. :)
- muglug 9y agoI wrote a similar tool that's slightly less heavyweight (doesn't rely on a separate extension): https://getpsalm.org/ https://getpsalm.org/
- CiPHPerCoder 9y agoYes, Psalm is great. We use it in a lot of our projects, and in the future will be using it in all of them. We absolutely love it. (It's on my "to blog about" queue.)
- bpicolo 9y agoI'm going to be trying it out. Thanks. The more lints the better when dealing with legacy monoliths!