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

sylius-labs/coding-standard

Battle-tested Sylius coding standard for PHP. Install via Composer and import the provided ecs.php into your EasyCodingStandard (ECS) config to apply consistent formatting and rules across your project. Includes guidance for migrating from YAML to PHP configs.

View on GitHub
Deep Wiki
Context7
## Technical Evaluation
### **Architecture Fit**
- **Purpose Alignment**: Remains unchanged. This is still a **coding standard configuration** for PHP (via EasyCodingStandard), enforcing PSR-12, Sylius-specific rules, and custom conventions. No functional runtime changes.
- **Non-Invasive**: Still integrates via **Composer** and **ECS configuration**, requiring no Laravel core modifications.
- **Best Practice Enforcement**: Aligns with Laravel’s PSR standards while adding Sylius-specific rules. Useful for **unified code quality** in multi-project PHP ecosystems.

### **Integration Feasibility**
- **Low Coupling**: Unchanged. No runtime behavior modification; purely a **static analysis tool**.
- **Dependency Lightweight**: Still requires `symplify/easy-coding-standard` (~50KB config).
- **Laravel Compatibility**: Works with any PHP project, including Laravel, but **new conflict with ECS v13.1.3+** (see below).

### **Technical Risk**
- **ECS Version Conflict**:
  - **New Risk**: This release introduces a **conflict with ECS v13.1.3+** (PR #64). Teams using **ECS ≥13.1.3** must either:
    - Downgrade ECS (`<13.1.3`), or
    - **Override the conflicting rule** in their `ecs.php`.
  - **Impact**: Potential **build failures** if ECS auto-updates in CI/CD.
- **False Positives/Negatives**: Still a risk due to Sylius/Laravel naming conflicts (e.g., `App\Services\*` vs. Sylius interfaces).
- **Rule Maintenance**: Sylius-specific rules may still **deprecate or evolve**, requiring updates.
- **CI/CD Pipeline Impact**: Unchanged, but now includes **version pinning risk** for ECS.

### **Key Questions**
1. **ECS Version Dependency**:
   - Should the team **pin ECS to `<13.1.3`** to avoid conflicts, or **override the rule** in `ecs.php`?
   - Example override:
     ```php
     $ecsConfig->skip([ConflictRule::class]); // Hypothetical; check actual rule class.
     ```
2. **Rule Conflict Resolution**:
   - How will Laravel’s conventions (e.g., Facades, Service Providers) interact with Sylius’s updated rules?
   - Are there **new exceptions** needed for Laravel-specific patterns?
3. **Adoption Strategy**:
   - Should this package **replace or supplement** existing ECS configs? (Risk of duplication with ECS v13.1.3+.)
   - How will the team **handle ECS version updates** in CI/CD?
4. **Performance**:
   - Will the new conflict **slow down CI/CD** if not properly overridden?
5. **Long-Term Maintenance**:
   - Who will **monitor Sylius/ECS updates** and adjust the config?
   - Should local overrides be **documented** for future maintainers?

---

## Integration Approach
### **Stack Fit**
- **Tooling Compatibility**:
  - **ECS Integration**: Still works with `symplify/easy-coding-standard`, but **now requires version awareness** (ECS `<13.1.3` or rule overrides).
  - **IDE Support**: Unchanged (PHPStorm, pre-commit hooks).
  - **CI/CD**: Still pluggable, but **ECS version must be managed**.
- **Laravel-Specific Considerations**:
  - **No Core Changes**: Safe to adopt, but **new risk with ECS updates**.
  - **Package Overrides**: Critical for teams using ECS ≥13.1.3.

### **Migration Path**
1. **Installation** (unchanged):
   ```bash
   composer require --dev sylius-labs/coding-standard symplify/easy-coding-standard
  1. Configure ECS with Conflict Handling:
    • Option 1: Pin ECS to <13.1.3 in composer.json:
      "require-dev": {
          "symplify/easy-coding-standard": "^13.0 || ^12.0"
      }
      
    • Option 2: Override the conflicting rule in ecs.php:
      return static function (ECSConfig $ecsConfig): void {
          $ecsConfig->import(__DIR__ . '/vendor/sylius-labs/coding-standard/ecs.php');
          // TODO: Add override for the ECS v13.1.3+ conflict (check PR #64 details).
          $ecsConfig->skip([/* ConflictRuleClass */]); // Hypothetical; verify actual class.
      };
      
  2. Migrate from YML: Unchanged (use symplify/config-transformer).
  3. CI/CD Setup:
    • Add version pinning or overrides to workflows:
      - name: Install with ECS pinned
        run: composer require symplify/easy-coding-standard:^12.0
      - name: Run ECS
        run: composer ecs
      

Compatibility

  • PHP Version: Still PHP 8.1+.
  • Laravel Version: No direct dependency, but ECS version conflict now applies.
  • Rule Overrides: Mandatory for ECS ≥13.1.3. Verify the exact conflicting rule class in the PR #64.
  • ECS Version: Hard dependency on <13.1.3 unless overridden.

Sequencing

  1. Phase 1: Local Adoption
    • Install and test locally with composer ecs:check.
    • Resolve ECS version conflict (pin or override) immediately.
    • Configure pre-commit hooks (e.g., Husky).
  2. Phase 2: CI/CD Integration
    • Pin ECS version or add overrides to CI.
    • Monitor for false positives and adjust rules.
  3. Phase 3: Enforcement
    • Fail builds on violations (after grace period).
    • Document exceptions for the team.

Operational Impact

Maintenance

  • Increased Effort:
    • New: Must monitor ECS updates and Sylius rule changes.
    • Pinning Strategy: Requires composer.json updates if ECS auto-updates.
    • Local Overrides: Teams using ECS ≥13.1.3 must maintain custom rules.
  • Documentation:
    • Add notes on ECS version compatibility and override steps.
    • Example:

      "This package conflicts with ECS v13.1.3+. Pin to <13.1.3 or override ConflictRule in ecs.php."

Support

  • Troubleshooting:
    • New Issue: "ECS fails with version ≥13.1.3" → Check pinning/overrides.
    • Debug with composer ecs --debug.
  • Community:
    • Limited Sylius-specific support; rely on Symplify’s ECS docs or GitHub issues.
    • New: Report conflicts to SyliusLabs/CodingStandard if unresolved.
  • Laravel-Specific Help:
    • May still need custom rules for Laravel patterns (e.g., Facade naming).

Scaling

  • Performance:
    • Unchanged, but ECS version conflicts may introduce delays if not pinned/overridden.
    • Mitigate with --parallel and caching.
  • Team Adoption:
    • Onboarding cost: Now includes ECS version management.
    • Gradual rollout: Start with a subset of rules (e.g., PSR-12 only), then add Sylius rules.

Failure Modes

Failure Scenario Impact Mitigation
ECS ≥13.1.3 fails CI pipeline Blocked merges Pin ECS or override the conflicting rule.
Rule conflicts with Laravel Manual overrides needed Document exceptions in ecs.php.
Outdated Sylius rules Broken builds after package update Pin version or update rules proactively.
Slow CI execution Flaky pipelines Cache ECS results, run in parallel.
New: ECS auto-updates in CI Unexpected failures Pin ECS version in composer.json or CI.

Ramp-Up

  • Developer Onboarding:
    • 1-2 hours: Install, resolve ECS version conflict, run locally.
    • 1 day: Resolve initial rule conflicts and document overrides.
  • Team Training:
    • New Topic: "ECS Version Pinning and Overrides."
    • Example: "Always pin ECS to <13.1.3 or add skip([ConflictRule]) to ecs.php."
  • Documentation:
    • Update ECS_RULES.md to include:
      • ECS version compatibility table.
      • Steps to override the
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.
make-dev/orca
dmstr/symfony-system-resources-bundle
dmstr/symfony-job-queue-bundle
dmstr/openapi-json-schema-bundle
dmstr/keycloak-security-bundle
dmstr/doctrine-audit-log-bundle
dmstr/api-platform-utils-bundle
dmstr/api-configuration-bundle
chrisdev/ux-components
baks-dev/finances
emuniq/filament-browser-notifications
syriable/filament-translator
hungnm28/livewire-form
wenprise/eloquent
crudly/encrypted
fadion/bouncy
cuci/prototurk-sdk
gos/pubsub-router-bundle
cuci/prototurk-sdk-symfony
clementtalleu/easyadmin-markdown-bundle