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

Phpcsdevcs Laravel Package

phpcsstandards/phpcsdevcs

Opinionated PHP_CodeSniffer rules and tooling for consistent, modern PHP codebases. Includes custom standards and configs aimed at improving readability, preventing common pitfalls, and keeping teams aligned with automated linting in CI and local development.

Deep Wiki
Context7

Getting Started

This package provides a ruleset (named PHPDevCS) specifically for developers writing custom PHPCS sniffs. Begin by installing it via Composer:

composer require --dev phpcsstandards/phpcsdevcs

Then, reference it in your custom ruleset XML (e.g., ruleset.xml) to lint your own sniffs during development:

<rule ref="PHPDevCS" />

It enforces best practices and coding standards within sniff code itself—not project code—making it ideal for contributors to PHPCS-ecosystem projects or those building internal sniff libraries.

Implementation Patterns

  • Dev-time only: Include PHPDevCS in your development-only ruleset (e.g., phpcs-dev.xml). Exclude it from production CI that analyzes application code.
  • Sniff template integration: Use it in your custom sniff skeleton or project templates (e.g., via squizlabs/php_codesniffer-template) to ensure new sniffs conform to PHPCS conventions.
  • CI workflow: Add a dedicated CI job that runs PHPCS with PHPDevCS on src/Sniffs/ to catch violations in your sniffs before merging.
  • Extended rulesets: Build upon PHPDevCS in your custom ruleset to override or relax specific rules while retaining core sniff-development checks (e.g., protected vs private methods, DocBlock conventions).

Gotchas and Tips

  • Misleading name: Despite the name, you don’t need to be a PHPCS core developer—just writing any custom sniff benefits from this ruleset.
  • No target project sniffing: It will incorrectly flag your project code if used naively. Always scope its usage to --standard=PHPDevCS src/Sniffs/.
  • Strict DocBlock requirements: Enforces detailed @since, @link, and method-level annotations—use PHPDoc templates to reduce boilerplate.
  • Method visibility: Enforces protected for helper methods; violating this is common in early-stage sniff dev—review violations carefully before suppressing.
  • Test coverage integration: Combine with phpunit + phpcsdevcs in your test suite to catch style issues in test sniffs (e.g., your SniffTest.php implementations) too.
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
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
twbs/bootstrap4