Ancestors

Toot

Written by Alanna on 2025-01-21 at 12:43

Any recommendations for PHP code linters or static analysis tools?

[#]php #codestyle #softwareengineering

=> More informations about this toot | More toots from kelpana@mastodon.ie

Descendants

Written by DCoder πŸ‡±πŸ‡Ήβ€πŸ‡ΊπŸ‡¦ on 2025-01-21 at 13:06

@kelpana

https://packagist.org/packages/symplify/easy-coding-standard for formatting.

https://phpstan.org/ for static analysis and replacing phpmd.

https://github.com/maglnet/ComposerRequireChecker for detecting dependency landmines.

=> More informations about this toot | More toots from dcoderlt@ohai.social

Written by Alister Bulman on 2025-01-21 at 13:26

@kelpana PHPStan: @phpstan & I'd also consider trying some extensions too, depending what you are using - https://packagist.org/?type=phpstan-extension

=> More informations about this toot | More toots from alister@hachyderm.io

Written by qrazi on 2025-01-21 at 13:56

@alister @kelpana @phpstan +1 on PHPStan. As for linting / prettifying we're using https://github.com/easy-coding-standard/easy-coding-standard at my job, seems to work well enough. I think it wraps other tooling but it should make the configuration a nicer experience* πŸ˜…

=> More informations about this toot | More toots from qrazi@phpc.social

Written by Larry Garfield on 2025-01-21 at 14:59

@kelpana PHPstan + php-cs-fixer.

=> More informations about this toot | More toots from Crell@phpc.social

Written by Matthew Weier O'Phinney on 2025-01-21 at 16:18

@kelpana I'm partial to @psalm for static analysis, though @phpstan is arguably more popular; in particular, I like that any given warning/error links you to an explanation of what causes that category of error, along with common approaches to resolving it.

I use @phpcs for code style enforcement;fixing; if you need just pure linting, php -l does that for you, and as of 8.2 or 8.3, will do multiple files/trees for you.

=> More informations about this toot | More toots from mwop@phpc.social

Written by Juliette on 2025-01-21 at 18:00

@mwop @kelpana Happy to see @phpcs being mentioned in that list ;-)

And if you are also looking for a pure PHP linting tool which can process your whole repo in one go and works PHP cross-version, I'd suggest having a look at https://github.com/php-parallel-lint/PHP-Parallel-Lint

=> More informations about this toot | More toots from jrf_nl@phpc.social

Proxy Information
Original URL
gemini://mastogem.picasoft.net/thread/113866403937765932
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
309.920342 milliseconds
Gemini-to-HTML Time
1.3231 milliseconds

This content has been proxied by September (3851b).