e-lodgy/coding-standard
E-Lodgy’s shared Easy Coding Standard (ECS) configuration for PHP projects. Install via Composer, import the provided ecs.php, and apply consistent formatting and code style rules across your src, tests, and config files.
Purpose Alignment:
Tooling Ecosystem:
level: 5 for strict checks). Requires PHPStan setup (composer require --dev phpstan/phpstan).^9.6.x (no breaking changes; Laravel projects typically use PHPUnit for testing).actions/checkout@v4; irrelevant to Laravel integration).Enhanced Feasibility:
phpcs + phpstan.phpstan.neon + phpcs.xml).phpstan and phpcs steps).Customization Risk:
phpstan.neon.| Risk Area | Severity | Mitigation Strategy |
|---|---|---|
| PHPStan False Positives | High | Audit Laravel-specific code paths; override rules. |
| Tooling Overhead | Medium | Benchmark CI runtime; parallelize with tests. |
| Dependency Bloat | Low | PHPUnit updates are safe; PHPStan is optional. |
| Maintenance Burden | Low | MIT license; fork if E-Lodgy stagnates. |
PHPStan Adoption Readiness:
Rule Compatibility:
__get(), magic methods)?phpstan:disallowDynamicProperties break Illuminate\Support\Facades\Log?Enforcement Strategy:
Long-Term Viability:
Target Tools:
phpcs) + PHPStan (new).laravel-pint (for auto-fixing) or rector (for refactoring).phpcs and phpstan.Laravel-Specific Considerations:
phpstan/extension-installer for framework-specific rules).phpstan for type safety and phpcs for style.pint to auto-fix phpcs violations pre-commit.Assessment Phase (2–3 weeks):
phpstan and phpcs locally.psr12, symfony).Pilot Phase (3–4 weeks):
phpcs as warnings; gather team feedback.app/Providers/FacadeServiceProvider).Full Rollout (2–3 weeks):
phpcs as blocking.psr12 alone).Illuminate\Support\Facades\Log::info() (dynamic calls).__get, __set) in service providers.phpstan.neon:
excludes:
- app/Providers/FacadeServiceProvider.php
| Step | Priority | Dependencies |
|---|---|---|
| Audit PHPStan rules | High | Identify Laravel-specific conflicts. |
| Tooling setup | High | phpstan + phpcs must be installed. |
| CI integration | Medium | Requires CI access; parallelize steps. |
| Rule customization | As-needed | Only if conflicts arise. |
| Team training | Low | Optional but recommended. |
phpstan and phpcs locally.phpstan and phpcs in parallel CI jobs.phpstan results (e.g., GitHub Actions cache).app/ directory).| Failure Scenario | Impact | Mitigation |
|---|---|---|
| CI breaks due to PHPStan | High (blocks merges) | Start as warnings; phase in enforcement. |
| Overly strict PHPStan rules | Medium (team pushback) | Allow exceptions; customize phpstan.neon. |
| Tooling misconfiguration | Low ( |
How can I help you explore Laravel packages today?