squizlabs/php_codesniffer
PHP_CodeSniffer tokenizes PHP files to detect coding standard violations and automatically fix them. It ships two scripts: phpcs for sniffing and phpcbf for auto-correction, keeping code clean and consistent across teams and CI. The official continuation of the Squizlabs package.
phpcs in CI on changed files, use phpcbf to auto-fix common issues, and fail builds on remaining violations. This supports decisions about release readiness and review standards.ruleset.xml and custom sniffs to turn engineering guidance into automated checks—for example, disallow env() outside config, block debug helpers in application code, or enforce namespace/import conventions. This is especially relevant for Laravel codebases with distributed teams.require-dev or signed PHAR, define a ruleset.xml, run phpcs in CI and phpcbf for auto-fixes, and add custom sniffs for team and Laravel conventions. Start with changed files and a legacy baseline, then ratchet enforcement. Pin versions, review release notes, and complement with PHPStan/Psalm and security scanning.How can I help you explore Laravel packages today?