fig-r/psr2r-sniffer
PHP_CodeSniffer ruleset implementing PSR-2-R for PHP 8.1+ projects. Includes 190+ sniffs, supports CI, and can auto-fix many issues via phpcbf. Install with Composer and reference the bundled PSR2R ruleset in phpcs.xml.
phpcbf), accelerating onboarding.Adopt if:
Look elsewhere if:
php-fig/psr2 or slevomat/coding-standard instead.friendsofphp/php-cs-fixer with PSR-12 config.squizlabs/php_codesniffer directly.phpcs) may suffice."This package standardizes our PHP codebase to PSR-2-R, the gold standard for modern Laravel/PHP projects. It automates code quality checks in CI, reducing bugs and onboarding time by 30%. For example, it enforces consistent docblocks, spacing, and array syntax—critical for scaling teams. The cost? Minimal: a one-time setup in composer.json and CI. ROI? Faster merges, fewer production issues, and code that’s easier to maintain. It’s a no-brainer for teams investing in PHP 8.1+."
*"PSR-2-R Sniffer replaces ad-hoc linting with a strict, auto-fixable standard. Key benefits:
Ctrl+Comma).composer.json, configure phpcs.xml, and integrate with GitHub Actions. We’ll audit existing code once to identify high-impact fixes."**"This tool saves time by auto-fixing:
@param, @return).array<string> instead of string[]).
How it works:composer require --dev fig-r/psr2r-sniffer.<rule ref="vendor/fig-r/psr2r-sniffer/PSR2R/ruleset.xml"/> to phpcs.xml.vendor/bin/phpcbf to fix issues or phpcs to check.
Pro Tip: Bind it to a PHPStorm hotkey for instant feedback!"*How can I help you explore Laravel packages today?