← All open source projects

PHP CS Fixer

PHP-CS-Fixer/PHP-CS-Fixer

PHP CS Fixer is a tool that automatically fixes PHP code style according to selected rule sets.

Forks 1,635
Author PHP-CS-Fixer
Language PHP
License MIT
Synced 2026-06-27

In Short

PHP CS Fixer does not only detect style problems; it fixes them. A team chooses rule sets, stores configuration, and gets a consistent PHP format.

What It Is

PHP CS Fixer is a tool for automatically fixing PHP coding standards. It is useful where teams want to discuss code meaning instead of spaces, braces, and import order.

What Is Inside

The project contains ready rule sets: PER-CS, Symfony, PhpCsFixer, plus the ability to describe a team style in a configuration file. It supports files, directories, and editor integration.

How People Use It

PHP CS Fixer is usually run before commits, in quality checks, or manually when bringing a project to one consistent style.

Example

Rule Configuration

The example shows a short config: choose the Symfony rule set and apply it to the `src` directory.

Language: PHP
return (new PhpCsFixer\Config())
    ->setRules(["@Symfony" => true])
    ->setFinder(
        PhpCsFixer\Finder::create()->in(__DIR__ . "/src")
    );

Strengths

The tool’s strength is automatic fixing. Developers do not just receive a list of complaints; they can apply changes and return to the real task.

Limits

The limitation is that style is not quality. Consistent formatting helps reading, but it does not replace architecture review, tests, or behavior checks.

Project Context

PHP CS Fixer is maintained in the PHP-CS-Fixer/PHP-CS-Fixer repository; its public history starts on 2012-05-16. The primary metadata language is PHP, and the license is MIT. The project also has a dedicated site: https://cs.symfony.com.

This context keeps the page grounded in a specific repository: the project has an owner, technical base, license, change history, and real constraints of its ecosystem.

PHP CS Fixer should be evaluated through a concrete scenario: who will maintain it, where it fits in the existing stack, which updates must be tracked, and what happens if it fails. That view is more useful than installing a project just because it is popular, because open source helps only when its role in the system is clear to the team.