sueden.social ist einer von vielen unabhängigen Mastodon-Servern, mit dem du dich im Fediverse beteiligen kannst.
Eine Community für alle, die sich dem Süden hingezogen fühlen. Wir können alles außer Hochdeutsch.

Serverstatistik:

1,8 Tsd.
aktive Profile

#PHPStan

1 Beitrag1 Beteiligte*r0 Beiträge heute

Anyone can help with a #phpstan issue?

I've got strange errors when running it.

"Internal error: PhpParser\Lexer::getNextToken(): Return value must be of type int, null returned while analysing file /application/src/Form/DataTransformer/Core/LanguageToStringTransformer.php"

The given class wasn't changed since years now and when I'm removing it (for testing reasons) phpstan argues about other files.

Does anyone know what's going on? I'm on the latest stable version 1.12.28

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,.. :)