Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. PHP
  3. PHP CS Fixer

PHP CS Fixer

MITPHPv3.95.1

A tool that automatically fixes PHP code to follow coding standards and modernizes codebases.

Visit WebsiteGitHubGitHub
13.5k stars1.6k forks0 contributors

What is PHP CS Fixer?

PHP CS Fixer is a tool that automatically detects and fixes PHP coding standards issues in your code. It saves developers from tedious manual fixes, especially in large projects, by enforcing consistent styles and modernizing code towards newer PHP and PHPUnit versions.

Target Audience

PHP developers and teams working on projects that require consistent coding standards, such as those following PER-CS, Symfony, or custom style guides. It is particularly useful for large codebases where manual style fixes are impractical.

Value Proposition

Developers choose PHP CS Fixer because it not only identifies coding standards violations but also automatically fixes them, reducing manual effort. It offers flexibility with built-in rule sets for popular standards, custom configuration for team-specific styles, and features for code modernization to newer PHP and PHPUnit versions.

Overview

A tool to automatically fix PHP Coding Standards issues

Use Cases

Best For

  • Automatically enforcing PHP coding standards like PER-CS or Symfony in a codebase.
  • Modernizing legacy PHP code to newer PHP versions using auto-migration rule sets.
  • Ensuring consistent code style across large projects with minimal manual intervention.
  • Integrating coding standards fixes into CI/CD pipelines for automated checks.
  • Creating and applying custom coding rules for team-specific or project-specific style guides.
  • Upgrading PHPUnit test code to newer versions with dedicated migration rule sets.

Not Ideal For

  • Projects relying exclusively on PHP_CodeSniffer for sniffing without auto-fixing capabilities
  • Teams that enforce coding standards through manual peer review for educational purposes
  • Codebases using PHP versions not yet officially supported by PHP CS Fixer

Pros & Cons

Pros

Built-in Rule Sets

Includes standards like PER-CS, Symfony, and the opinionated PhpCsFixer set, reducing configuration time and ensuring consistency.

Code Modernization

Offers auto-migration rule sets for upgrading to newer PHP and PHPUnit versions, automating tedious refactoring tasks.

Custom Rules Support

Allows creation of custom rules for team-specific styles, as documented, providing flexibility beyond built-in options.

Auto Rule Bases

Provides `@auto` and `@auto:risky` sets for a good starting point, simplifying initial setup without extensive tuning.

Cons

Delayed PHP Version Support

Support for the latest PHP versions can lag, requiring the `--allow-unsupported-php-version` flag for risky use, as noted in the documentation.

Limited Native Editor Integration

Only PhpStorm has native support; other editors rely on community plugins which may be less maintained or reliable.

Risk with Risky Rules

Risky rules, like those in auto-migration sets, can introduce breaking changes if not tested thoroughly, as warned in the rule sets docs.

Frequently Asked Questions

Quick Stats

Stars13,495
Forks1,630
Contributors0
Open Issues47
Last commit2 days ago
CreatedSince 2012

Tags

#composer#automated-fixes#editor-integration#coding-standards#code-style#ci-cd#code-quality#php#development-tools#static-analysis

Built With

C
Composer
P
PHP

Links & Resources

Website

Included in

PHP32.5k
Auto-fetched 1 day ago

Related Projects

Laravel PintLaravel Pint

Laravel Pint is an opinionated PHP code style fixer for minimalists.

Stars3,119
Forks186
Last commit3 days ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub