mmoreram/php-formatter
PHP code formatter with CLI and configurable rules to standardize style across a project. Formats files or entire directories, helps enforce clean, consistent code, and integrates easily into development workflows and CI.
mmoreram/php-formatter) appears to be a legacy tool for PHP code formatting (e.g., auto-indentation, alignment, and style normalization). If the Laravel application relies on PSR-12 compliance or custom PHP-CS standards, this package could integrate as a pre-commit hook or build-time tool—but its 2017 release date and archived status raise concerns about compatibility with modern Laravel (v10+) and PHP (v8.1+)..php-cs-fixer.dist.php).php-formatter:fix), it could integrate via:
| Risk Area | Severity | Mitigation |
|---|---|---|
| PHP Version Mismatch | Critical | Requires PHP 7.2 polyfills or containerization (Docker). |
| Tooling Duplication | High | Conflicts with PHP-CS-Fixer/Pint; may need .formatterignore exclusions. |
| Maintenance Burden | High | Archived package; no security updates or Laravel-specific fixes. |
| Performance Overhead | Medium | Legacy code may slow CI/CD pipelines. |
| Team Adoption | Medium | Requires documentation/training for non-standard tooling. |
Why not PHP-CS-Fixer/Pint?
Migration Path
Compatibility
Operational Trade-offs
Assessment Phase:
mmoreram/php-formatter vs. PHP-CS-Fixer/Pint.Pilot Integration:
# Example: Exporting rules to PHP-CS-Fixer
find . -name "*.php" | xargs php-formatter fix --dry-run | tee formatter-rules.txt
Then configure PHP-CS-Fixer to match the output.Full Adoption:
.gitattributes/.editorconfig to enforce new standards.| Integration Point | Compatibility Risk | Solution |
|---|---|---|
| PHP Version | PHP 7.2 vs. Laravel’s PHP 8.1+ | Use Docker/PHP-Brew to isolate execution. |
| Composer Autoload | Missing autoload in package |
Manually require via composer.json or vendor patching. |
| Laravel Artisan | No native Laravel integration | Create a custom Artisan command: php artisan format:legacy. |
| CI/CD Pipelines | Slow execution or failures | Cache dependencies; run in parallel with other checks. |
| Editor/IDE Support | No VSCode/PhpStorm plugins | Use EditorConfig or PHP-CS-Fixer’s IDE integrations instead. |
Phase 1 (1–2 weeks):
app/ directory).Phase 2 (2–4 weeks):
config/, exclude vendor/).Phase 3 (Ongoing):
composer.json or phpunit versions.composer.json overrides:
"extra": {
"laravel": {
"dont-discover": ["vendor/mmoreram/php-formatter"]
}
}
| Failure Scenario | Impact | Mitigation |
|---|---|---|
| PHP Version Incompatibility | CI/CD pipeline failures | Use tools.php in Docker or PHP-Brew. |
| Formatting Drift | Merge conflicts, inconsistent code | Enforce via pre-commit hooks + CI blocking. |
| Package Abandonment | Security risks (e |
How can I help you explore Laravel packages today?