Last few days I have built new #phpstan rules for our home grown MVC framework to detect unused view files and unused routing rules.
thanks for the inspiration Tomas Votruba - who did similar things for blade templates recently.
=> More informations about this toot | View the thread
PHP Annotated mentions 3 of my #PHPStan blog posts ๐
https://blog.jetbrains.com/phpstorm/2025/01/php-annotated-january-2025/
=> More informations about this toot | View the thread
new #phpstan rule of the day.
detects javascript syntax errors of scripts inlined in php source files
=> View attached media | View attached media
=> More informations about this toot | View the thread
named arguments in #php are unnecessary/useless in most scenarios.
use them as spare as possible.
thankfully there is a no-named-arguments
-phpdoc which instruct static analysis to warn about some examples of misuse.
we discuss a new php-cs-fixer rule: https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/discussions/8359
=> More informations about this toot | View the thread
Its one of these days again. lets see whether we can get #phpstan a bit faster for some slow edge cases
10x Faster constant array processing ๐
=> More informations about this toot | View the thread
My recent improvements to #phpstan loose-comparison already pay off :-)
=> More informations about this toot | View the thread
Just released a new version of #phpstandba which reduces overhead in big projects up to ~ 50%
https://github.com/staabm/phpstan-dba/releases/tag/0.3.2
=> More informations about this toot | View the thread
To speedup the #feedbackloop when contributing to #phpstan, I have added a new bash alias, which might also be useful for you.
the nsrt command will run all NodeScopeResolverTests and start with those which failled in the previous run.
copy/paste at https://github.com/staabm/dotfiles/blob/de19ac1807d0c86fcc028938b08fc068c1f6e2b3/phpstan/aliases.zsh#L1
=> More informations about this toot | View the thread
Todays #phpstan release is loaded with improvements again.
For those extra strict people:
when strict-rules installed and bleeding-edge enabled, phpstan-phpunit will report calls to assertEquals() which can be replaced with assertSame().
(to prevent loose comparisons)
=> More informations about this toot | View the thread
Fixed #regex type detection in #phpstan for the x-modifier when #-comments are contained in the pattern
https://github.com/phpstan/phpstan-src/pull/3735
=> More informations about this toot | View the thread
My wrapped year
=> More informations about this toot | View the thread
Summarized my #opensource #contributions of 2024 in my todays blog post..
547 merged pull requests across 80 open-source projects.. not to bad ;)
https://staabm.github.io/2024/12/11/contribution-summary-2024.html
=> More informations about this toot | View the thread
Just made @votrubaT unused-public #phpstan package recognize register_shutdown_function
https://github.com/TomasVotruba/unused-public/pull/139
=> More informations about this toot | View the thread
@jensimmons could someone at apple safari team have a look at this safari/iOS/macOs only problem with paypal?
https://github.com/paypal/paypal-js/issues/461
=> More informations about this toot | View the thread
need for #speed
[#]phpstan
fix was a one line change :-)
https://github.com/phpstan/phpstan-src/pull/3695
=> More informations about this toot | View the thread
In my experience most projects set up PHPStan only for a few PHP versions and ignore the rest, which leaves a lot of potential errors undetected.
Let me work on PHPStan to iterate on this use-case so your next PHP version upgrade will be easier and contain less hurdles.
=> More informations about this toot | View the thread
If you want to cover your codebase cross several PHP versions, you need to set up a CI matrix with different PHP versions. You also need multiple PHPStan baselines to ignore errors which are only relevant for a specific PHP version. Such a setup brings additional complexity not everyone is willing to deal with.
=> More informations about this toot | View the thread
My new focus area will be improving the #PHPStan story around multi #php-version supporting code. This means focusing on stuff which is different between PHP versions.
I want to help you figure out the challenges of your next PHP upgrade: ๐๐งต
https://staabm.github.io/2024/11/28/phpstan-php-version-in-scope.html
=> More informations about this toot | View the thread
For years I am working on improving #phpstan type inference with a focus on mixed types.
I will start to focus on a different area soon, so I thought it would be a good time to summarize the achievements made.
https://staabm.github.io/2024/11/26/phpstan-mixed-types.html
=> More informations about this toot | View the thread
Friday afternoon highlight:
Found the cause of our static analysis sometimes reporting super strange results because of "wrong" reflection information.
Turns out one of the dependencies had a same-named test-class and the test-classes were forgotten to be git export-ignored
=> More informations about this toot | View the thread
=> This profile with reblog | Go to markusstaab@phpc.social account This content has been proxied by September (3851b).Proxy Information
text/gemini