laravel-code-style
Automatic code formatting for Laravel projects (by matt-allan)
coding-standard
Slevomat Coding Standard for PHP_CodeSniffer provides many useful sniffs (by slevomat)
Our great sponsors
laravel-code-style | coding-standard | |
---|---|---|
1 | 9 | |
413 | 1,358 | |
- | 1.3% | |
5.7 | 8.2 | |
about 2 years ago | about 2 months ago | |
PHP | PHP | |
MIT License | MIT License |
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
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.
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.
laravel-code-style
Posts with mentions or reviews of laravel-code-style.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2021-02-19.
-
How do you enforce a consistent code style in your projects?
You don‘t need to configure all these rulesets for phpcsfixer. Just use some presets and add/diable rules if it does not fit your style or use the laravel preset: https://github.com/matt-allan/laravel-code-style
coding-standard
Posts with mentions or reviews of coding-standard.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2024-02-08.
-
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?
When comparing laravel-code-style and coding-standard you can also consider the following projects:
PHP CS Fixer - A tool to automatically fix PHP Coding Standards issues
phpcs-laravel - The PHP_Codesniffer configuration I use across Laravel projects
GrumPHP - A PHP code-quality tool
VIP-Coding-Standards - PHP_CodeSniffer ruleset to enforce WordPress VIP coding standards.
watson-text-to-speech-php - IBM Watson text to speech API PHP
easy-coding-standard - The Easiest way to add coding standard to your PHP project
PHP-CS-Fixer - A tool to automatically fix PHP Coding Standards issues [Moved to: https://github.com/PHP-CS-Fixer/PHP-CS-Fixer]
static-php-cli - Build standalone PHP binary on Linux, macOS, FreeBSD, Windows, with PHP project together, with popular extensions included.
laravel-code-style vs PHP CS Fixer
coding-standard vs phpcs-laravel
laravel-code-style vs GrumPHP
coding-standard vs VIP-Coding-Standards
laravel-code-style vs watson-text-to-speech-php
coding-standard vs GrumPHP
laravel-code-style vs phpcs-laravel
coding-standard vs easy-coding-standard
laravel-code-style vs PHP-CS-Fixer
coding-standard vs PHP-CS-Fixer
coding-standard vs static-php-cli
coding-standard vs watson-text-to-speech-php