php-collective/code-sniffer
PHP_CodeSniffer ruleset from PhpCollective. PSR-2 compliant with many extra sniffs/fixers (incl. PSR-12) plus an optional stricter standard (PhpCollectiveStrict). Install via Composer and run phpcs/phpcbf, or wire into CI/IDE.
PhpCollectiveStrict) to standardize teams.phpcbf).PhpCollectiveStrict for new code, lenient rules for legacy).For Executives:
"This package standardizes our PHP codebase, reducing bugs and onboarding time by enforcing best practices automatically. It integrates seamlessly with CI/CD (e.g., CircleCI) and IDEs like PHPStorm, saving dev hours on manual reviews. For example, it catches issues like inconsistent naming or missing docblocks—problems that cost us ~$X/year in fixes. We can start with PhpCollective (PSR-2/PSR-12) and later adopt PhpCollectiveStrict for new features."
For Engineers: *"This is a drop-in replacement for custom linting rules. Key benefits:
phpcbf (e.g., indentation, braces).Ctrl+Comma in PHPStorm.vendor/bin/phpcs to your pipeline to block violations.composer require --dev php-collective/code-sniffer
composer cs-check # Runs PHPCS with PhpCollective rules
No reinventing the wheel—just enforce consistency at scale."*
For Developers: *"This makes your code look and work better with minimal effort:
composer cs-fix.@return tags).# Check your code
composer cs-check
# Fix auto-fixable issues
composer cs-fix
Pro tip: Add phpcs.xml to your repo to customize rules (e.g., stricter for new files)."*
How can I help you explore Laravel packages today?