binsoul/coding-standard
PHP_CodeSniffer-based coding standard bundle for PHP projects, providing opinionated style rules and configurations to keep code consistent. Easy to install via Composer and integrate into CI for automated code style checks and enforcement.
binsoul/coding-standard package (assuming it implements PSR-12 or custom coding standards via PHP_CodeSniffer) aligns well with Laravel’s emphasis on maintainability and consistency. It can be integrated into the existing CI/CD pipeline to enforce standards pre-commit or pre-merge.phpcs command or custom script, with minimal configuration.App\Services\* namespace) may conflict with default PSR-12 rules, requiring rule overrides.Route::resource() helpers) or miss critical issues..blade.php by default.)squizlabs/php_codesniffer, which is already a dependency in many Laravel projects (e.g., via laravel-pint or phpstan/extension-installer).laravel-pint for auto-formatting to reduce manual fixes.pestphp/pest or phpunit for test-driven compliance.husky + php-cs-fixer.--strict flag.app/Http/Controllers/).phpstan --level=max).--warning mode, then enforce --error in CI.phpcs.xml to override default rules (e.g., allow // comments in Blade).<rule ref="Generic.Files.LineEndings">
<properties>
<property name="lineEnding" value="unix"/>
</properties>
</rule>
php-cs-fixer or other PHPCS-based tools..blade.php files or requires manual inclusion in the ruleset.composer require binsoul/coding-standard.phpcs.xml in project root../vendor/bin/phpcs --standard=Binsoul app/Http.- name: Run Coding Standard
run: ./vendor/bin/phpcs --standard=Binsoul --error-severity=1 --warning-severity=0 .
pre-commit hooks.php_codesniffer version to avoid breaking changes.CONTRIBUTING.md section on coding standards to onboard new devs.phpcs command alias in composer.json scripts:
"scripts": {
"cs-check": "phpcs --standard=Binsoul --report=full ."
}
PHP_CodeSniffer) for local feedback.phpcs --cache).--ignore for legacy modules.| Failure Scenario | Mitigation | Recovery |
|---|---|---|
| CI pipeline flakes | Retry failed checks or cache results. | Skip non-critical files temporarily. |
| Rule conflicts with Laravel | Override rules in phpcs.xml. |
Temporarily disable conflicting rules. |
| High false-positive rate | Calibrate ruleset with team. | Whitelist patterns in config. |
| Package abandonment | Fork or migrate to php-cs-fixer. |
Gradually replace with alternatives. |
phpcs output and fixes.How can I help you explore Laravel packages today?