Type Preferences
– liamduckett.com - submitted by Liam
A short post about my preferences around type safety and static analysis.
Read more [liamduckett.com]
Posts tagged with static analysis
– liamduckett.com - submitted by Liam
A short post about my preferences around type safety and static analysis.
Read more [liamduckett.com]
Pseudo-types like callable and iterable may seem convenient at first glance, but they introduce ambiguities and make code harder to analyze.
Read more [f2r.github.io]
Join 9,500+ smart developers
Every month I share what I learn from running Spatie, building Oh Dear, and maintaining 300+ open source packages. Practical takes on Laravel, PHP, and AI that you can actually use.
No spam. Unsubscribe anytime. You can also follow me on X.
– ryangjchandler.co.uk - submitted by Ryan Chandler
A new series on writing a static analyser for PHP in Rust.
Read more [ryangjchandler.co.uk]
Thomas Votruba explains how you can go about this.
Read more [tomasvotruba.com]
Did you know that DateImmutable isn't really immutable?
Read more [matthiasnoback.nl]
I'm proud to announce that our new premium course on writing readable PHP is now available. It's called Writing Readable PHP.
This course contains a collection of bite-size tips (both in written form and videos) that make your code a joy to read for your co-workers and future self. These tips are aimed towards developers who know the basics of PHP and want to improve their craft. As a bonus, you'll learn to use static analysis to ensure that your code is understandable and correct.
Writing Readable PHP has been created by our team and Christoph Rumpel. It contains our combined knowledge on how to write the best PHP possible.
Generics are available since PHPStan 0.12. This posts explain what they’re all about.
Read more [phpstan.org]
A static analyzer helps you to find bugs in your code without even running it. Popular static analyzers for PHP are Psalm and PHPStan. In this post, we're going to look at what such a static analyzer can find in a two-year-old codebase.
Read more [flareapp.io]
A nice example by Evert Pot on how you can make static analysers do their work better.
Read more [evertpot.com]
I was quite surprised to learn that it could make sense to run PhpStorm on the server too.
Did you know that PHPStorm (or any other Jetbrains IDE) can run inspections from command line and generate XML files for the results? This is a great “hidden” feature of those IDEs and machine-readable output means it can be somehow integrated with a continuous integration (CI) process. So let’s do this!
Read more [www.christianscheb.de]
In an older but still relevant blogpost, Ondřej Mirtes, the author of PHPStan, explains the difference between union types and intersection types.
One of the headlining features of PHPStan 0.9 is the introduction of intersection types. Since this is a very useful feature that helps us understand the code much better, but the terminology is largely unknown and mysterious to the PHP community, I decided to write up and compare these two kinds of compound types.
Read more [medium.com]