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

Code Sniffer Laravel Package

php-collective/code-sniffer

PHP_CodeSniffer ruleset from PhpCollective. PSR-2 compliant with many extra sniffs/fixers (incl. PSR-12) plus an optional stricter standard (PhpCollectiveStrict). Install via Composer and run phpcs/phpcbf, or wire into CI/IDE.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Enforce consistent coding standards across PHP/Laravel projects, reducing onboarding friction and technical debt.
  • Automate code quality checks in CI/CD pipelines, catching violations early (e.g., PSR-2/PSR-12 compliance, naming conventions).
  • Build vs. Buy: Avoid reinventing custom linting rules; leverage this package’s 240+ sniffs (including stricter PhpCollectiveStrict) to standardize teams.
  • Use Cases:
    • New projects: Enforce best practices from day one.
    • Legacy codebases: Gradually migrate with configurable severity (e.g., silence rules during transition).
    • Open-source contributions: Align with PHP-FIG standards while adding project-specific rules.
    • Team collaboration: Reduce merge conflicts by auto-fixing formatting (e.g., phpcbf).

When to Consider This Package

  • Adopt if:
    • Your team uses PHP 8.1+ (minimum requirement).
    • You need PSR-2/PSR-12 compliance with additional Laravel-specific sniffs (e.g., Eloquent naming, Blade conventions).
    • You want CI integration (e.g., block PRs with violations) or IDE tooling (e.g., PHPStorm shortcuts).
    • Your project requires customizable strictness (e.g., PhpCollectiveStrict for new code, lenient rules for legacy).
  • Look elsewhere if:
    • You’re using PHP < 8.1 (compatibility risk).
    • Your team prefers alternative standards (e.g., PHP-CS-Fixer for auto-fixing only).
    • You need JavaScript/TypeScript linting (use ESLint/TSLint instead).
    • Your project is small-scale and lacks CI/CD pipelines (manual checks may suffice).

How to Pitch It (Stakeholders)

For Executives: "This package standardizes our PHP codebase, reducing bugs and onboarding time by enforcing best practices automatically. It integrates seamlessly with CI/CD (e.g., CircleCI) and IDEs like PHPStorm, saving dev hours on manual reviews. For example, it catches issues like inconsistent naming or missing docblocks—problems that cost us ~$X/year in fixes. We can start with PhpCollective (PSR-2/PSR-12) and later adopt PhpCollectiveStrict for new features."

For Engineers: *"This is a drop-in replacement for custom linting rules. Key benefits:

  • 240+ sniffs (PSR-compliant + Laravel-specific, e.g., Eloquent method naming).
  • Auto-fix common issues with phpcbf (e.g., indentation, braces).
  • IDE integration: Run checks with Ctrl+Comma in PHPStorm.
  • CI-friendly: Add vendor/bin/phpcs to your pipeline to block violations.
  • Customizable: Silence rules during migration or add project-specific sniffs. Example workflow:
composer require --dev php-collective/code-sniffer
composer cs-check  # Runs PHPCS with PhpCollective rules

No reinventing the wheel—just enforce consistency at scale."*

For Developers: *"This makes your code look and work better with minimal effort:

  • Fix formatting in bulk with composer cs-fix.
  • Catch errors early in PRs (e.g., missing @return tags).
  • Avoid merge conflicts from style differences. Try it:
# Check your code
composer cs-check

# Fix auto-fixable issues
composer cs-fix

Pro tip: Add phpcs.xml to your repo to customize rules (e.g., stricter for new files)."*

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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport