phpmyadmin/coding-standard
PHP_CodeSniffer ruleset from phpMyAdmin, built on the Doctrine Coding Standard, for enforcing consistent PHP code style. Install it with Composer as a dev dependency, then run vendor/bin/phpcs --standard=PhpMyAdmin against your codebase to catch style issues early.
Architecture fit
PhpMyAdmin, consumed exclusively as a require-dev dependency and invoked from the CLI or CI. Architectural blast radius on the Laravel application is effectively zero.phpmyadmin/coding-standard → doctrine/coding-standard → slevomat/coding-standard → squizlabs/php_codesniffer. Doctrine's release cadence effectively becomes ours. phpMyAdmin's package is largely a thin override layer on top of Doctrine (releases 4.1.0, 3.0.0, 2.1.0 are all "bump doctrine").app/ PSR-4 conventions, attributes, enums, promoted constructor properties) are not what Doctrine's sniffs were designed around. Expect false positives on idiomatic Laravel and silence where Laravel-specific opinions would be valuable.phpcbf fixes a smaller subset. Running both without a nominated authority produces a reformat/re-flag loop that erodes trust in both tools. This must be resolved in design, not discovered in rollout.Integration feasibility
composer require --dev phpmyadmin/coding-standard, add <rule ref="PhpMyAdmin"/> to phpcs.xml.dist, wire a Composer script and a CI step. A single engineer can produce a working proof of concept in under a day.resources/views/ (Blade), public/, storage/, bootstrap/cache/, and typically tests/ or a relaxed ruleset for tests. Run with --extensions=php.Technical risk
Key questions
laravel-shift/php-coding-standards — a Laravel-native alternative maintained for exactly this context — before defaulting to a phpMyAdmin-tuned ruleset?Stack fit
phpcs.xml.dist, wanting a stricter-than-PSR-12 gate without authoring sniffs. Also reasonable for teams that contribute to or interoperate with phpMyAdmin.Migration path
app/ only and capture the violation count. That number is the real scope estimate. Do not give a rollout date before you have it.phpcbf — one PR; (b) genuine findings worth fixing — backlog; (c) rules that fight Laravel idiom — the actual decision input and the basis for our override file.Compatibility
^4.1.0 or exact) and commit composer.lock. Given that upstream releases are Doctrine-upgrade-driven, unpinned minors are CI-breaking changes disguised as routine updates.resources/views/, public/, storage/, bootstrap/cache/, generated code, and either exclusion or a relaxed ruleset for tests/.Sequencing
| Phase | Action | Exit criterion | Est. effort |
|---|---|---|---|
| 0. Alternatives | Benchmark against Pint and laravel-shift/php-coding-standards on ~20 representative files |
Written recommendation with violation-count comparison | 1–2 days |
| 1. Baseline | phpcs --standard=PhpMyAdmin app/ --report=summary on main |
Documented violation count + bucket split | 0.5 day |
| 2. Config spike | Author phpcs.xml.dist with exclusions and documented overrides on a branch |
Ruleset reviewed by two senior engineers | 1–2 days |
| 3. Baseline file | Generate .phpcs-baseline.xml; gate blocks only new violations |
CI green on main |
0.5 day |
| 4. PR gate | Enforce on changed files; warnings for a 2-week soak | Zero escalations from engineers | 1 sprint |
| 5. Wider enforcement | Promote to error-level repo-wide; shrink baseline sprint over sprint | Baseline trending down | 2–4 sprints |
| 6. Governance | Named owner, override rationale documented, added to onboarding | CODE_STANDARDS.md merged |
Ongoing |
Total to a stable, enforced gate: roughly one to two sprints of elapsed time and under two weeks of engineering effort, contingent on the Phase 1 violation count not being catastrophic.
Maintenance
phpcs.xml.dist with no rationale; eighteen months later nobody can distinguish phpMyAdmin's rules, Doctrine's rules, and rules disabled for a reason that no longer holds. Require a one-line comment per override — cheap now, expensive later.Support
phpcs:ignore comments and the gate silently becomes theatre.Scaling
app/ tree. If scans exceed 60–90 seconds in CI, add --cache and scope PR runs to changed files. Do the changed-files scoping regardless — it is the correct default.Failure modes
| Failure mode | Likelihood | Impact | Mitigation |
|---|---|---|---|
| Pint/PHPCS conflict loop; engineers disable both | High | High | Nominate one formatter; scope phpcs to non-formatting sniffs |
| Big-bang enforcement floods the team with violations | High if unsequenced | High | Baseline file + changed-files-only gate in Phase 4 |
| Doctrine bump breaks all open PRs | Medium | Medium | Pin versions; mandatory human review on standard bumps |
| Upstream abandonment / phpMyAdmin reprioritizes | Medium (19 stars, 0 dependents) | Medium | Fork or vendor the ruleset; switching cost is low |
| Override creep makes the ruleset undocumented and unownable | High over 12+ months | Medium | Comment-per-override; quarterly ruleset review |
Gate becomes theatre via inline phpcs:ignore |
Medium | High | Fast override-decision SLA; audit ignore-comment counts |
Ramp-up
laravel-shift/php-coding-standards, with a written recommendation and violation-count comparison as the deliverable. Given 19 stars, zero dependents, unreliable release metadata, and a strong Laravel-native alternative, the expected outcome is "Pint plus a narrow supplementary gate" or "adopt the Laravel-native standard" rather than adopting this package directly. Approving the evaluation is cheap; approving a multi-sprint rollout without it is not.How can I help you explore Laravel packages today?