brandembassy/coding-standard
Opinionated PHP coding standard ruleset for enforcing consistent code style across projects. Built on common tooling (e.g., PHP_CodeSniffer) to simplify linting in CI and local development, helping teams keep formatting and conventions uniform.
app/Providers or routes/).str_* to Stringable).| Risk Area | Updated Assessment | Mitigation Strategy |
|---|---|---|
| Rule Overlap | New: Rector fixes may introduce Laravel-specific refactoring rules (e.g., for enums, attributes). | Audit Rector proposals before enabling; exclude non-critical files (e.g., tests/). |
| PHP 8.4 Dependency | Breaking: Requires PHP 8.4+ (may conflict with older Laravel versions). | Pin to a compatible version or use a feature flag for PHP 8.4-only rules. |
| Rector Complexity | New: Rector integration could increase CI runtime if overzealous. | Run Rector in dry mode (--dry-run) initially; parallelize with other tools. |
| Toolchain Fragmentation | Unchanged: Still risks dependency on Brand Embassy’s tooling. | Document alternatives (e.g., "Use laravel-shift for Laravel-specific refactoring"). |
Rector Scope:
PHP 8.4 Mandate:
Automated Refactoring:
Carbon → CarbonInterface)?Long-Term Viability:
robo tasks or pre-commit hooks (but riskier for non-trivial refactors).resources/views/ (Blade templates).app/Models/ (Eloquent enums/attributes).Assessment Phase:
php -v, composer validate).vendor/bin/rector process src --dry-run
Pilot Integration:
app/Console/).Full Rollout:
robo.phar with a --no-exec flag for safety.--allow-no-changes for stability).UPGRADE.md with PHP 8.4 migration steps.| Component | Updated Compatibility Notes |
|---|---|
| Laravel Versions | Laravel 11+ recommended (PHP 8.4+). Test with Laravel 10 if supporting older versions. |
| PHP Versions | Hard requirement: PHP 8.4+. Use polyfills or feature flags for older PHP. |
| Existing Tools | Rector may conflict with laravel-shift or pint if both modify syntax. |
| Monorepos | Per-project config needed if teams use mixed Laravel versions. |
Phase 1 (Week 1):
laravel/laravel to validate fixes.Phase 2 (Week 2-3):
--allow-no-changes.Phase 3 (Week 4+):
config/).--cache).--parallel).| Scenario | Updated Impact | Mitigation |
|---|---|---|
| Rector Overwrites Code | Data loss if --no-exec isn’t used. |
Never run --exec in CI; use dry runs only. |
| PHP 8.4 Incompatibility | Build failures in unsupported envs. | Feature flag for PHP 8.4-only rules. |
| Rule Drift | Outdated Rector fixes break code. | Pin to a stable Rector version. |
| Toolchain Bloat | CI timeouts from too many tools. | Parallelize Rector with other checks. |
How can I help you explore Laravel packages today?