Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Yoastcs Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Enforce Consistent Code Quality: Adopting 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.
  • Build vs. Buy: Avoid reinventing a custom PHPCS ruleset. YoastCS provides a pre-validated, enterprise-grade standard (used internally by Yoast) with WordPress/VIP sniffs, PHP compatibility checks, and custom Yoast-specific rules—reducing engineering effort.
  • CI/CD Integration: Supports automated quality gates in pipelines (e.g., blocking PRs with errors via YOASTCS_THRESHOLD_ERRORS). Critical for teams adopting GitOps or shift-left testing.
  • Use Cases:
    • WordPress/Laravel Hybrid Apps: Enforce WordPress coding standards in Laravel plugins/themes.
    • Legacy Code Modernization: Identify deprecated PHP/WordPress patterns (e.g., exit() without parentheses) via PHPCompatibilityWP.
    • Team Onboarding: Standardize code reviews with actionable sniffs (e.g., SlevomatCodingStandard.Arrays.ArrayAccess for modern PHP practices).
    • Compliance: Meet WordPress VIP or enterprise-grade coding requirements without custom tooling.

When to Consider This Package

  • Adopt if:

    • Your team builds WordPress plugins/themes or Laravel apps interacting with WordPress.
    • You need PHP 7.4+ compatibility checks with WordPress-specific false-positive handling.
    • You want threshold-based CI enforcement (e.g., "block PRs with >5 errors").
    • You’re using PHP_CodeSniffer and want a maintained, opinionated standard (vs. custom rules).
    • Your project requires Slevomat/Symfony-like sniffs (e.g., null coalescing, trailing commas) alongside WordPress rules.
  • Look elsewhere if:

    • You’re not using PHP/WordPress: Sniffs are WordPress-centric (e.g., WordPress.WP.GetMetaSingle).
    • You need lightweight linting: PHP Parallel Lint is included but not a replacement for tools like psalm or pint.
    • Your team prefers minimalist standards: YoastCS is strict (e.g., enforces exit() parentheses, disallows true/false literals).
    • You’re not using Composer: Installation requires Composer for PHPCS integration.
    • You need real-time IDE feedback: While PhpStorm support exists, some sniffs lack detailed docs.

How to Pitch It (Stakeholders)

For Executives:

*"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:

  • Reduce bugs by catching WordPress-specific issues (e.g., deprecated functions) early.
  • Speed up onboarding with consistent style guides.
  • Cut CI costs by blocking low-quality PRs before they merge.
  • Future-proof our codebase for PHP 8.4+ and WordPress 6.8+. Cost: Free (MIT license). ROI: Fewer fire drills, faster iterations."*

For Engineering:

*"YoastCS gives us:

  1. WordPress + Laravel synergy: Enforces WordPress coding standards in Laravel plugins/themes (e.g., WordPress.WP.GetMetaSingle).
  2. Modern PHP checks: Catches anti-patterns like !empty($var) (via VariableAnalysis) and enforces null coalescing (Slevomat).
  3. CI superpowers: The Threshold report lets us set hard limits on errors/warnings (e.g., YOASTCS_THRESHOLD_ERRORS=0).
  4. Zero maintenance: Yoast updates the ruleset; we just run 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/
```"*
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope