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 Config Laravel Package

m6web/php-cs-fixer-config

Reusable PHP CS Fixer configuration from M6Web/Bedrock Streaming. Install via Composer and use the provided BedrockStreaming config in .php-cs-fixer.dist.php, with options to extend/override rules for your project or CI.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Standardization Across Teams: Enables uniform PHP code formatting (PSR-12 + Bedrock Streaming conventions) for Laravel monorepos or distributed teams, reducing merge conflicts and cognitive load.
  • Developer Velocity: Automates 80% of code style enforcement, allowing engineers to focus on business logic rather than formatting debates. Reduces time spent in PR reviews.
  • CI/CD Pipeline Hardening: Blocks non-compliant code pre-merge via make cs-ci, acting as a gatekeeper for technical debt. Integrates with GitHub Actions/GitLab CI with minimal setup.
  • Onboarding Acceleration: Provides a pre-configured, opinionated setup that new hires can adopt immediately, cutting ramp-up time by 30%+ for PHP/Laravel projects.
  • Build vs. Buy Tradeoff: Avoids the cost of maintaining a custom PHP-CS-Fixer config (development time, testing, updates) while leveraging a community-vetted, PHP 8.4-compatible solution.
  • Roadmap Alignment: Supports Laravel’s shift to PHP 8.4+ and modern PHP practices (e.g., strict types, native function calls), ensuring long-term compatibility with ecosystem updates.
  • Use Cases:
    • Laravel Monorepos: Enforce consistency across microservices or shared libraries.
    • Open-Source Contributions: Align pull requests with Bedrock Streaming’s standards (e.g., for packages like spatie/laravel-permission).
    • Legacy Modernization: Gradually adopt PSR-12 in older codebases by fixing violations incrementally.
    • Security Audits: Use php-cs-fixer’s risk-aware rules (e.g., native_function_invocation) to catch potential vulnerabilities early.

When to Consider This Package

  • Adopt If:

    • Your team uses Laravel 9+ or PHP 8.1+ and wants PSR-12 compliance with minimal effort.
    • You’re standardizing code quality across multiple repositories or teams.
    • Your CI/CD pipeline lacks a PHP linter or relies on manual code reviews for style.
    • You prioritize developer experience and want to eliminate formatting distractions.
    • Your roadmap includes PHP 8.4 upgrades or adopting modern PHP features (e.g., attributes, strict types).
    • You’re open to opinionated tooling and willing to customize rules via inheritance.
  • Look Elsewhere If:

    • Your project requires PHP < 7.4 (this package dropped support in v5.0.0).
    • You need Laravel-specific rules (e.g., app() helper usage, Blade template formatting). Consider extending the config or using a Laravel-focused alternative like shivammathur/setup-php with custom rules.
    • Your team has strong preferences for non-PSR-12 styles (e.g., Symfony’s coding standards). Use symfony/php-config instead.
    • You’re using alternative PHP frameworks (e.g., Symfony, Lumen) with divergent conventions. This package is Laravel-agnostic but PSR-12-focused.
    • Your CI/CD pipeline is already overloaded with linters (e.g., Psalm, PHPStan, ESLint). Audit existing tools before adding another.
    • You need real-time IDE integration (e.g., auto-fix on save). This package is CLI-driven but can be paired with IDE plugins like PHP-CS-Fixer’s VSCode extension.

How to Pitch It (Stakeholders)

For Executives (CTO/VP Engineering)

*"This package lets us automate 80% of PHP code quality enforcement with zero upfront engineering cost. By adopting Bedrock Streaming’s PSR-12-optimized config, we:

  • Reduce technical debt by blocking non-compliant code pre-merge (saving ~2 hours/week in PR reviews).
  • Accelerate onboarding for new hires by providing a standardized, opinionated setup.
  • Future-proof our stack with PHP 8.4 support and modern PHP practices, aligning with Laravel’s roadmap.
  • Cut CI/CD noise by integrating seamlessly with GitHub Actions/GitLab CI—no additional infrastructure needed.

It’s a low-risk, high-reward investment: minimal setup, immediate ROI in developer productivity, and long-term scalability. Think of it as ‘auto-formatting for PHP’—like Prettier for JavaScript, but for our entire codebase."*


For Engineering Leaders (Tech Leads/Architects)

*"This is a pre-configured PHP-CS-Fixer that:

  • Saves time: One command (make cs-fix) enforces PSR-12 + Bedrock Streaming’s best practices (e.g., strict types, native function calls). No more ‘style wars’ in PRs.
  • Scales effortlessly: Works out-of-the-box for Laravel projects and supports PHP 8.4. Extend rules via inheritance if needed.
  • Integrates with CI/CD: Add make cs-ci to your pipeline to block violations before they hit main. Works with GitHub Actions, GitLab CI, or CircleCI.
  • Reduces friction: Supports dry-runs (--dry-run) to preview changes and cache results (--using-cache=yes) for faster pipelines.

Key benefits: ✅ Consistency: Uniform code style across teams/repos. ✅ Velocity: Less time spent on formatting, more on features. ✅ Quality: Catches potential issues early (e.g., risky rules like native_function_invocation). ✅ Future-proof: Aligns with Laravel’s PHP 8.4+ roadmap.

Next steps:

  1. Run composer require --dev m6web/php-cs-fixer-config and configure .php-cs-fixer.dist.php.
  2. Add make cs-ci to your CI pipeline (takes <10 minutes).
  3. Customize rules if needed (e.g., disable trailing_comma_in_multiline for legacy code).

Let’s pilot this in the laravel-admin repo first to validate the impact."*


For Developers

*"Tired of wasting time on formatting debates? This package auto-fixes most style issues so you can focus on writing great code. Here’s how it works:

  • Install once: composer require --dev m6web/php-cs-fixer-config.
  • Fix locally: Run make cs-fix to auto-correct violations.
  • Check before committing: Use make cs (dry-run) to preview changes.
  • Block bad code in CI: Add make cs-ci to your pipeline—violations will fail builds.

Why it’s awesome: 🔹 PSR-12 compliant: Follows modern PHP standards out of the box. 🔹 PHP 8.4 ready: No surprises when upgrading Laravel. 🔹 Customizable: Extend rules or override defaults for your team’s needs. 🔹 Fast: Cache results to avoid redundant checks in CI.

Pro tip: Add this to your .gitignore:

.php-cs-fixer.cache

Now go write code—this handles the rest."*


For QA/DevOps

*"This package hardens our CI/CD pipeline by adding a lightweight PHP linter with zero maintenance overhead. Here’s how it fits into our workflow:

  • Pre-commit checks: Developers can run make cs locally to catch violations early.
  • CI gatekeeping: make cs-ci blocks non-compliant code in GitHub Actions/GitLab CI, reducing tech debt.
  • Performance: Cache results (--using-cache=yes) to avoid redundant checks in large repos.
  • Integration: Works alongside existing tools (Psalm, PHPStan) without conflicts.

Setup:

  1. Add to composer.json (dev dependency).
  2. Configure .php-cs-fixer.dist.php (5-minute task).
  3. Add this to your CI YAML:
    - name: PHP-CS-Fixer
      run: make cs-ci
    

Impact: ✅ Fewer merge conflicts from style differences. ✅ Consistent codebase across teams/repos. ✅ No false positives (rules are battle-tested by Bedrock Streaming).

Let’s add this to the backend pipeline next to validate the impact."*

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.
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor