psalm-plugin-laravel
coding-standard
Our great sponsors
psalm-plugin-laravel | coding-standard | |
---|---|---|
5 | 9 | |
285 | 1,358 | |
2.5% | 0.8% | |
9.0 | 8.2 | |
28 days ago | about 2 months ago | |
PHP | PHP | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
psalm-plugin-laravel
-
Laravel code-quality tools
Psalm is a static analysis tool for PHP. Much like PHPStan is to Larastan, Psalm has a plugin called Laravel Psalm that allows you to easily use it in Laravel projects.
-
What’s Next: PhpStorm 2022.3 Roadmap
Thanks. Num.2 is this about https://github.com/psalm/psalm-plugin-laravel or applicable to other projects? Num.3 - isn't that how it is now?
-
[Poll] Do you use preloading in your applications?
Also disagree with the static analysis take - we have dozens of Laravel applications that pass Psalm's static analysis with the strictest settings. All it takes is the Laravel plugin and some DocBlocks here and there.
-
Static Analysis With Psalm
Psalm v3 came with a new plugin framework that makes authoring integrations for third party packages much easier. That, with Barry's IDE Helper made the Laravel Plugin a reality according to Matt.
- Would you be interested in a Lightweight Open Source Laravel Eloquent ORM like library
coding-standard
-
Laravel code-quality tools
If you go through the imports in the config/insights.php file, you'll see that it mostly uses rules from NunoMaduro\PhpInsights and SlevomatCodingStandard\Sniffs. The former is PHP Insight's in-house insights and the latter is the sniffs from the Slevomat coding standard. In most cases, you'll only ever reach for those two.
-
Does CodeSniffer/ECS have the possibility to detect large methods/functions?
However, you can get cognitive complexity in phpcs with the slevomat ruleset. This ruleset is used as a base for the Doctrine coding standard.
-
Searching expecific rules for php-cs-fixer
I think you can use the Slevomat Coding Standards to solve both issues.
-
Tools you’ve used to increase code quality and/or productivity?
I also make heavy use of Codesniffer with PSR12 as a base and a load of the rules from https://github.com/slevomat/coding-standard - learning how to use Codesniffer and setting up a comprehensive coding standard can be incredibly helpful when working as part of a team.
-
Recommendations for productivity tools/libraries?
You should check out https://github.com/slevomat/coding-standard for some very useful additional rules.
-
Strict operators on known return values
no need for muscle memory, there's a phpcs rule for that 🙂
-
How do you enforce a consistent code style in your projects?
Codesniffer. Though the requirements may differ between projects I typically use PSR12 as a starting point, plus disallowing long array syntax, enforcing a need for DocBlocks, and a few others. I find https://github.com/slevomat/coding-standard is also a good source of useful sniffs.
-
Why "on" == 0 evaluates to true?
Well, as we have this phpcs rule in our coding standard, it is forbidden (for us) 😉 Maybe, forbidden is not a good word, though.
What are some alternatives?
larastan - ⚗️ Adds code analysis to Laravel improving developer productivity and code quality.
laravel-code-style - Automatic code formatting for Laravel projects
laravel-ide-helper - IDE Helper for Laravel
phpcs-laravel - The PHP_Codesniffer configuration I use across Laravel projects
PHP Noise - A starter-kit for your PHP project.
VIP-Coding-Standards - PHP_CodeSniffer ruleset to enforce WordPress VIP coding standards.
psalm-psr-container-plugin - Let Psalm understand better psr11 containers
GrumPHP - A PHP code-quality tool
enlightn - Your performance & security consultant, an artisan command away.
easy-coding-standard - The Easiest way to add coding standard to your PHP project
functional - PHP Functional Programming library. Monads, common use functions and generic collections.
PHP-CS-Fixer - A tool to automatically fix PHP Coding Standards issues [Moved to: https://github.com/PHP-CS-Fixer/PHP-CS-Fixer]