drupol/phpcsfixer-configs-php
Ready-made PHP-CS-Fixer config objects for common standards and PHP versions (PSR-12, PHP 5.6–7.3). Implements ConfigInterface and supports combining rules via withRulesFrom() for easy reuse across projects.
PSR12, Php56, Php71, Php72, Php73, Php82), allowing TPMs to selectively apply rules without reinventing the wheel. This aligns with Laravel’s composable architecture (e.g., service providers, packages).withRulesFrom() method enables custom rule overrides, which is useful for Laravel’s team-specific coding standards (e.g., customizing no_unused_imports for Laravel’s facades).--dev dependency), requiring minimal setup. Laravel’s existing PHPCS/Pint integration can leverage this package directly without disrupting workflows.--config flag.Php56) may override Laravel’s defaults (e.g., strict typing). TPMs should test edge cases (e.g., array_push vs. [] syntax).phpcs --dry-run.Php56 config?PSR12 or a PHP 8.x-specific config?phpcs.xml) or complement them?.php-cs-fixer.dist.php files?--config flag to point to the package’s config.
./vendor/bin/pint --config=drupol\PhpCsFixerConfigsPhp\Config\PSR12
phpcs.xml to use the package’s rules.
<config defaultStandard="PSR12">
<rule ref="drupol\PhpCsFixerConfigsPhp\Config\PSR12"/>
</config>
withRulesFrom().phpcs.xml, .php-cs-fixer.dist.php).no_unused_imports vs. package defaults).diff <(phpcs app --report=diff) <(phpcs app --config=drupol\PSR12 --report=diff)
PSR12 configs first (lowest risk).Php74, Php82).withRulesFrom() for team-specific needs..github/workflows/lint.yml to use the new config:
- name: PHP-CS-Fixer
run: phpcs --config=drupol\PhpCsFixerConfigsPhp\Config\PSR12 --standard=PSR12 .
grumphp.yml:
parameters:
tasks:
phpcs:
standard: drupol\PhpCsFixerConfigsPhp\Config\PSR12
Php82).composer require --dev drupol/phpcsfixer-configs-php).phpcs.xml, .php-cs-fixer.dist.php).CONTRIBUTING.md.composer normalize to lock PHPCS versions.README.md.no_unused_imports vs. Laravel’s facades).phpcs --dry-run --report=xml for detailed output.phpcs --diff to compare before/after fixes.#php-cs-fixer for community help.--parallel flag or cache results (e.g., phpcs --cache-file=.phpcs.cache).CONTRIBUTING.md.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| PHPC |
How can I help you explore Laravel packages today?