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

Php Cs Fixer Custom Fixers Laravel Package

kubawerlos/php-cs-fixer-custom-fixers

Custom fixers for FriendsOfPHP PHP-CS-Fixer. Install via Composer, register the Fixers set, then enable individual rules to enforce additional style conventions (e.g., prefer class constants, remove leading global namespace slashes, tidy PHPDoc params).

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Enforcing Consistent Code Quality: Standardize PHP codebase adherence to PSR standards and custom team conventions, reducing review cycles and onboarding friction.
  • Automating Refactoring: Enable automated fixes for repetitive, low-value tasks (e.g., deprecated patterns, IDE-generated comments) to free developer time for higher-impact work.
  • Risk Mitigation: Proactively address "risky" fixes (e.g., issetarray_key_exists) during CI/CD to prevent subtle bugs in production.
  • Deprecation Strategy: Gradually phase out legacy patterns (e.g., DataProvider* fixers) by enforcing modern PHPUnit conventions via CS Fixer.
  • Build vs. Buy: Avoid reinventing custom linting rules; leverage this package to reduce maintenance overhead for team-specific coding standards.
  • Use Cases:
    • Onboarding: Automatically enforce team conventions for new hires.
    • Legacy Codebases: Clean up technical debt by fixing deprecated patterns (e.g., NoDoctrineMigrationsGeneratedCommentFixer).
    • Security: Mitigate risks from commented-out debug code (CommentedOutFunctionFixer) or unsafe references (NoReferenceInFunctionDefinitionFixer).

When to Consider This Package

  • Adopt When:

    • Your team enforces custom PHP coding standards beyond PSR-12/PSR-2.
    • You need automated fixes for deprecated patterns (e.g., Doctrine-generated comments, PhpStorm artifacts).
    • CI/CD pipelines require strict code quality gates (e.g., blocking merges for commented-out code).
    • Developers frequently argue over subjective style rules (e.g., NoUselessCommentFixer, NoTrailingCommaInSinglelineFixer).
    • You use PHPUnit and want to enforce modern best practices (e.g., PhpUnitAssertArgumentsOrderFixer).
  • Look Elsewhere If:

    • Your team prioritizes flexibility over strict enforcement (e.g., IDE-specific rules like PhpStorm comments).
    • You lack CI/CD integration to run CS Fixer automatically (manual enforcement is error-prone).
    • The package’s "risky" fixers conflict with existing logic (e.g., IssetToArrayKeyExistsFixer in multi-dimensional arrays).
    • You need real-time feedback (use PHPStan or Psalm instead for static analysis).
    • Your codebase is highly dynamic (e.g., heavy use of eval() or runtime code generation).

How to Pitch It (Stakeholders)

For Executives: "This package lets us automate 80% of our PHP code quality checks—saving 2–3 hours per developer per week on manual style fixes. By enforcing consistent standards (e.g., no commented-out debug code, modern PHPUnit practices), we’ll reduce bugs in production and speed up onboarding. It’s a low-cost, high-impact tool to professionalize our codebase, with minimal maintenance overhead (MIT license, active development)."

For Engineering Teams: *"This extends PHP CS Fixer with team-specific rules to catch issues early. For example:

  • Devs: Automatically fix deprecated patterns (e.g., Doctrine comments) and enforce best practices (e.g., array_key_exists over isset).
  • QA: Block risky changes (e.g., commented-out var_dump calls) before they reach staging.
  • Tech Leads: Standardize conventions (e.g., no trailing commas in single-line arrays) to reduce review friction. Setup is trivial (Composer install + config update), and it integrates seamlessly with GitHub Actions/GitLab CI."

For Developers: *"No more arguing about:

  • ‘Should this be self::BAR or 'bar'?’ → Automated with ClassConstantUsageFixer.
  • ‘Why is there a trailing comma here?’ → Fixed with NoTrailingCommaInSinglelineFixer.
  • ‘PhpStorm added this comment—can we remove it?’ → Gone with NoPhpStormGeneratedCommentFixer. Run it locally (./vendor/bin/php-cs-fixer fix) or in CI to keep the codebase clean. Most fixes are safe, but we’ll whitelist risky ones (e.g., IssetToArrayKeyExistsFixer) for manual review."
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.
nexmo/api-specification
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
ecotone/kafka
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata