Weave 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

Php Codesniffer Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Quality gate and definition of done. Make coding-standard compliance a merge criterion for PHP/Laravel services: run 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.
  • Developer-experience roadmap. Position PHPCS as the standards-enforcement layer in a broader quality stack: PHPCS for style and conventions, PHPStan/Psalm for static/type analysis, security scanners for vulnerabilities, and tests for behavior. Sequence adoption from pre-commit to CI to full-repo enforcement.
  • Build vs buy. Adopt the mature OSS engine and build only your ruleset and custom sniffs. Rebuilding a PHP tokenizer/linter is not product-differentiating; encoding team conventions is.
  • Policy-as-code. Use 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.
  • Use cases to prioritize. PR review automation, legacy-code cleanup with baselines, onboarding consistency, IDE/pre-commit feedback, and audit evidence for engineering standards. Track violations per PR, auto-fix rate, style-related review comments avoided, and time-to-first-review.
  • Do not use it for. Deep type analysis, security vulnerability detection, runtime correctness, or performance profiling. It is a coding-standard linter, not a security or QA replacement.

When to Consider This Package

  • Consider it when you have a PHP/Laravel codebase with multiple contributors, a CI pipeline, and a need for consistent standards plus automated fixes.
  • Strong fit if you want a permissively licensed, mature dev-only dependency with signed PHARs, Composer/Phive installation, PSR-12 defaults, and a custom-sniff extension model.
  • Consider it if you need to encode team-specific rules that generic formatters cannot express, and you can own a ruleset, baseline, and version-update cadence. Dependent-count metadata is a weak signal for CLI dev tools; validate maintainer activity and real-world usage directly.
  • Look elsewhere or deprioritize if:
    • You need type safety or bug detection → PHPStan/Psalm.
    • You need security scanning → dedicated SAST/dependency scanners.
    • You only need opinionated formatting and already use Laravel Pint/PHP-CS-Fixer; adding PHPCS may duplicate tooling and create conflicting fixes.
    • The codebase is tiny, has no CI, or the team cannot maintain rulesets and baselines.
    • You cannot tolerate patch releases changing reported messages or fixes; mitigate with pinned versions and scheduled upgrades.
    • You need syntax support for brand-new PHP features immediately; PHPCS may add runtime support before full syntax support.
    • Your stack is not PHP.
  • Validate PHP version support (7.2+; PHP 8.5 runtime support in 4.0.1) and test custom sniffs against your framework version before rollout.

How to Pitch It (Stakeholders)

  • Executive summary: PHP_CodeSniffer is a low-cost, mature, BSD-3-licensed development tool that automates PHP coding standards and fixes. It is not a runtime dependency and does not change product behavior; it improves delivery quality, review efficiency, and onboarding consistency. Adopt it as a CI/pre-commit quality gate, not as a customer-facing feature.
  • Engineering summary: Install via Composer 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.
  • Stakeholder framing: “Buy the engine, build the rules.” The package is the commodity tokenizer/linter; your differentiated value is the standards and guardrails you encode. Expect fewer style nitpicks in code review, more consistent code, faster onboarding, and measurable compliance. Main risks are developer friction, duplicate tooling with Pint, false positives, and version drift—mitigate with baselines, scoped CI checks, and a named owner for the ruleset.
  • Success measures: percentage of PHP PRs passing the gate, auto-fix rate, style-related review comments avoided, time-to-first-review, and count of active custom rules.
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.
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings
coleus/apps
seampact/laravel
emmyconceptng/laravel-ng-postcode
jjsquady/round-robin
skyraptor/chatter
edlugz/sasapay
abbasudo/artisan-route