yoast/yoastcs
Yoast Coding Standards (YoastCS) provides Composer-installable rulesets for PHP_CodeSniffer plus PHP Parallel Lint, bundling Yoast sniffs and selected external standards (including WordPress). Use it to enforce consistent code style and quality in Yoast projects.
yoast/yoastcs enables teams to enforce Yoast’s rigorous coding standards (WordPress + custom sniffs) across Laravel/PHP projects, reducing technical debt and improving maintainability. This aligns with roadmap goals for scalability and developer experience.YOASTCS_THRESHOLD_ERRORS). Critical for teams adopting GitOps or shift-left testing.exit() without parentheses) via PHPCompatibilityWP.SlevomatCodingStandard.Arrays.ArrayAccess for modern PHP practices).Adopt if:
Look elsewhere if:
WordPress.WP.GetMetaSingle).psalm or pint.exit() parentheses, disallows true/false literals).*"YoastCS lets us enforce Yoast’s battle-tested coding standards—used internally for their high-traffic WordPress products—with minimal engineering lift. It’s like hiring a senior PHP/WordPress developer to review every line of code automatically. For [Project X], this will:
*"YoastCS gives us:
WordPress.WP.GetMetaSingle).!empty($var) (via VariableAnalysis) and enforces null coalescing (Slevomat).Threshold report lets us set hard limits on errors/warnings (e.g., YOASTCS_THRESHOLD_ERRORS=0).composer require --dev yoast/yoastcs.
Tradeoff: It’s strict—expect to fix some legacy code. But it’s worth it for long-term quality.
How to start:composer require --dev yoast/yoastcs
./vendor/bin/phpcs --standard=Yoast src/
Add to CI:
- name: Enforce coding standards
run: ./vendor/bin/phpcs --standard=Yoast --report=YoastCS\Yoast\Reports\Threshold src/
```"*
How can I help you explore Laravel packages today?