phpmyadmin/coding-standard
phpMyAdmin Coding Standard provides PHP_CodeSniffer rules based on the Doctrine Coding Standard. Install via Composer and run phpcs with the PhpMyAdmin standard to enforce consistent PHP style across your project.
phpmyadmin/coding-standard package remains a PHP CodeSniffer standard aligned with phpMyAdmin’s strict coding guidelines (PSR-12 + custom rules). The upgrade to doctrine/coding-standard (v11.3.0+) introduces Doctrine’s enhanced PSR-12 compliance, which may improve alignment with modern PHP/Laravel projects while retaining phpMyAdmin’s specificity.
doctrine/coding-standard (now v11.3.0) suggests tighter PSR-12 adherence, which could reduce conflicts with Laravel’s conventions (e.g., Facades, Blade files).laravel-shift/php-coding-standards).use Illuminate\Support\Facades\Log).phpcs commands; no migration required for existing pipelines..phpcs.xml, but Doctrine’s base rules may now be more permissive for Laravel’s idioms.resources/views/) remain unsupported; explicit exclusion required.doctrine/coding-standard is actively maintained (last release: 2024-05-15), reducing lag with PHP/Laravel updates.squizlabs/php_codesniffer).doctrine/coding-standard (v11.3.0+).php-cs-fixer (for auto-fixing Doctrine-compliant code).vimeo/psalm (to avoid sniff conflicts with static analysis).phpcs --standard=phpmyadmin against Laravel codebase to identify Doctrine-related changes.composer.json to use phpmyadmin/coding-standard@4.1.0.phpcs --standard=phpmyadmin --report=diff to see impact.use Illuminate\Support\Facades\*.<arg name="basePath" value="./app"/>
<arg name="exclude" value="resources/views/"/>
PSR12.Methods.CamelCapsMethodName).doctrine/coding-standard v11.3.0 is backward-compatible.^4.1.0 in composer.json to avoid surprises.| Phase | Action | Tools/Commands |
|---|---|---|
| Pre-Upgrade | Backup current .phpcs.xml and run phpcs --standard=phpmyadmin to baseline violations. |
phpcs --standard=phpmyadmin --report=json > baseline.json |
| Composer Update | Update phpmyadmin/coding-standard to 4.1.0 and run composer update. |
composer require phpmyadmin/coding-standard:4.1.0 |
| Local Testing | Run phpcs locally to compare violations with baseline. |
phpcs --standard=phpmyadmin --report=diff |
| CI Integration | Update CI job to use 4.1.0; fail on warnings. |
GitHub Actions: phpcs --standard=phpmyadmin --warning-severity=0 |
| Optimization | Override rules for Laravel-specific patterns (if needed). | Custom .phpcs.xml ruleset. |
doctrine/coding-standard for PSR-12 evolutions (e.g., PHP 8.3+ features).composer why-not phpmyadmin/coding-standard to track updates.CODE_STANDARD.md with Doctrine-specific overrides.vendor/bin/phpcs --standard=phpmyadmin --generate-baseline=.phpcs-baseline.xml
app/Http/Controllers/ naming..phpcs.xml:
<rule ref="PSR12.Namespaces.ClassName" severity="warning">
<properties>
<property name="caseSensitive" value="false"/>
<property name="className" value="Controller"/>
</properties>
</rule>
time vendor/bin/phpcs --standard=phpmyadmin app/
--cache or parallelize with php-parallel-lint.| Risk | Impact | Mitigation Strategy |
|---|---|---|
| Doctrine Rule Overreach | Flags Laravel’s Facades/Helpers. | Override specific sniffs in .phpcs.xml. |
| CI Flakiness | False failures in PRs. | Cache results; exclude tests/ from scans. |
| Fork Necessity | phpMyAdmin drops Doctrine. | Fork phpmyadmin/coding-standard early. |
| Toolchain Bloat |
How can I help you explore Laravel packages today?