gyro/coding-standard
Gyro Coding Standard is a PHP coding-standard package forked from doctrine/coding-standard, incorporating Tideways’ style changes. Use it to enforce consistent code formatting and quality rules across your projects via automated tooling.
php-cs-fixer or standalone PHPCS).doctrine/coding-standard with Tideways-specific tweaks, suggesting it enforces strict but pragmatic rules (e.g., property hooks syntax support, PHP 8+ compatibility). This could complement Laravel’s PSR-12 baseline or replace it entirely if stricter rules are desired.__construct vs. constructor in PHP 8).vendor/bin/phpcs). Integration requires:
composer.json (require-dev).ruleset.xml or CLI flags).phpcs) or CI gates (GitHub Actions/GitLab CI).Route::get() callbacks) violate Gyro’s rules.public visibility for properties, conflicting with Laravel’s protected/private conventions for model attributes.phpcs --cache-file).Basic or PSR12 subsets)?phpcs CLI or Laravel packages like laravel-phpcs.phpcs action), GitLab CI, or custom scripts.phpcs --standard=PSR12).composer.json:
"require-dev": {
"gyro/coding-standard": "^1.2"
}
phpcs.xml:
<config name="standard" value="Gyro"/>
vendor/bin/phpcs --standard=Gyro src/
| Step | Action | Owner | Dependencies |
|---|---|---|---|
| 1 | Add Gyro standard to composer.json |
DevOps/TPM | None |
| 2 | Configure PHPCS ruleset | Backend Engineer | Gyro package installed |
| 3 | Run PHPCS on sample files | QA/TPM | PHPCS config |
| 4 | Document exceptions (if any) | TPM | PHPCS output |
| 5 | Integrate into CI (warning) | DevOps | CI pipeline access |
| 6 | Add pre-commit hook | Frontend/Backend | Husky/Git hooks |
| 7 | Enforce in CI (blocking) | DevOps | Step 5 complete |
php-cs-fixer.custom_rules.xml if Gyro lacks Laravel-specific rules.protected $fillable in models.public properties")..phpcs.xml templates for VS Code/PHPStorm.phpcs --parallel for faster CI runs.--diff flag).| Risk | Mitigation |
|---|---|
| CI Blockages | Start with warnings; phase in blocking rules. |
| Rule Conflicts | Document exceptions; consider a hybrid ruleset. |
| Maintenance Neglect | Fork Gyro if updates stall; contribute upstream. |
| Performance Bottlenecks | Cache results; use --cache-file. |
| Tooling Incompatibility | Test with Laravel Forge/Envoyer early. |
90% of PRs pass PHPCS checks within 3 months.
How can I help you explore Laravel packages today?