GrumPHP
PHP CS Fixer
Our great sponsors
GrumPHP | PHP CS Fixer | |
---|---|---|
22 | 36 | |
3,895 | 11,686 | |
0.7% | 0.7% | |
7.2 | 9.3 | |
28 days ago | about 21 hours 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.
GrumPHP
-
PHPUnit, do i need to learn it?
sounds like you heard of Grumphp
- Ideas for minimum PHP pipeline for a small team
-
A quality inspection hook installer
Are you aware of GrumPHP?
-
Is there a way to run commands before PHPStorm commits?
I use grumphp to run phplint, phpstan, Easy coding standard (includes php-cs fixer) and phpunit. All four will automatically run before every commit, stopping any 'below standard' code from being committed. Example config file
-
What are some helpful tools every Laravel CI pipeline should have?
like valplet said: https://github.com/phpro/grumphp But also: https://styleci.io/ integrates nicely with git For client side code formatting check: https://prettier.io/
-
Tools you’ve used to increase code quality and/or productivity?
GrumPHP with these tasks: https://github.com/phpro/grumphp/blob/master/doc/tasks/composer.md https://github.com/phpro/grumphp/blob/master/doc/tasks/composer_normalize.md https://github.com/phpro/grumphp/blob/master/doc/tasks/composer_require_checker.md https://github.com/phpro/grumphp/blob/master/doc/tasks/git_commit_message.md https://github.com/phpro/grumphp/blob/master/doc/tasks/phpcs.md https://github.com/phpro/grumphp/blob/master/doc/tasks/psalm.md
-
PHP libraries and tools
GrumPHP: A PHP code-quality tool.
-
Automating code quality check using GrumPHP in Magento 2
grumphp can be configured to listen to git commit commands and will not allow until all quality checks passed.
-
A minimal Drupal 9 local development environment
GrumPHP
-
How to get team members to write meaningful commits.
For those interested: https://github.com/phpro/grumphp/blob/master/doc/tasks/git_commit_message.md#git-commit-message
PHP CS Fixer
-
PHP in 2023 - stitcher.io
While you're at it, also include code-style checkers like phpcs, phpmd and/or php-cs-fixer
-
Write a PHP library supports PHP 5.6 to 8.1
I run two tools for this - php-cs-fixer on PHP 5.6 and the built-in syntax checker(php -l).
-
Featherweight library to write to slack channel
You can use this library to help automate this: https://github.com/FriendsOfPHP/PHP-CS-Fixer 😊
-
7 Laravel Packages to Improve Coding Standards and Reduce Bugs
Laravel Pint is an opinionated PHP code style fixer for minimalists. Pint is built on top of PHP-CS-Fixer and makes it simple to ensure that your code style stays clean and consistent. Pint is a new addition to the Laravel framework.
-
How do you feel about laravel/pint?
Do you think it should have been just a php-cs-fixer preset, just like the symfony & PSR ones? Well it kinda is, but with extra steps. Also is there a way to use the existing presets in pint? Like the migration ones - https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/master/src/RuleSet/Sets/PHP81MigrationSet.php ?
-
Underestimated PHP
Coding Standards Fixer
-
GitHub - laravel/pint: Laravel Pint is a minimalist code style fixer for PHP.
Symfony (well Fabien Potencier, lead dev of Symfony) has created https://github.com/friendsofphp/php-cs-fixer years ago. And although maintenance is transferred to the FriendsOfPHP organisation, it comes with a Symfony code style preset, as well as PSR based presets.
-
VS Code: replace "array(...)" syntax with "[...]"
The setup I currently have and hope that helps you, is having installed PHP-CS-Fixer along with this extension for VSCode to format the files on save (not doing the key combination or command "Format document with..." but maybe other extensions that use PHP-CS-Fixer could solve this problem), then you could use this useful configurator, there are plenty of rules you can set or select the predefined based on the given standards, the one you are looking for is "array_syntax" there you can export the selected rules and create a ".php-cs-fixer.php" file that has your configurations, set the path to the file on the extension settings and you should be ready to format flies con the fly (or you could use the command line to format a given directory and not file by file)
-
What PHP book would you most like to see written?
Maybe you mean using tools like php-cs-fixer https://github.com/FriendsOfPHP/PHP-CS-Fixer to just handle this automatically - that's certainly what I'd recommend
What are some alternatives?
PHP Code Sniffer - PHP_CodeSniffer tokenizes PHP files and detects violations of a defined set of coding standards.
PHPStan - PHP Static Analysis Tool - discover bugs in your code without running it!
Rector - Instant Upgrades and Automated Refactoring of any PHP 5.3+ code
PHP Mess Detector - PHPMD is a spin-off project of PHP Depend and aims to be a PHP equivalent of the well known Java tool PMD. PHPMD can be seen as an user friendly frontend application for the raw metrics stream measured by PHP Depend.
magento-coding-standard - Magento Coding Standard
drupal-project - :rocket: Composer template for Drupal projects. Quick installation via "composer create-project drupal-composer/drupal-project"
PHP-Parallel-Lint - This tool check syntax of PHP files faster than serial check with fancier output.
phan - Phan is a static analyzer for PHP. Phan prefers to avoid false-positives and attempts to prove incorrectness rather than correctness.
laravel-code-style - Automatic code formatting for Laravel projects