camelot/coding-style
Camelot coding style standard for PHP projects, based on PSR-2 and Symfony2. Provides ready-to-use configurations for PHP_CodeSniffer and PHP-CS-Fixer (composer install, sample phpcs.xml.dist and .php_cs.dist, customizable rules).
--dev).phpcs.xml.dist, .php_cs.dist).heredoc_to_nowdoc or enabling risky fixes).phpcs/php-cs-fixer in CI/CD adds ~5–15s per commit (depends on codebase size).--risky in PHP-CS-Fixer) could introduce regressions if not tested.vendor/, bootstrap/cache/).feature/coding-standards).src/App/).- name: PHP Coding Standards
run: vendor/bin/phpcs --standard=vendor/camelot/codingstyle/Camelot src tests
vendor/bin/php-cs-fixer fix --config=.php_cs.dist --dry-run
.github/CODE_OF_CONDUCT.md or CONTRIBUTING.md section explaining:
phpcs, php-cs-fixer).tests/Feature/OldCodeTest.php).squizlabs/php_codesniffer).phpcs.xml.| Step | Task | Owner | Dependencies |
|---|---|---|---|
| 1 | Install package (--dev) |
DevOps/TPM | Composer access |
| 2 | Configure phpcs.xml.dist and .php_cs.dist |
Backend Team | Camelot ruleset |
| 3 | Test locally (manual runs) | Developers | PHP_CodeSniffer installed |
| 4 | Add CI checks (non-blocking) | DevOps | CI pipeline access |
| 5 | Enforce in PRs (blocking) | TPM | CI approval |
| 6 | Add pre-commit hooks (optional) | Developers | Husky/pre-commit |
composer update camelot/codingstyle --dev.README.md.phpcs, php-cs-fixer).src/ and tests/ across jobs).| Failure Mode | Impact | Mitigation |
|---|---|---|
| CI flakes (slow/timeout) | Blocked PRs | Cache vendor/ in CI, parallelize runs |
| Overly strict rules | Developer frustration | Start with warnings, allow overrides |
| Toolchain missing | Local dev failures | Document setup in CONTRIBUTING.md |
| Rule conflicts | Broken builds | Test in pilot phase, exclude problematic files |
| PHP version mismatch | Fixer failures | Pin PHP_CodeSniffer version |
phpcs integration in CI.phpcs checks.phpcs/php-cs-fixer.# Check files
vendor/bin/phpcs src
# Fix files
vendor/bin/php-cs-fixer fix src
# Dry run
vendor/bin/php-cs-fixer fix --dry-run
How can I help you explore Laravel packages today?