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
Coding Standard

Coding Standard Laravel Package

symplify/coding-standard

Opinionated PHP coding standard with 23 fixers for clean, consistent, readable code—no config required. Designed to run with Symplify Easy Coding Standard (ECS); install via Composer and auto-fix formatting like arrays, strict types spacing, line length, and method chaining.

View on GitHub
Deep Wiki
Context7

[Deprecated] Use ECS that includes this set with more new rules

Frequently asked questions about Coding Standard
Is symplify/coding-standard still recommended for new Laravel projects?
No, this package is deprecated. Use **Easy Coding Standard (ECS)** instead, which includes these rules natively. Migrate by replacing `symplify/coding-standard` with ECS’s `symplify` preset in your `ecs.php` config. The transition is seamless and future-proof.
How do I install and run this in a Laravel project?
Install via Composer: `composer require symplify/easy-coding-standard --dev`. Configure ECS in `ecs.php` with `->withPreparedSets('symplify')`. Run with `vendor/bin/ecs` (dry-run) or `vendor/bin/ecs --fix` to auto-correct. Works as a dev dependency with no runtime impact.
Does this enforce Laravel-specific coding standards like PSR-12?
Yes, it aligns with **PSR-12** (Laravel’s default standard) out of the box, including docblock formatting, array syntax, and strict types. It also handles Laravel idioms like promoted properties and constructor parameters. No Laravel-specific config is needed for basic usage.
Can I customize the rules, or is it all-or-nothing?
While the preset requires no config, you can override individual rules in `ecs.php`. For example, adjust `LineLengthFixer` or disable `ArrayListItemNewlineFixer` if your team prefers compact arrays. Use `->with()` to modify the config after loading the preset.
Will this break existing PHP-CS-Fixer or PHP_CodeSniffer setups?
Potentially. Run `vendor/bin/ecs --dry-run` first to compare output with your current tool. Some rules (e.g., line length, array formatting) may conflict. Use `->with()` to align ECS rules with your existing conventions before full adoption.
How does this integrate with Laravel’s CI/CD pipelines?
Add it to your CI (e.g., GitHub Actions) with a step like `php vendor/bin/ecs check src --no-progress-bar`. Fail builds on violations or use `--fix` to auto-correct. For pre-commit hooks, pair it with **Husky** to enforce fixes locally before commits.
Does this work with Laravel 8/9/10 and Lumen?
Yes, it’s compatible with **Laravel 8+** and Lumen. For full feature support, use **PHP 8.0+**. Tested in production environments with Laravel Forge and Homestead. No core framework modifications are required—it runs as a standalone dev tool.
What if my team has custom coding standards not covered here?
ECS is highly extensible. You can **add custom rules** or combine presets (e.g., `symplify` + `psr12`). For Laravel-specific needs, extend ECS with your own fixers or use the `@phpstan-`/`@psalm-` annotations to integrate with static analyzers like PHPStan.
How do I handle conflicts with IDEs like PHPStorm or VSCode?
Use the **ECS plugin for PHPStorm** or configure VSCode’s **PHP Intelephense** to recognize ECS rules. For auto-formatting, set up IDE shortcuts to run `vendor/bin/ecs --fix` on save. This ensures consistency between your editor and CI pipeline.
What’s the migration path if I’m already using PHP-CS-Fixer?
Start by running both tools side-by-side (`php-cs-fixer` and `ecs`) to compare outputs. Map common rules (e.g., `array_indentation` → `ArrayNotationFixer`) and update your CI/CD scripts. Gradually replace `php-cs-fixer` with ECS, using `--fix` to resolve discrepancies incrementally.
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