codeat3/phpcs-styles
codeat3/phpcs-styles provides PHP_CodeSniffer rulesets and coding style configurations to standardize formatting and code quality across PHP projects, helping teams enforce consistent conventions in CI and local development.
pint or php-cs-fixer..php-cs-fixer.dist.php or pint.json without disrupting existing setups.| Risk | Severity | Mitigation |
|---|---|---|
| Rule conflicts with existing configs | Medium | Run php-cs-fixer --dry-run pre-adoption; use $rules->merge() for overrides. |
| PHP-CS-Fixer version incompatibility | High | Pin php-cs-fixer version in composer.json (e.g., ^3.0). |
| Performance impact in CI/CD | Medium | Cache results ($rules->cacheFile()) and parallelize checks. |
| Abandoned package | Low | Fork or migrate rules to project config if inactive. |
| Lack of documentation | Medium | Supplement with internal docs; leverage PHP-CS-Fixer’s official resources. |
pint presets)?pint, php-cs-fixer CLI, or another tool? Does the package support all?composer require codeat3/phpcs-styles --dev
Extend pint.json:
{
"preset": "laravel",
"rules": {
"@codeat3/phpcs-styles": true
}
}
.php-cs-fixer.dist.php:
return (\Codeat3\PhpcsStyles\Config::getRules())->merge([
'risky' => true,
]);
- name: PHP-CS-Fixer
run: vendor/bin/php-cs-fixer fix --rules=@codeat3/phpcs-styles --dry-run
php-cs-fixer:
script: vendor/bin/php-cs-fixer fix --rules=@codeat3/phpcs-styles
.php-cs-fixer.dist.php or pint.json.php-cs-fixer --dry-run --rules=@codeat3/phpcs-styles to preview changes.feature/style-refactor).--allow-risky=yes for non-blocking issues).composer.json)."php-cs-fixer/diff": "^3.0",
"codeat3/phpcs-styles": "^1.0"
$finder->exclude(['storage/', 'vendor/']);
$rules->remove('CodeAt3\Rules\ControversialRule');
vendor/codeat3/phpcs-styles/ruleset.xml.php-cs-fixer.executablePath in settings.json.composer require --dev codeat3/phpcs-styles
"rules": { "@codeat3/phpcs-styles": true }
return (\Codeat3\PhpcsStyles\Config::getRules())->merge([...]);
php-cs-fixer fix and fail on errors.CONTRIBUTING.md.husky) for local enforcement.composer.json for stability.$rules = (\Codeat3\PhpcsStyles\Config::getRules())->merge([
'array_syntax' => ['syntax' => 'short'],
]);
php-cs-fixer --dry-run --diff to debug rule applications..php-cs-fixer.dist.php.$rules->cacheFile()).git diff filtering).small vs. large).| Scenario | Impact | Mitigation |
|---|---|---|
| Rule breaks existing code | Build failures, developer frustration | Run dry-run first; allow exceptions via config |
| Package abandoned | Unmaintained rules, security risks | Fork or migrate rules to project config |
| CI/CD timeouts | Slower releases | Cache results, parallelize, or exclude paths |
| Rule conflicts with |
How can I help you explore Laravel packages today?