mastodon.xyz is one of the many independent Mastodon servers you can use to participate in the fediverse.
A Mastodon instance, open to everyone, but mainly English and French speaking.

Administered by:

Server stats:

739
active users

#phpstan

2 posts2 participants0 posts today

Ondřej Mirtes is taking the stage at #DrupalConVienna on 14 October as a featured speaker in the CODING & SITE BUILDING track. His session “Writing Custom PHPStan Rules for Drupal Projects” will show you how to elevate your skills.

✨ Don’t miss the chance to gain fresh insights straight from the creator of PHPStan!
👉 events.drupal.org/vienna2025/s

#DrupalConEur #PHPStan #DrupalDev #Drupal #Coding

@OndrejMirtes

PHP is when you spend eight hours mapping a dynamic OOP query structure into an array structure so that an external library can read it. However, today, PHPStan 1.12.28 required me to specify the array value EXACTLY. Yet it doesn't support the necessary circular dependencies by its `@phpstan-type`... 👏

This is why I sometimes need a three-week vacation from PHP; otherwise, I'll burn out.

What remains? Delete all type definitions, and then exclude each resulting phpstan error individually. Awesome! More wasted time!

And of course some after-work Golang :go: to keep me sane.

We recently hit a production problem because dead code detection did not work like expected

until now #phpstan only saw unreachable code after always terminating statements

took me a while, but fixed dead code detection to check expressions - available in the upcoming release

#phpstan rule of the day:

implemented a very naive rule which just checks the content of files and counts single quotes, double quotes and parenthesis.

in 98% of the files this should be a even number.
if not you likely found invalid html, sql, javascript, php, strings,.. :)