wyrihaximus/coding-standard
PHP coding standard package for consistent formatting and style in PHP projects. Provides ready-to-use rulesets and configuration to streamline linting, code style checks, and enforcement across teams and CI pipelines.
squizlabs/php_codesniffer, slevomat/coding-standard, and doctrine/coding-standard), meaning it enforces custom linting rules rather than core Laravel functionality. It is not a Laravel-specific package but can be integrated into any PHP/Laravel project to enforce consistent coding style.@api annotations, PHP 8.4 support). A TPM must evaluate whether these rules align with the team’s existing standards (e.g., PSR-12, custom in-house rules).phpcs. Integration is non-intrusive and can run in CI/CD pipelines or locally via CLI.phpcs setups (e.g., if the team already uses psalm or phpstan with custom rules). A TPM should audit existing tooling.@api annotation bans) may flag legitimate code or miss issues. Requires manual review during adoption.phpcs in CI/CD adds execution time. For large codebases, this could slow down pipelines if not optimized (e.g., parallel runs, caching).phpstan?laravel-pint, deptrac) that better fit Laravel’s needs?phpcs runtime for the codebase? Will it require optimizations (e.g., caching, parallelism)?phpstan → phpcs → tests).phpcs locally).@api annotations).composer.json:
composer require --dev wyrihaximus/coding-standard
phpcs in phpcs.xml:
<config defaultStandard="WyriHaximus">
<arg name="extensions" value="php,blade"/>
</config>
./vendor/bin/phpcs (e.g., in GitHub Actions):
- name: Run PHP_CodeSniffer
run: ./vendor/bin/phpcs --standard=WyriHaximus --warning-severity=0 src/
phpcs.xml (e.g., disable @api checks if used internally).@api ban) may require codebase updates.phpcs rules, merge them with this standard.phpcs --ignore=* to exclude files during transition.phpcs locally.phpcs results in CI.slevomat/coding-standard), but the main package itself has irregular releases. A TPM should:
phpcs.xml or sniffs.phpcs output.@api annotations).phpcs.xml.phpcs can be slow. Mitigations:
phpcs --parallel).vendor/).--extensions=php,blade).husky + phpcs).| Failure Mode | Impact | Mitigation |
|---|---|---|
| CI pipeline timeouts | Slows down releases. | Optimize phpcs runs |
How can I help you explore Laravel packages today?