Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Php Formatter

Php Formatter Laravel Package

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.

View on GitHub
Deep Wiki
Context7

PHP Formatter is a PHP developer friendly set of tools

Frequently asked questions about Php Formatter
Can mmoreram/php-formatter work with Laravel 10+ and PHP 8.1+?
No, this package is archived and only supports PHP ≤7.2. To use it with Laravel 10+, you’d need a Docker container with PHP 7.2 or polyfills, but this introduces complexity and isn’t recommended. Modern Laravel apps should use PHP-CS-Fixer or Pint instead.
How do I install mmoreram/php-formatter in a Laravel project?
Run `composer require mmoreram/php-formatter`. However, due to PHP version constraints, you’ll likely need to isolate it in a Docker container or use a Composer script to invoke it externally. This isn’t a seamless Laravel integration.
Does this package support PSR-12 or Laravel’s coding standards?
The package predates PSR-12 and lacks explicit support for Laravel’s standards. You’d need to manually configure its rules or risk inconsistencies with modern tooling like PHP-CS-Fixer, which natively supports PSR-12 and Laravel’s defaults.
Can I integrate this formatter into Laravel’s Artisan CLI?
Yes, but with effort. You’d need to create a custom Artisan command to shell out to the formatter’s CLI. This approach is fragile and not recommended for production—modern alternatives like Pint integrate natively via `php artisan pint`.
Will this package slow down my CI/CD pipeline?
Potentially. The package is legacy and may not optimize for performance. Modern tools like PHP-CS-Fixer or Pint are faster and designed for CI workflows. If speed is critical, avoid this package and use a maintained alternative.
Are there security risks using an archived PHP package?
Yes. Archived packages receive no security updates, leaving vulnerabilities unpatched. Laravel 10+ mandates modern dependencies; using this package violates best practices. Migrate to PHP-CS-Fixer or Pint for active maintenance and security.
How do I configure mmoreram/php-formatter for a Laravel project?
The package uses a CLI-based config (e.g., `--rules` flags). However, its syntax isn’t Laravel-native, and rules may conflict with existing tooling. For example, you’d need to exclude vendor directories manually, unlike Pint’s zero-config approach.
What’s a better alternative to this formatter for Laravel?
Use **Laravel Pint** (official, zero-config, built on PHP-CS-Fixer) or **PHP-CS-Fixer** (highly configurable). Both support PSR-12, Laravel’s standards, and modern PHP. Pint is ideal for quick adoption, while PHP-CS-Fixer offers granular control.
Can I migrate existing formatting rules from this package to PHP-CS-Fixer?
Partially. Run the formatter in dry mode (`php-formatter fix --dry-run`) to generate a baseline, then manually map its styles to PHP-CS-Fixer’s config (`.php-cs-fixer.dist.php`). This is error-prone; test thoroughly before full adoption.
Does this package work with Laravel’s IDE Helper or other third-party formatters?
Unlikely. The package lacks Laravel-specific integrations and may conflict with tools like IDE Helper or Laravel Pint. Modern alternatives are designed to coexist with Laravel’s ecosystem, reducing friction.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor
spatie/laravel-javascript-views