A tool to automatically fix PHP Coding Standards issues

Overview

PHP CS Fixer logo

PHP Coding Standards Fixer

The PHP Coding Standards Fixer (PHP CS Fixer) tool fixes your code to follow standards; whether you want to follow PHP coding standards as defined in the PSR-1, PSR-2, etc., or other community driven ones like the Symfony one. You can also define your (team's) style through configuration.

It can modernize your code (like converting the pow function to the ** operator on PHP 5.6) and (micro) optimize it.

If you are already using a linter to identify coding standards problems in your code, you know that fixing them by hand is tedious, especially on large projects. This tool does not only detect them, but also fixes them for you.

Documentation

Installation

The recommended way to install PHP CS Fixer is to use Composer in a dedicated composer.json file in your project, for example in the tools/php-cs-fixer directory:

$ mkdir --parents tools/php-cs-fixer
$ composer require --working-dir=tools/php-cs-fixer friendsofphp/php-cs-fixer

For more details and other installation methods, see installation instructions.

Usage

Assuming you installed PHP CS Fixer as instructed above, you can run the following command to fix the files PHP files in the src directory:

$ tools/php-cs-fixer/vendor/bin/php-cs-fixer fix src

See usage, list of built-in rules, list of rule sets and configuration file documentation for more details.

If you need to apply code styles that are not supported by the tool, you can create custom rules.

Editor Integration

Dedicated plugins exist for:

Community

The PHP CS Fixer is maintained on GitHub at https://github.com/FriendsOfPHP/PHP-CS-Fixer. Bug reports and ideas about new features are welcome there.

You can reach us at https://gitter.im/PHP-CS-Fixer/Lobby about the project, configuration, possible improvements, ideas and questions, please visit us!

Contribute

The tool comes with quite a few built-in fixers, but everyone is more than welcome to contribute more of them.

Comments
  • Added More Phpdoc Fixers

    Added More Phpdoc Fixers

    TODO:

    • [x] Added phpdoc_seperation
    • [x] Fix the behaviour with some annotations like the phpunit ones - introduced a tag class
    • [x] Refactor the docblock classes to model the situation more clearly
    • [x] Add tests for the Tag class
    • [x] Add tests for the DocBlock class
    • [x] Added phpdoc_order
    • [x] Perform regression testing on league/flysystem
    • [x] Based on results from testing, make improvements
    • [x] Add phpdoc_var fixer
    • [x] Perform regression testing on symfony/symfony
    • [x] Based on results from testing, make improvements, add more test cases
    • [x] Move the phpdoc_order fixer to contrib level
    • [x] Add a phpdoc_trim fixer at symfony level, partly taken from phpdoc_separation
    • [x] Added phpdoc_no_return_void
    • [x] Review fixer orders
    • [x] Perform regression testing on guzzle/guzzle
    • [x] @see, @link, @deprecated, @since, @author, @copyright, and @license annotations should be kept together rather than forced apart by the separation fixer
    • [x] Support annotations with descriptions including bank lines
    • [x] Perform regression testing on doctrine/common
    • [x] Perform regression testing on guzzle/guzzle and symfony/symfony again
    • [x] Fix more bugs, and add more test cases
    • [x] Perform regression testing on flysystem guzzle, doctrine, symfony again
    • [x] Analyse current code coverage and cleanup code
    • [x] Add tests for the TagComparator
    • [x] Add missing DocBlock class tests
    • [x] Add tests for the Line class
    • [x] Add tests for the Annotation class
    • [x] Test on dingo/api, factory-muffin, aws sdk v2 and v3
    • [x] Discuss fixer names
    • [x] Add fixers to change var to type and type to var
    • [x] Add a fixer to ensure short descriptions end in a ., ?, or !
    • [x] Review by @keradus
    • [x] Cleanup the docblock classes
    • [x] Add a fixer to remove package and subpackage annotations
    • [x] Complete reviews and testing

    I THINK WE'RE DONE! :)

    kind/feature 
    opened by GrahamCampbell 121
  • Added EchoToPrintFixer and PrintToEchoFixer

    Added EchoToPrintFixer and PrintToEchoFixer

    Closes #1502.

    You know it so well... I think you want to make that fixer ! :D That's great ;P

    image

    If you have some concrete samples to take care of, please add it on comments. I'll add them on tests. :+1:

    Note: After that, those fixers could be merged into one with a direction option on 2.x branch.

    kind/feature 
    opened by soullivaneuh 76
  • MethodArgumentSpaceFixer - add ensure_fully_multiline option

    MethodArgumentSpaceFixer - add ensure_fully_multiline option

    Todo :

    • [x] fix broken tests
    • [x] add more test cases
      • [x] for indented methods (currently indention is hardcoded and not preserved)
      • [x] for multiline arguments
        • [x] for multiline array arguments
        • [x] for multiline function arguments
      • [x] for fix needed near opening parenthesis
      • [x] for fix needed near closing parenthesis
      • [x] for different OS line endings
      • [x] for different indention chars
      • [x] for different indention levels
      • [x] for nested arrays
    • [x] make the fixer optional
    kind/feature 
    opened by greg0ire 75
  • Exit with non-zero if invalid files were detected prior to fixing

    Exit with non-zero if invalid files were detected prior to fixing

    This PR

    • [x] asserts current exit codes for runs with and without --dry-run option for scenarios where
      • fixers were applied
      • no fixers were applied
      • invalid files were found prior to fixing
    • [x] adjusts the FixCommand to exit with non-zero if invalid files were found prior to fixing

    Follows https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/1102. See https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues/1100. Ref #1211

    kind/refactoring 
    opened by localheinz 63
  • Improving Fixer Names In 2.0

    Improving Fixer Names In 2.0

    Here are my ideas. Please discuss! :)

    | Current Name | Proposed Name | | --- | --- | | eof_ending | single_eol_at_eof | | function_call_space | no_spaces_after_method_name | | function_declaration | closure_definition_spacing | | linefeed | unix_line_endings | | multiple_use | single_statement_per_import | | parenthesis | no_spaces_inside_parenthesis | | trailing_spaces | no_trailing_whitespace | | visibility | visibility_required | | double_arrow_multiline_whitespaces | double_arrow_multiline_whitespace | | duplicate_semicolon | no_duplicate_semicolons | | multiline_array_trailing_comma | trailing_comma_multiline_array | | namespace_no_leading_whitespace | no_leading_namespace_whitespace | | single_array_no_trailing_comma | no_trailing_comma_single_array | | multiline_spaces_before_semicolon | no_whitespace_before_semicolons |

    kind/question 
    opened by GrahamCampbell 63
  • Added MethodArgumentDefaultValueFixer

    Added MethodArgumentDefaultValueFixer

    Hey guys, glad to be doing my first PR for you :).

    My colleague @dereuromark opened an issue for a new fixer suggestion a while ago. https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues/1462

    Here is the PR implementing it. I took his solution and refactored it, please feel free to have a look.

    I tried to make it as readable as possible.

    Maybe you have some suggestion on how finding the next occurrence of a Variable OR certain token might be done more conveniently. I thought I could use

    $tokens->getNextTokenOfKind(T_VARIABLE) 
    

    here, but it does not work that way ;).

    Looking forward to your feedback!

    Best regards,

    Lucas

    kind/feature 
    opened by lmanzke 61
  • PSR2 MethodArgumentSpacerFixer clean additional spaces

    PSR2 MethodArgumentSpacerFixer clean additional spaces

    PSR2 MethodArgumentSpacerFixer clean additional spaces after a comma. With this code one and only one space can be after a comma in a method call.

    4.4. Method Arguments In the argument list, there MUST NOT be a space before each comma, and there MUST be one space after each comma.

    Thanks

    kind/feature 
    opened by trilopin 61
  • [Meta] PHP 7.3 support

    [Meta] PHP 7.3 support

    This issue lists PHP 7.3 changes that are relevant to this project and tracks related issues and PR.

    Syntax changes that require new tests to make sure the tool is compatible with PHP 7.3:

    Progress tracker: https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/4184

    Relevant changes that could lead to new features (not required to make the tool compatible with PHP 7.3):

    • [ ] hrtime function has been added
    • [ ] is_countable function has been added => #4236
    • [ ] add trailing comma to multiline function calls => #4237

    Sources:

    • https://github.com/php/php-src/blob/PHP-7.3/NEWS
    • https://github.com/php/php-src/blob/PHP-7.3/UPGRADING
    kind/enhancement kind/meta 
    opened by julienfalque 60
  • Change default level to PSR2

    Change default level to PSR2

    As mentioned in the README:

    https://github.com/FriendsOfPHP/PHP-CS-Fixer#php-coding-standards-fixer

    The PHP Coding Standards Fixer tool fixes most issues in your code when you want to follow the PHP coding standards as defined in the PSR-1 and PSR-2 documents.

    Currently the default level is Symfony for reason described here:

    https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/790#issuecomment-66204192

    This tool grow up as Symfony tool, therefore the default level is SYMFONY_LEVEL.

    The tool matured and is now under friendsofphp account. To make this tool generic for any PSR2 compliant library, PSR2 should be the default level.

    kind/question 
    opened by ceeram 57
  • BracesFixer

    BracesFixer

    Braces for structure blocks, fix #98

    • [x] add missing braces
    • [x] correct single-level intend
    • [X] correct multi-level intend
    • [X] fix T_FOR token syntax
    • [X] ignore T_END* syntax
    • [X] make Travis pass
    • [X] fix #168 -> fixed in PR #488
    • [X] fix #374
    • [X] remove new line between } and T_ELSE, E_ELSEIF, T_CATCH
    • [X] detect duplicated functionality in CurlyBracketsNewlineFixer
    • [X] detect duplicated functionality in ControlSpacesFixer
    opened by keradus 57
  • Cache refactoring, better cache handling in dry-run mode

    Cache refactoring, better cache handling in dry-run mode

    This PR

    • [x] extracts a bunch of objects related to caching
    • [x] always sets the file hash, but clears it on dry-run when the file needs fixing

    Follows https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/1847.

    šŸ’ The problem is this:

    • we perform a --dry-run on Travis to determine coding style issues
    • if we don't store the file hashes during a --dry-run, we'll never have a cache containing useful data
    • if we never have a cache containing useful data, then #1076 (which aimed to be able to cache the fixer cache between builds) is rendered useless
    kind/enhancement kind/feature kind/refactoring 
    opened by localheinz 54
  • Extra empty line with phpdoc_separation

    Extra empty line with phpdoc_separation

    Bug report

    when a multiline parameter contains an @, the phpdoc_separation rule adds an extra blank line

    Code snippet that reproduces the problem

    given the following code

    class X {
        /**
         * @param array{
         *   Foo?: string,
         *   Bar?: string,
         *   @baz?: string,
         * } $input
         */
        public function __construct(array $input = [])
        {
    
        }
    }
    

    the rule, generated

     class X {
         /**
          * @param array{
          *   Foo?: string,
          *   Bar?: string,
    +     *
          *   @baz?: string,
          * } $input
          */
         public function __construct(array $input = [])
         {
     
         }
     }
    
    kind/bug 
    opened by jderusse 3
  • Let phpdoc_line_span also handle inline `/** @var */` declarations

    Let phpdoc_line_span also handle inline `/** @var */` declarations

    Feature request

    I configured phpdoc_line_span with:

    [
        'const' => 'multi',
        'method' => 'multi',
        'property' => 'multi',
    ]
    

    It would be great if it could also handle inline phpdoc declarations like:

    /** @var Form $form */
    $form = $this->createForm();
    
    kind/feature request 
    opened by ruudk 0
  • Starting new rows, that impact corrected indentation for formatting

    Starting new rows, that impact corrected indentation for formatting

    How do I get rid of this type of behavior, where the phpfixer formatting changes not only the new line, but pulls the line to the beginning of the page. This ends up impacting the collapsing of the code:

    -                                <input type="radio" name="example" class="rating" value="1" <?php if (round($score)==1) { echo 'checked'; }?>/>
    +                                <input type="radio" name="example" class="rating" value="1" <?php if (1 == round($score)) {
    +  echo 'checked';
    +}?>/>
    

    This is what is being run:

    (braces, yoda_style, binary_operator_spaces)
    
    kind/question 
    opened by webbgroup 0
  • Revert change about => alignment and use option instead

    Revert change about => alignment and use option instead

    HI @julienfalque

    The previous bugfix in https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/pull/6590 is subject to debate about yes or no it was a bug.

    The issue https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/4395 and https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/5546 consider it's a bug. The issue https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/6716 consider it's not.

    I think the best solution is

    • To revert #6590 for the option align, align_single_space, align_single_space_minimal
    • To provide this behavior inside anothers options align_by_scope, align_single_space_by_scope, align_single_space_minimal_by_scope

    This closes #6716

    The only doubt I have is if by_scope is a good suffix or if there is one more meaningful...

    opened by VincentLanglet 2
Releases(v3.13.2)
  • v3.13.2(Jan 2, 2023)

  • v3.13.1(Dec 18, 2022)

    • bug: Align all the arrows inside the same array (#6590)
    • bug: Fix priority between modernize_types_casting and no_unneeded_control_parentheses (#6687)
    • bug: TrailingCommaInMultilineFixer - do not add trailing comma when there is no break line after last element (#6677)
    • docs: Fix docs for disabled rules in rulesets (#6679)
    • docs: fix the cookbook_fixers.rst (#6672)
    • docs: Update installation recommended commands for mkdir argument (-p insteadof --parents). (#6689)
    • Make static data providers that are not using dynamic calls (#6696)
    • minor: displaying number of checked files (#6674)
    Source code(tar.gz)
    Source code(zip)
    php-cs-fixer.phar(2.57 MB)
    php-cs-fixer.phar.asc(566 bytes)
  • v3.13.0(Oct 31, 2022)

    • bug: BracesFixer - Fix unexpected extra blank line (#6667)
    • bug: fix CI on master branch (#6663)
    • bug: IsNullFixer - handle casting (#6661)
    • docs: feature or bug (#6652)
    • docs: Use case insensitive sorting for options (#6666)
    • docs: [DateTimeCreateFromFormatCallFixer] Fix typos in the code sample (#6671)
    • DX: update cli-executor (#6664)
    • DX: update dev-tools (#6665)
    • feature: Add global_namespace_import to @Symfony ruleset (#6662)
    • feature: Add separate option for closure_fn_spacing (#6658)
    • feature: general_phpdoc_annotation_remove - allow add case_sensitive option (#6660)
    • minor: AllowedValueSubset - possible values are sorted (#6651)
    • minor: Use md5 for file hashing to reduce possible collisions (#6597)
    Source code(tar.gz)
    Source code(zip)
    php-cs-fixer.phar(2.56 MB)
    php-cs-fixer.phar.asc(566 bytes)
  • v3.12.0(Oct 12, 2022)

    • bug: SingleLineThrowFixer - Handle throw expression inside block (#6653)
    • DX: create TODO to change default ruleset for v4 (#6601)
    • DX: Fix SCA findings (#6626)
    • DX: HelpCommand - fix docblock (#6584)
    • DX: Narrow some docblock types (#6581)
    • DX: Remove redundant check for PHP <5.2.7 (#6620)
    • DX: Restore PHPDoc to type rules workflow step (#6615)
    • DX: SCA - scope down types (#6630)
    • DX: Specify value type in iterables in tests (#6594)
    • DX: Test on PHP 8.2 (#6558)
    • DX: Update GitHub Actions (#6606)
    • DX: Update PHPStan (#6616)
    • feature: Add @PHP82Migration ruleset (#6621)
    • feature: ArrayPushFixer now fix short arrays (#6639)
    • feature: NoSuperfluousPhpdocTagsFixer - support untyped and empty annotations in phpdoc (#5792)
    • feature: NoUselessConcatOperatorFixer - Introduction (#6447)
    • feature: Support for constants in traits (#6607)
    • feature: [PHP8.2] Support for new standalone types (null, true, false) (#6623)
    • minor: GitHub Workflows security hardening (#6644)
    • minor: prevent BC break in ErrorOutput (#6633)
    • minor: prevent BC break in Runner (#6634)
    • minor: Revert "minor: prevent BC break in Runner" (#6637)
    • minor: Update dev tools (#6554)
    Source code(tar.gz)
    Source code(zip)
    php-cs-fixer.phar(2.55 MB)
    php-cs-fixer.phar.asc(566 bytes)
  • v3.11.0(Sep 1, 2022)

    • bug: DateTimeCreateFromFormatCallFixer - Mark as risky (#6575)
    • bug: Do not treat implements list comma as array comma (#6595)
    • bug: Fix MethodChainingIndentationFixer with arrow functions and class instantiation (#5587)
    • bug: MethodChainingIndentationFixer - Fix bug with attribute access (#6573)
    • bug: NoMultilineWhitespaceAroundDoubleArrowFixer - fix for single line comment (#6589)
    • bug: TypeAlternationTransformer - TypeIntersectionTransforme - Bug: handle attributes (#6579)
    • bug: [BinaryOperatorFixer] Fix more issues with scoped operators (#6559)
    • docs: Remove $ from console command snippets (#6600)
    • docs: Remove $ from console command snippets in documentation (#6599)
    • DX: AllowedValueSubset::getAllowedValues - fix method prototype (#6585)
    • DX: Narrow docblock types in FixerConfiguration (#6580)
    • DX: updagte @PhpCsFixer set config for phpdoc_order rule (#6555)
    • DX: Update PHPUnit config (#6566)
    • feature: Introduce configurability to PhpdocSeparationFixer (#6501)
    • feature: Introduce PER set (#6545)
    • feature: NoTrailingCommaInSinglelineFixer - Introduction (#6529)
    • feature: Support removing superfluous PHPDocs involving self (#6583)
    • minor: NoUnneededControlParenthesesFixer - Support instanceof static cases (#6587)
    • minor: PhpdocToCommentFixer - allow phpdoc comments before trait use statement. Fixes #6092 (#6565)
    Source code(tar.gz)
    Source code(zip)
    php-cs-fixer.phar(2.54 MB)
    php-cs-fixer.phar.asc(566 bytes)
  • v3.10.0(Aug 17, 2022)

    • bug: Fix error in regular_callable_call with static property (#6539)
    • bug: Fix indentation for multiline class definition (#6540)
    • bug: Fix indentation for switch ending with empty case (#6538)
    • bug: Fix indentation of comment at end of switch case (#6493)
    • bug: PhpdocAlignFixer - fix static @method (#6366)
    • bug: SingleSpaceAfterConstructFixer - fix handling open tag (#6549)
    • bug: VisibilityRequiredFixer must run before ClassAttributesSeparationFixer (#6548)
    • DX: Assert dataproviders of tests of project itself return "array" or "iterable". (#6524)
    • feature: Introduce configurability to PhpdocOrderFixer (#6466)
    • feature: WhitespaceAfterCommaInArrayFixer - add option "ensure_single_space" (#6527)
    • minor: Add test for indentation of trait conflict resolution (#6541)
    • minor: Split BracesFixer (#4884)
    • minor: TrailingCommaInMultilineFixer - Add comma to multiline new static (#6380)
    Source code(tar.gz)
    Source code(zip)
    php-cs-fixer.phar(2.54 MB)
    php-cs-fixer.phar.asc(566 bytes)
  • v3.9.6(Aug 17, 2022)

    • bug: BinaryOperatorSpacesFixer: Solve issues with scoped arrow and equal alignments (#6515)
    • bug: Fix 3 weird behavior about BinaryOperatorSpacesFixer (#6450)
    • docs: Add intersection type to types_spaces rule description (#6479)
    • DX: no need to use forked diff anymore (#6526)
    • DX: remove unused FixerFileProcessedEvent::STATUS_UNKNOWN (#6516)
    • Improve statement_indentation compatibility with braces (#6401)
    • minor: add test: multi-line comments before else indented correctly. (#3573)
    • minor: ReturnAssignmentFixer - Support for anonymous classes, lambda and match (#6391)
    Source code(tar.gz)
    Source code(zip)
    php-cs-fixer.phar(2.55 MB)
    php-cs-fixer.phar.asc(566 bytes)
  • v3.9.5(Jul 22, 2022)

    • bug: AlternativeSyntaxAnalyzer - fix for nested else (#6495)
    • bug: Fix cases related to binary strings (#6432)
    • bug: Fix trailing whitespace after moving brace (#6489)
    • bug: NoUnneededControlParenthesesFixer - Fix some curly close cases (#6502)
    • bug: TypeColonTransformer - fix for backed enum types (#6494)
    • DX: Add tests for type colon in backed enums (#6497)
    • DX: Fix CI static analysis workflow (#6506)
    • DX: Fix PHPStan errors (#6504)
    • DX: Increase PHPStan level to 6 (#6468)
    • DX: Narrow docblock types in Runner and Report (#6465)
    • DX: Narrow docblock types in Tokenizer (#6293)
    • minor: extract NoMultipleStatementsPerLineFixer from BracesFixer (#6458)
    • minor: Let PhpdocLineSpan fixer detect docblocks when seperator from token with attribute (#6343)
    Source code(tar.gz)
    Source code(zip)
    php-cs-fixer.phar(2.54 MB)
    php-cs-fixer.phar.asc(566 bytes)
  • v3.9.4(Jul 15, 2022)

  • v3.9.3(Jul 13, 2022)

  • v3.9.2(Jul 11, 2022)

  • v3.9.1(Jul 11, 2022)

    • bug: Add attributes support to statement_indentation (#6429)
    • bug: BinaryOperatorSpacesFixer - Allow to align = inside array definitions (#6444)
    • bug: BinaryOperatorSpacesFixer - Fix align of operator with function declaration (#6445)
    • bug: ConstantCaseFixer - Do not touch enum case (#6367)
    • bug: CurlyBracesPositionFixer - multiple elseifs (#6459)
    • bug: Fix #6439 issue in StaticLambda fixer (#6440)
    • bug: FullOpeningTagFixer - fix substr check for pre PHP8 (#6388)
    • bug: IncrementStyleFixer - NoSpacesInsideParenthesisFixer - prio (#6416)
    • bug: LambdaNotUsedImportFixer must run before MethodArgumentSpaceFixer (#6453)
    • bug: MethodArgumentSpaceFixer - first element in same line, space before comma and inconsistent indent (#6438)
    • bug: NoSuperfluousPhpdocTagsFixer - fix for promoted properties (#6403)
    • bug: StatementIndentationFixer - Fix indentation for multiline traits use (#6402)
    • bug: StrictComparisonFixer must rune before ModernizeStrposFixer (#6455)
    • bug: TokensAnalyzer - fix intersection types considered as binary operator (#6414)
    • DX: ISSUE_TEMPLATE hints to check applied rules (#6398)
    • DX: Add more type hints (#6383)
    • DX: Fix CI/CD issues (#6411)
    • DX: cleanup test (#6410)
    • DX: integrate PRLint (#6406)
    • feature: BlankLineBetweenImportGroupsFixer - Introduction (#6365)
    • feature: DateTimeCreateFromFormatCallFixer - Add DateTimeImmutable support (#6350)
    • feature: Extract StatementIndentationFixer from BracesFixer (#5960)
    • feature: ModernizeStrposFixer - fix leading backslash with yoda (#6377)
    • feature: NoExtraBlankLinesFixer - Add attributes option - Fix support for enum case (#6426)
    • feature: NoUnneededControlParenthesesFixer - Fix more cases (#6409)
    • feature: NoUselessNullsafeOperatorFixer - Introduction (#6425)
    • feature: OrderedTrait - Move Phpdoc with trait import (#6361)
    • feature: PhpdocOrderByValueFixer - Allow sorting of mixin annotations by value (#6446)
    • feature: TrailingCommaInMultiline - Add match support (#6381)
    • minor: Allow Composer Normalize plugin (#6454)
    • minor: ExplicitStringVariableFixer - Fix to PHP8.2 compat code (#6424)
    • minor: Extract ControlStructureBracesFixer from BracesFixer (#6399)
    • minor: NoBinaryStringFixer - Fix more cases (#6442)
    • minor: NoSuperfluousPhpdocTagsFixer - Attribute handling (#6382)
    • minor: PhpCsFixerSet - Update blank_line_before_statement config (#6389)
    • minor: Remove unnecessary PHP version constraints (#6461)
    • minor: SingleImportPerStatementFixer - fix PSR12 set (#6415)
    • minor: SingleSpaceAfterConstructFixer - add option type_colon (#6434)
    • minor: SymfonySet - Add SimpleToComplexStringVariableFixer (#6423)
    • minor: Update PHPStan (#6467)
    • minor: extract CurlyBracesPositionFixer from BracesFixer (#6452)
    Source code(tar.gz)
    Source code(zip)
    php-cs-fixer.phar(2.54 MB)
    php-cs-fixer.phar.asc(566 bytes)
  • v3.8.0(Mar 18, 2022)

    Release available also via shim package: https://github.com/PHP-CS-Fixer/shim

    • bug #6322 PhpdocTypesFixer - fix recognizing callable (kubawerlos)
    • bug #6331 ClassReferenceNameCasingFixer - Fix false hits (SpacePossum)
    • bug #6333 BinaryOperatorSpacesFixer - Fix for alignment in elseif (paulbalandan, SpacePossum)
    • bug #6337 PhpdocTypesFixer - fix recognising callable without return type (kubawerlos)
    • feature #6286 DateTimeCreateFromFormatCallFixer - Introduction (liquid207)
    • feature #6312 TypesSpacesFixer - add option for CS of catching multiple types of exceptions (SpacePossum)
    • minor #6326 Bump migration sets used to PHP7.4 (SpacePossum)
    • minor #6328 DX: .gitignore ASC file (keradus)
    Source code(tar.gz)
    Source code(zip)
    php-cs-fixer.phar(2.48 MB)
    php-cs-fixer.phar.asc(566 bytes)
  • v3.7.0(Mar 7, 2022)

    Release available also via shim package: https://github.com/PHP-CS-Fixer/shim

    • bug #6112 [BinaryOperatorSpacesFixer] Fix align of = inside calls of methods (VincentLanglet)
    • bug #6279 ClassReferenceNameCasingFixer - Fix for double arrow (SpacePossum)
    • bug #6280 Fix bunch of enum issus (SpacePossum)
    • bug #6283 ClassReferenceNameCasingFixer - detect imports (SpacePossum)
    • feature #5892 NewWithBracesFixer - option to remove braces (jrmajor)
    • feature #6081 Allow multiline constructor arguments in an anonymous classes (jrmajor, SpacePossum)
    • feature #6274 SingleLineCommentSpacingFixer - Introduction (SpacePossum)
    • feature #6300 OrderedClassElementsFixer - handle enums (gharlan)
    • feature #6304 NoTrailingCommaInSinglelineFunctionCallFixer - Introduction (SpacePossum)
    • minor #6277 Add is_scalar, sizeof, ini_get in list of compiled functions (jderusse)
    • minor #6284 ClassReferenceNameCasingFixer - Update doc (SpacePossum)
    • minor #6289 PHP7.4 - clean up tests (SpacePossum)
    • minor #6290 PHP7.4 - properties types (SpacePossum)
    • minor #6291 PHP7.4 - remove run time checks (SpacePossum)
    • minor #6292 PhpUnitDedicateAssertFixer - Fix more count cases (SpacePossum)
    • minor #6294 PhpUnitDedicateAssertFixer - add assertInstanceOf support (SpacePossum)
    • minor #6295 PhpUnitTestCaseIndicator - Check if PHPUnit-test class extends anotheā€¦ (SpacePossum)
    • minor #6298 Fix checkbashisms download ans SCA violations (SpacePossum)
    • minor #6301 BracesFixer - handle enums (gharlan)
    • minor #6302 Bump checkbashisms version (kubawerlos)
    • minor #6303 PHP8 - Utilize "get_debug_type" (SpacePossum)
    • minor #6316 bump xdebug-handler (SpacePossum)
    • minor #6327 bump polyfills (SpacePossum)
    Source code(tar.gz)
    Source code(zip)
    php-cs-fixer.phar(2.47 MB)
    php-cs-fixer.phar.asc(566 bytes)
  • v3.6.0(Feb 7, 2022)

    Release available also via shim package: https://github.com/PHP-CS-Fixer/shim

    • bug #6063 PhpdocTypesOrderFixer - Improve nested types support (ruudk, julienfalque)
    • bug #6197 FullyQualifiedStrictTypesFixer - fix same classname is imported from ā€¦ (SpacePossum)
    • bug #6241 NoSuperfluousPhpdocTagsFixer - fix for reference and splat operator (kubawerlos)
    • bug #6243 PhpdocTypesOrderFixer - fix for intersection types (kubawerlos)
    • bug #6254 PhpUnitDedicateAssertFixer - remove is_resource. (drupol)
    • bug #6264 TokensAnalyzer - fix isConstantInvocation detection for mulitple exceā€¦ (SpacePossum)
    • bug #6265 NullableTypeDeclarationForDefaultNullValueFixer - handle "readonly" aā€¦ (SpacePossum)
    • bug #6266 SimplifiedIfReturnFixer - handle statement in loop without braces (SpacePossum)
    • feature #6262 ClassReferenceNameCasingFixer - introduction (SpacePossum)
    • feature #6267 NoUnneededImportAliasFixer - Introduction (SpacePossum)
    • minor #6199 HeaderCommentFixer - support monolithic files with shebang (kubawerlos, keradus)
    • minor #6231 Fix priority descriptions and tests. (SpacePossum)
    • minor #6237 DX: Application - better display version when displaying gitSha (keradus)
    • minor #6242 Annotation - improve on recognising types with reference and splat operator (kubawerlos)
    • minor #6250 Tokens - optimize cache clear (SpacePossum)
    • minor #6269 Docs: redo warnings in RST docs to fix issue on website docs (keradus)
    • minor #6270 ClassReferenceNameCasingFixer - Add missing test cases for catch (SpacePossum)
    • minor #6273 Add priority test (SpacePossum)
    Source code(tar.gz)
    Source code(zip)
    php-cs-fixer.phar(2.46 MB)
    php-cs-fixer.phar.asc(566 bytes)
  • v3.5.0(Jan 14, 2022)

    • bug #6058 Fix Tokens::insertSlices not moving around all affected tokens (paulbalandan, SpacePossum)
    • bug #6160 NonPrintableCharacterFixer - fix for when removing non-printable character break PHP syntax (kubawerlos)
    • bug #6165 DeclareEqualNormalizeFixer - fix for declare having multiple directives (kubawerlos)
    • bug #6170 NonPrintableCharacterFixer - fix for string in single quotes, having non-breaking space, linebreak, and single quote inside (kubawerlos)
    • bug #6181 UseTransformer - Trait import in enum fix (PHP8.1) (SpacePossum)
    • bug #6188 PhpdocTo(Param|Property|Return)TypeFixer - fix for type intersections (kubawerlos)
    • bug #6202 SquareBraceTransformer - fix for destructing square brace after double arrow (kubawerlos)
    • bug #6209 OrderedClassElementsFixer - PHP8.0 support abstract private methods in traits (SpacePossum)
    • bug #6224 ArgumentsAnalyzer - support PHP8.1 readonly (SpacePossum)
    • feature #4571 BlankLineBeforeStatementFixer - can now add blank lines before doc-comments (addiks, SpacePossum)
    • feature #5953 GetClassToClassKeywordFixer - introduction (paulbalandan)
    • minor #6108 Drop support for Symfony v4 (keradus)
    • minor #6163 CI: update used PHP version (keradus)
    • minor #6167 SingleSpaceAfterConstructFixer - allow multiline const (y_ahiru, SpacePossum)
    • minor #6168 indexes -> indices (SpacePossum)
    • minor #6171 Fix tests and CS (SpacePossum)
    • minor #6172 DX: Tokens::insertSlices - groom code and fix tests (keradus)
    • minor #6174 PhpdocAlignFixer: fix property-read/property-write descriptions not getting aligned (antichris)
    • minor #6177 DX: chmod +x for benchmark.sh file (keradus)
    • minor #6180 gitlab reporter - add fixed severity to match format (cbourreau)
    • minor #6183 Simplify DiffConsoleFormatter (kubawerlos)
    • minor #6184 Do not support array of patterns in Preg methods (kubawerlos)
    • minor #6185 Upgrade PHPStan (kubawerlos)
    • minor #6189 Finder - fix usage of ignoreDotFiles (kubawerlos)
    • minor #6190 DX: DiffConsoleFormatter - escape - (keradus)
    • minor #6194 Update Docker setup (julienfalque)
    • minor #6196 clean ups (SpacePossum)
    • minor #6198 DX: format dot files (kubawerlos)
    • minor #6200 DX: Composer's branch-alias leftovers cleanup (kubawerlos)
    • minor #6203 Bump required PHP to 7.4 (keradus)
    • minor #6205 DX: bump PHPUnit to v9, PHPUnit bridge to v6 and Prophecy-PHPUnit to v2 (keradus)
    • minor #6210 NullableTypeDeclarationForDefaultNullValueFixer - fix tests (HypeMC)
    • minor #6212 bump year 2021 -> 2022 (SpacePossum)
    • minor #6215 DX: Doctrine\Annotation\Tokens - fix phpstan violations (keradus)
    • minor #6216 DX: Doctrine\Annotation\Tokens - drop unused methods (keradus)
    • minor #6217 DX: lock SCA tools for PR builds (keradus)
    • minor #6218 Use composer/xdebug-handler v3 (gharlan)
    • minor #6222 Show runtime on version command (SpacePossum)
    • minor #6229 Simplify Tokens::isMonolithicPhp tests (kubawerlos)
    • minor #6232 Use expectNotToPerformAssertions where applicable (SpacePossum)
    • minor #6233 Update Tokens::isMonolithicPhp (kubawerlos)
    • minor #6236 Annotation - improve getting variable name (kubawerlos)
    Source code(tar.gz)
    Source code(zip)
    php-cs-fixer.phar(2.45 MB)
    php-cs-fixer.phar.asc(566 bytes)
  • v3.4.0(Dec 11, 2021)

    • bug #6117 SingleSpaceAfterConstruct - handle before destructuring close brace (liquid207)
    • bug #6122 NoMultilineWhitespaceAroundDoubleArrowFixer - must run before MethodArgumentSpaceFixer (kubawerlos)
    • bug #6130 StrictParamFixer - must run before MethodArgumentSpaceFixer (kubawerlos)
    • bug #6137 NewWithBracesFixer - must run before ClassDefinitionFixer (kubawerlos)
    • bug #6139 PhpdocLineSpanFixer - must run before NoSuperfluousPhpdocTagsFixer (kubawerlos)
    • bug #6143 OperatorLinebreakFixer - fix for alternative syntax (kubawerlos)
    • bug #6159 ImportTransformer - fix for grouped constant and function imports (kubawerlos)
    • bug #6161 NoUnreachableDefaultArgumentValueFixer - fix for attributes (kubawerlos)
    • feature #5776 DX: test on PHP 8.1 (kubawerlos)
    • feature #6152 PHP8.1 support (SpacePossum)
    • minor #6095 Allow Symfony 6 (derrabus, keradus)
    • minor #6107 Drop support of PHPUnit v7 dependency (keradus)
    • minor #6109 Add return type to DummyTestSplFileInfo::getRealPath() (derrabus)
    • minor #6115 Remove PHP 7.2 polyfill (derrabus)
    • minor #6116 CI: remove installation of mbstring polyfill in build script, it's required dependency now (keradus)
    • minor #6119 OrderedClassElementsFixer - PHPUnit assert(Pre|Post)Conditions methods support (meyerbaptiste)
    • minor #6121 Use Tokens::ensureWhitespaceAtIndex to simplify code (kubawerlos)
    • minor #6127 Remove 2nd parameter to XdebugHandler constructor (phil-davis)
    • minor #6129 clean ups (SpacePossum)
    • minor #6138 PHP8.1 - toString cannot return type hint void (SpacePossum)
    • minor #6146 PHP 8.1: add new_in_initializers to PHP 8.1 integration test (keradus)
    • minor #6147 DX: update composer-normalize (keradus)
    • minor #6156 DX: drop hack for Prophecy incompatibility (keradus)
    Source code(tar.gz)
    Source code(zip)
    php-cs-fixer.phar(2.45 MB)
    php-cs-fixer.phar.asc(566 bytes)
  • v3.3.2(Nov 15, 2021)

  • v3.3.1(Nov 15, 2021)

  • v3.3.0(Nov 15, 2021)

    • bug #6054 Utils - Add multibyte and UTF-8 support (paulbalandan)
    • bug #6061 ModernizeStrposFixer - fix for negated with leading slash (kubawerlos)
    • bug #6064 SquareBraceTransformer - fix detect array destructing in foreach (SpacePossum)
    • bug #6082 PhpUnitDedicateAssertFixer must run before NoUnusedImportsFixer (kubawerlos)
    • bug #6089 TokensAnalyzer.php - Fix T_ENCAPSED_AND_WHITESPACE handling in isBinaā€¦ (SpacePossum)
    • feature #5123 PhpdocTypesFixer - support generic types (kubawerlos)
    • minor #5775 DX: run static code analysis on PHP 8.0 (kubawerlos)
    • minor #6050 DX: TypeIntersectionTransformer - prove to not touch T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG (keradus)
    • minor #6051 NoExtraBlankLinesFixer - Improve deprecation message (paulbalandan)
    • minor #6060 DX: Add upgrade guide link when next Major is available (keradus)
    • minor #6066 Clean ups (SpacePossum, kubawerlos)
    • minor #6069 DX: cleanup stub file (keradus)
    • minor #6070 Update UPGRADE-v3.md with php_unit_test_annotation/case deprecation (kubawerlos)
    • minor #6072 Update usage doc to reflect change to PSR12 default. (hannob, keradus)
    • minor #6084 Change: Remove __constructor() from RuleSetDescriptionInterface (niklam)
    • minor #6085 Dx: reuse WhitespacesAnalyzer::detectIndent (kubawerlos)
    • minor #6087 AbstractProxyFixer - more tests (SpacePossum)
    Source code(tar.gz)
    Source code(zip)
    php-cs-fixer.phar(2.14 MB)
    php-cs-fixer.phar.asc(566 bytes)
  • v2.19.3(Nov 15, 2021)

  • v3.2.1(Oct 5, 2021)

  • v3.2.0(Oct 5, 2021)

    • bug #5809 FunctionsAnalyzer - fix for recognizing global functions in attributes (kubawerlos)
    • bug #5909 NativeFunctionCasingFixer - fix for attributes and imported functions (kubawerlos)
    • bug #5920 ClassAttributesSeparationFixer - fixes & enhancements (SpacePossum)
    • bug #5923 TypeAlternationTransformer - fix for promoted properties (kubawerlos)
    • bug #5938 NoAliasFunctionsFixer - remove dir -> getdir mapping (SpacePossum)
    • bug #5941 TokensAnalyzer - isAnonymousClass bug on PHP8 (SpacePossum)
    • bug #5942 TokensAnalyzer - isConstantInvocation PHP 8 issue (SpacePossum)
    • bug #5943 NoUnusedImportsFixer - use in attribute (SpacePossum)
    • bug #5955 Fixed class_attributes_separation processing class with multiple trait imports (GrahamCampbell)
    • bug #5977 LowercaseStaticReference - SingleClassElementPerStatement - union types (SpacePossum)
    • bug #5984 RegularCallableCallFixer must run before NativeFunctionInvocationFixer (kubawerlos)
    • bug #5986 CurlyBraceTransformer - count T_CURLY_OPEN itself as level as well (SpacePossum)
    • bug #5989 NoAliasFunctionsFixer - Correct mapping (weshooper)
    • bug #6004 SwitchContinueToBreakFixer - Fix candidate check (SpacePossum)
    • bug #6005 CommentsAnalyzer - before static call (SpacePossum)
    • bug #6007 YodaStyleFixer - PHP8 named arguments support (liquid207)
    • bug #6015 CommentsAnalyzer - constructor property promotion support (liquid207)
    • bug #6020 RegularCallableCallFixer - case insensitive fixing (SpacePossum)
    • bug #6037 PhpdocLineSpanFixer - do not crash on trait imports (SpacePossum)
    • feature #4834 AssignNullCoalescingToCoalesceEqualFixer - introduction (SpacePossum)
    • feature #5754 ModernizeStrposFixer - introduction (derrabus, SpacePossum, keradus)
    • feature #5858 EmptyLoopConditionFixer - introduction (SpacePossum)
    • feature #5967 PHP8.1 - type "never" support (SpacePossum)
    • feature #5968 PHP8.1 - "readonly" property modifier support (SpacePossum)
    • feature #5970 IntegerLiteralCaseFixer - introduction (SpacePossum)
    • feature #5971 PHP8.1 - Explicit octal integer literal notation (SpacePossum)
    • feature #5997 NoSuperfluousPhpdocTagsFixer - Add union types support (julienfalque)
    • feature #6026 TypeIntersectionTransformer - introduction (kubawerlos, SpacePossum)
    • feature #6031 NoSpaceAroundDoubleColonFixer - introduction (SpacePossum)
    • feature #6047 StringLengthToEmptyFixer - introduction (SpacePossum)
    • minor #5773 NoAlternativeSyntaxFixer - Add option to not fix non-monolithic PHP code (paulbalandan)
    • minor #5887 Detect renamed rules in configuration resolver (shakaran)
    • minor #5901 DX: update PHPStan (kubawerlos)
    • minor #5906 Remove references to PHP 7.0 in tests (with updates) (kubawerlos)
    • minor #5918 Remove PHP version specific code sample constraint when not needed (kubawerlos)
    • minor #5924 PSR12 - ClassDefinition - space_before_parenthesis (SpacePossum)
    • minor #5925 DX: ProjectCodeTest - fix detection by testExpectedInputOrder (keradus)
    • minor #5926 DX: remove not needed requirements from fixtures (kubawerlos)
    • minor #5927 Symfonyset - EmptyLoopBody (SpacePossum)
    • minor #5928 PhpdocTo*TypeFixer - add more test cases (keradus)
    • minor #5929 Remove not needed PHP version checks (kubawerlos)
    • minor #5930 simplify code, more tests (SpacePossum)
    • minor #5931 logo copyright - bump year (SpacePossum)
    • minor #5932 Extract ControlStructureContinuationPositionFixer from BracesFixer (julienfalque)
    • minor #5933 Consistency invalid configuration exception for test (shakaran)
    • minor #5934 Add return types (SpacePossum)
    • minor #5949 Removed PHP 5 exception catch (GrahamCampbell)
    • minor #5952 ClassAttributesSeparationFixer - Re-add omitted only_if_meta option (paulbalandan)
    • minor #5957 Keep PHPStan cache between Docker runs (julienfalque)
    • minor #5958 Fix STDIN test when path is one level deep (julienfalque)
    • minor #5959 SymfonySet - add EmptyLoopConditionFixer (SpacePossum)
    • minor #5961 Remove duplicated method (julienfalque)
    • minor #5962 DX: Add return types (kubawerlos)
    • minor #5963 DX: extract config for special CI jobs (keradus)
    • minor #5964 DX: use modernize_strpos (keradus)
    • minor #5965 CI: don't try to execute jobs with Symfony:^3 (keradus)
    • minor #5972 PHP8.1 - FirstClassCallable (SpacePossum)
    • minor #5973 PHP8.1 - "final const" support (SpacePossum)
    • minor #5975 Tree shake PHP8.1 PRs (SpacePossum)
    • minor #5978 PHP8.1 - Enum (start) (SpacePossum)
    • minor #5982 Fix test warning (SpacePossum)
    • minor #5987 PHP8.1 - Enum (start) (SpacePossum)
    • minor #5995 Fix link to Code Climate SPEC.md in GitlabReporter (astehlik)
    • minor #5996 Fix URL to Doctrine Annotations documentation (astehlik)
    • minor #6000 Prevent PHP CS Fixer from fixing PHPStan cache files (julienfalque)
    • minor #6006 SCA/utilize PHP8.1 (SpacePossum)
    • minor #6008 SCA (SpacePossum)
    • minor #6010 SCA (SpacePossum)
    • minor #6011 NoSuperfluousPhpdocTagsFixer - Remove superfluous annotation @abstract and @final (liquid207, SpacePossum)
    • minor #6018 PhpdocLineSpan - Allow certain types to be ignored (devfrey)
    • minor #6019 Improve test coverage (SpacePossum)
    • minor #6021 Linter/*Exception - Tag as final (SpacePossum)
    • minor #6023 OrderedClassElementsFixer - PHP8.1 readonly properties support (SpacePossum)
    • minor #6027 MbStrFunctionsFixer - more details about risky (SpacePossum)
    • minor #6028 BinaryOperatorSpacesFixer - list all operators in doc (SpacePossum)
    • minor #6029 PhpUnitDedicateAssertFixer - add "assertStringContainsString" and "asā€¦ (SpacePossum)
    • minor #6030 SingleSpaceAfterConstructFixer - Add switch support (SpacePossum)
    • minor #6033 ArgumentsAnalyzerTest - add more tests (SpacePossum)
    • minor #6034 7.0|7.1 - cleanup tests (SpacePossum)
    • minor #6035 Documentation generation split up and add list. (SpacePossum)
    • minor #6048 Fix "can not" spelling (mvorisek)
    Source code(tar.gz)
    Source code(zip)
    php-cs-fixer.phar(2.14 MB)
    php-cs-fixer.phar.asc(566 bytes)
  • v3.1.0(Aug 29, 2021)

    • feature #5572 PhpdocToCommentFixer - Add ignored_tags option (VincentLanglet)
    • feature #5588 NoAliasFunctionsFixer - Add more function aliases (danog)
    • feature #5704 ClassAttributesSeparationFixer - Introduce only_if_meta spacing option (paulbalandan)
    • feature #5734 TypesSpacesFixer - Introduction (kubawerlos)
    • feature #5745 EmptyLoopBodyFixer - introduction (SpacePossum, keradus)
    • feature #5751 Extract DeclareParenthesesFixer from BracesFixer (julienfalque, keradus)
    • feature #5877 ClassDefinitionFixer - PSR12 for anonymous class (SpacePossum)
    • minor #5875 EmptyLoopBodyFixer - NoTrailingWhitespaceFixer - priority test (SpacePossum)
    • minor #5914 Deprecate ClassKeywordRemoveFixer (kubawerlos)
    Source code(tar.gz)
    Source code(zip)
    php-cs-fixer.phar(2.09 MB)
    php-cs-fixer.phar.asc(566 bytes)
  • v3.0.3(Aug 29, 2021)

    • bug #4927 PhpdocAlignFixer - fix for whitespace in type (kubawerlos)
    • bug #5720 NoUnusedImportsFixer - Fix undetected unused imports when type mismatch (julienfalque, SpacePossum)
    • bug #5806 DoctrineAnnotationFixer - Add template to ignored_tags (akalineskou)
    • bug #5849 PhpdocTagTypeFixer - must not remove inlined tags within other tags (boesing)
    • bug #5853 BracesFixer - handle alternative short foreach with if (SpacePossum)
    • bug #5855 GlobalNamespaceImportFixer - fix for attributes imported as constants (kubawerlos)
    • bug #5881 SelfUpdateCommand - fix link to UPGRADE docs (keradus)
    • bug #5884 CurlyBraceTransformer - fix handling dynamic property with string with variable (kubawerlos, keradus)
    • bug #5912 TypeAlternationTransformer - fix for "callable" type (kubawerlos)
    • bug #5913 SingleSpaceAfterConstructFixer - improve comma handling (keradus)
    • minor #5829 DX: Fix SCA with PHPMD (paulbalandan)
    • minor #5838 PHP7 - use spaceship (SpacePossum, keradus)
    • minor #5848 Docs: update PhpStorm integration link (keradus)
    • minor #5856 Add AttributeAnalyzer (kubawerlos)
    • minor #5857 DX: PHPMD - exclude fixtures (keradus)
    • minor #5859 Various fixes (kubawerlos)
    • minor #5864 DX: update dev tools (kubawerlos)
    • minor #5876 AttributeTransformerTest - add more tests (SpacePossum)
    • minor #5879 Update UPGRADE-v3.md adding relative links (shakaran, keradus)
    • minor #5882 Docs: don't use v2 for installation example (keradus)
    • minor #5883 Docs: typo (brianteeman, keradus)
    • minor #5890 DX: use PHP 8.1 polyfill (keradus)
    • minor #5902 Remove references to PHP 7.0 in tests (only removing lines) (kubawerlos)
    • minor #5905 DX: Use "yield from" in tests (kubawerlos, keradus)
    • minor #5917 Use @PHP71Migration rules (kubawerlos, keradus)
    Source code(tar.gz)
    Source code(zip)
    php-cs-fixer.phar(2.07 MB)
    php-cs-fixer.phar.asc(566 bytes)
  • v2.19.2(Aug 18, 2021)

  • v3.0.2(Aug 4, 2021)

    • bug #5816 FullyQualifiedStrictTypesFixer - fix for union types (kubawerlos, keradus)
    • bug #5835 PhpdocTypesOrderFixer: fix for array shapes (kubawerlos)
    • bug #5837 SingleImportPerStatementFixer - fix const and function imports (SpacePossum)
    • bug #5844 PhpdocTypesOrderFixer: handle callable() type (Slamdunk)
    • minor #5839 DX: automate checking 7.0 types on project itself (keradus)
    • minor #5840 DX: drop v2 compatible config in project itself (keradus)
    Source code(tar.gz)
    Source code(zip)
    php-cs-fixer.phar(2.07 MB)
    php-cs-fixer.phar.asc(566 bytes)
  • v3.0.1(Aug 2, 2021)

    • bug #5395 PhpdocTagTypeFixer: Do not modify array shapes (localheinz, julienfalque)
    • bug #5678 UseArrowFunctionsFixer - fix for return without value (kubawerlos)
    • bug #5679 PhpUnitNamespacedFixer - do not try to fix constant usage (kubawerlos)
    • bug #5681 RegularCallableCallFixer - fix for function name with escaped slash (kubawerlos)
    • bug #5687 FinalInternalClassFixer - fix for annotation with space after "@" (kubawerlos)
    • bug #5688 ArrayIndentationFixer - fix for really long arrays (kubawerlos)
    • bug #5690 PhpUnitNoExpectationAnnotationFixer - fix "expectedException" annotation with message below (kubawerlos)
    • bug #5693 YodaStyleFixer - fix for assignment operators (kubawerlos)
    • bug #5697 StrictParamFixer - fix for method definition (kubawerlos)
    • bug #5702 CommentToPhpdocFixer - fix for single line comments starting with more than 2 slashes (kubawerlos)
    • bug #5703 DateTimeImmutableFixer - fix for method definition (kubawerlos)
    • bug #5718 VoidReturnFixer - do not break syntax with magic methods (kubawerlos)
    • bug #5727 SingleSpaceAfterConstructFixer - Add support for namespace (julienfalque)
    • bug #5730 Fix transforming deprecations into exceptions (julienfalque)
    • bug #5738 TokensAnalyzer - fix for union types (kubawerlos)
    • bug #5741 Fix constant invocation detection cases (kubawerlos)
    • bug #5769 Fix priority between phpdoc_to_property_type and no_superfluous_phpdoc_tags (julienfalque)
    • bug #5774 FunctionsAnalyzer::isTheSameClassCall - fix for $this with double colon following (kubawerlos)
    • bug #5779 SingleLineThrowFixer - fix for throw in match (kubawerlos)
    • bug #5781 ClassDefinition - fix for anonymous class with trailing comma (kubawerlos)
    • bug #5783 StaticLambdaFixer - consider parent:: as a possible reference to $this (fancyweb)
    • bug #5791 NoBlankLinesAfterPhpdoc - Add T_NAMESPACE in array of forbidden successors (paulbalandan)
    • bug #5799 TypeAlternationTransformer - fix for multiple function parameters (kubawerlos)
    • bug #5804 NoBreakCommentFixer - fix for "default" in "match" (kubawerlos)
    • bug #5805 SingleLineCommentStyleFixer - run after HeaderCommentFixer (kubawerlos)
    • bug #5817 NativeFunctionTypeDeclarationCasingFixer - fix for union types (kubawerlos)
    • bug #5823 YodaStyleFixer - yield support (SpacePossum)
    • minor #4914 Improve PHPDoc types support (julienfalque, keradus)
    • minor #5592 Fix checking for default config used in rule sets (kubawerlos)
    • minor #5675 Docs: extend Upgrade Guide (keradus)
    • minor #5680 DX: benchmark.sh - ensure deps are updated to enable script working across less-similar branches (keradus)
    • minor #5689 Calculate code coverage on PHP 8 (kubawerlos)
    • minor #5694 DX: fail on risky tests (kubawerlos)
    • minor #5695 Utils - save only unique deprecations to avoid memory issues (PetrHeinz)
    • minor #5710 [typo] add correct backquotes (PhilETaylor)
    • minor #5711 Fix doc, "run-in" show-progress option is no longer present (mvorisek)
    • minor #5713 Upgrade-Guide: fix typo (staabm)
    • minor #5717 Run migration rules on PHP 8 (kubawerlos, keradus)
    • minor #5721 Fix reStructuredText markup (julienfalque)
    • minor #5725 Update LICENSE (exussum12)
    • minor #5731 CI - Fix checkbashisms installation (julienfalque)
    • minor #5736 Remove references to PHP 5.6 (kubawerlos, keradus)
    • minor #5739 DX: more typehinting (keradus)
    • minor #5740 DX: more type-related docblocks (keradus)
    • minor #5746 Config - Improve deprecation message with details (SpacePossum)
    • minor #5747 RandomApiMigrationFixer - better docs and better "random_int" support (SpacePossum)
    • minor #5748 Updated the link to netbeans plugins page (cyberguroo)
    • minor #5750 Test all const are in uppercase (SpacePossum)
    • minor #5752 NoNullPropertyInitializationFixer - fix static properties as well (HypeMC)
    • minor #5756 Fix rule sets descriptions (kubawerlos)
    • minor #5761 Fix links in custom rules documentation (julienfalque)
    • minor #5771 doc(config): change set's name (Kocal)
    • minor #5777 DX: update PHPStan (kubawerlos)
    • minor #5789 DX: update PHPStan (kubawerlos)
    • minor #5808 Update PHPStan to 0.12.92 (kubawerlos)
    • minor #5813 Docs: point to v3 in installation description (Jimbolino)
    • minor #5824 Deprecate v2 (keradus)
    • minor #5825 DX: update checkbashisms to v2.21.3 (keradus)
    • minor #5826 SCA: check both composer files (keradus)
    • minor #5827 ClassAttributesSeparationFixer - Add trait_import support (SpacePossum)
    • minor #5831 DX: fix SCA violations (keradus)
    Source code(tar.gz)
    Source code(zip)
    php-cs-fixer.phar(2.07 MB)
    php-cs-fixer.phar.asc(566 bytes)
  • v2.19.1(Aug 2, 2021)

    • bug #5395 PhpdocTagTypeFixer: Do not modify array shapes (localheinz, julienfalque)
    • bug #5678 UseArrowFunctionsFixer - fix for return without value (kubawerlos)
    • bug #5679 PhpUnitNamespacedFixer - do not try to fix constant usage (kubawerlos)
    • bug #5681 RegularCallableCallFixer - fix for function name with escaped slash (kubawerlos)
    • bug #5687 FinalInternalClassFixer - fix for annotation with space after "@" (kubawerlos)
    • bug #5688 ArrayIndentationFixer - fix for really long arrays (kubawerlos)
    • bug #5690 PhpUnitNoExpectationAnnotationFixer - fix "expectedException" annotation with message below (kubawerlos)
    • bug #5693 YodaStyleFixer - fix for assignment operators (kubawerlos)
    • bug #5697 StrictParamFixer - fix for method definition (kubawerlos)
    • bug #5702 CommentToPhpdocFixer - fix for single line comments starting with more than 2 slashes (kubawerlos)
    • bug #5703 DateTimeImmutableFixer - fix for method definition (kubawerlos)
    • bug #5718 VoidReturnFixer - do not break syntax with magic methods (kubawerlos)
    • bug #5727 SingleSpaceAfterConstructFixer - Add support for namespace (julienfalque)
    • bug #5730 Fix transforming deprecations into exceptions (julienfalque)
    • bug #5738 TokensAnalyzer - fix for union types (kubawerlos)
    • bug #5741 Fix constant invocation detection cases (kubawerlos)
    • bug #5769 Fix priority between phpdoc_to_property_type and no_superfluous_phpdoc_tags (julienfalque)
    • bug #5774 FunctionsAnalyzer::isTheSameClassCall - fix for $this with double colon following (kubawerlos)
    • bug #5779 SingleLineThrowFixer - fix for throw in match (kubawerlos)
    • bug #5781 ClassDefinition - fix for anonymous class with trailing comma (kubawerlos)
    • bug #5783 StaticLambdaFixer - consider parent:: as a possible reference to $this (fancyweb)
    • bug #5791 NoBlankLinesAfterPhpdoc - Add T_NAMESPACE in array of forbidden successors (paulbalandan)
    • bug #5799 TypeAlternationTransformer - fix for multiple function parameters (kubawerlos)
    • bug #5804 NoBreakCommentFixer - fix for "default" in "match" (kubawerlos)
    • bug #5805 SingleLineCommentStyleFixer - run after HeaderCommentFixer (kubawerlos)
    • bug #5817 NativeFunctionTypeDeclarationCasingFixer - fix for union types (kubawerlos)
    • bug #5823 YodaStyleFixer - yield support (SpacePossum)
    • minor #4914 Improve PHPDoc types support (julienfalque, keradus)
    • minor #5680 DX: benchmark.sh - ensure deps are updated to enable script working across less-similar branches (keradus)
    • minor #5689 Calculate code coverage on PHP 8 (kubawerlos)
    • minor #5694 DX: fail on risky tests (kubawerlos)
    • minor #5695 Utils - save only unique deprecations to avoid memory issues (PetrHeinz)
    • minor #5710 [typo] add correct backquotes (PhilETaylor)
    • minor #5717 Run migration rules on PHP 8 (kubawerlos, keradus)
    • minor #5721 Fix reStructuredText markup (julienfalque)
    • minor #5725 Update LICENSE (exussum12)
    • minor #5731 CI - Fix checkbashisms installation (julienfalque)
    • minor #5740 DX: more type-related docblocks (keradus)
    • minor #5746 Config - Improve deprecation message with details (SpacePossum)
    • minor #5747 RandomApiMigrationFixer - better docs and better "random_int" support (SpacePossum)
    • minor #5748 Updated the link to netbeans plugins page (cyberguroo)
    • minor #5750 Test all const are in uppercase (SpacePossum)
    • minor #5752 NoNullPropertyInitializationFixer - fix static properties as well (HypeMC)
    • minor #5756 Fix rule sets descriptions (kubawerlos)
    • minor #5761 Fix links in custom rules documentation (julienfalque)
    • minor #5777 DX: update PHPStan (kubawerlos)
    • minor #5789 DX: update PHPStan (kubawerlos)
    • minor #5808 Update PHPStan to 0.12.92 (kubawerlos)
    • minor #5824 Deprecate v2 (keradus)
    • minor #5825 DX: update checkbashisms to v2.21.3 (keradus)
    • minor #5826 SCA: check both composer files (keradus)
    • minor #5827 ClassAttributesSeparationFixer - Add trait_import support (SpacePossum)
    Source code(tar.gz)
    Source code(zip)
    php-cs-fixer.phar(2.12 MB)
    php-cs-fixer.phar.asc(566 bytes)
  • v3.0.0(May 3, 2021)

    The easiest way to update from v2.x is:

    • install v2.19 and run in verbose mode (php-cs-fixer fix -v) or in future mode (PHP_CS_FIXER_FUTURE_MODE=1 php-cs-fixer fix) to identify and fix deprecations
    • install v3.0 and follow upgrade guide

    • bug #5164 Differ - surround file name with double quotes if it contains spacing. (SpacePossum)
    • bug #5560 PSR2: require visibility only for properties and methods (kubawerlos)
    • bug #5576 ClassAttributesSeparationFixer: do not allow using v2 config (kubawerlos)
    • feature #4979 Pass file to differ (paulhenri-l, SpacePossum)
    • minor #3374 show-progress option: drop run-in and estimating, rename estimating-max to dots (keradus)
    • minor #3375 Fixers - stop exposing extra properties/consts (keradus)
    • minor #3376 Tokenizer - remove deprecations and legacy mode (keradus)
    • minor #3377 rules - change default options (keradus)
    • minor #3378 SKIP_LINT_TEST_CASES - drop env (keradus)
    • minor #3379 MethodArgumentSpaceFixer - fixSpace is now private (keradus)
    • minor #3380 rules - drop rootless configurations (keradus)
    • minor #3381 rules - drop deprecated configurations (keradus)
    • minor #3382 DefinedFixerInterface - incorporate into FixerInterface (keradus)
    • minor #3383 FixerDefinitionInterface - drop getConfigurationDescription and getDefaultConfiguration (keradus)
    • minor #3384 diff-format option: drop sbd diff, use udiffer by default, drop SebastianBergmannDiffer and SebastianBergmannShortDiffer classes (keradus)
    • minor #3385 ConfigurableFixerInterface::configure - param is now not nullable and not optional (keradus)
    • minor #3386 ConfigurationDefinitionFixerInterface - incorporate into ConfigurableFixerInterface (keradus)
    • minor #3387 FixCommand - forbid passing 'config' and 'rules' options together (keradus)
    • minor #3388 Remove Helpers (keradus)
    • minor #3389 AccessibleObject - drop class (keradus)
    • minor #3390 Drop deprecated rules: blank_line_before_return, hash_to_slash_comment, method_separation, no_extra_consecutive_blank_lines, no_multiline_whitespace_before_semicolons and pre_increment (keradus)
    • minor #3456 AutoReview - drop references to removed rule (keradus)
    • minor #3659 use php-cs-fixer/diff ^2.0 (SpacePossum)
    • minor #3681 CiIntegrationTest - fix incompatibility from 2.x line (keradus)
    • minor #3740 NoUnusedImportsFixer - remove SF exception (SpacePossum)
    • minor #3771 UX: always set error_reporting in entry file, not Application (keradus)
    • minor #3922 Make some more classes final (ntzm, SpacePossum)
    • minor #3995 Change default config of native_function_invocation (dunglas, SpacePossum)
    • minor #4432 DX: remove empty sets from RuleSet (kubawerlos)
    • minor #4489 Fix ruleset @PHPUnit50Migration:risky (kubawerlos)
    • minor #4620 DX: cleanup additional, not used parameters (keradus)
    • minor #4666 Remove deprecated rules: lowercase_constants, php_unit_ordered_covers, silenced_deprecation_error (keradus)
    • minor #4697 Remove deprecated no_short_echo_tag rule (julienfalque)
    • minor #4851 fix phpstan on 3.0 (SpacePossum)
    • minor #4901 Fix SCA (SpacePossum)
    • minor #5069 Fixed failing tests on 3.0 due to unused import after merge (GrahamCampbell)
    • minor #5096 NativeFunctionInvocationFixer - BacktickToShellExecFixer - fix integration test (SpacePossum)
    • minor #5171 Fix test (SpacePossum)
    • minor #5245 Fix CI for 3.0 line (keradus)
    • minor #5351 clean ups (SpacePossum)
    • minor #5364 DX: Do not display runtime twice on 3.0 line (keradus)
    • minor #5412 3.0 - cleanup (SpacePossum, keradus)
    • minor #5417 Further BC cleanup for 3.0 (keradus)
    • minor #5418 Drop src/Test namespace (keradus)
    • minor #5436 Drop mapping of strings to boolean option other than yes/no (keradus)
    • minor #5440 Change default ruleset to PSR-12 (keradus)
    • minor #5477 Drop diff-format (keradus)
    • minor #5478 Docs: Cleanup UPGRADE markdown files (keradus)
    • minor #5479 ArraySyntaxFixer, ListSyntaxFixer - change default syntax to short (keradus)
    • minor #5480 Tokens::findBlockEnd - drop deprecated argument (keradus)
    • minor #5485 ClassAttributesSeparationFixer - drop deprecated flat list configuration (keradus)
    • minor #5486 CI: drop unused env variables (keradus)
    • minor #5488 Do not distribute documentation (szepeviktor)
    • minor #5513 DX: Tokens::warnPhp8SplFixerArrayChange - drop unused method (keradus)
    • minor #5520 DX: Drop IsIdenticalConstraint (keradus)
    • minor #5521 DX: apply rules configuration cleanups for PHP 7.1+ (keradus)
    • minor #5524 DX: drop support of very old deps (keradus)
    • minor #5525 Drop phpunit-legacy-adapter (keradus)
    • minor #5527 Bump required PHP to 7.1 (keradus)
    • minor #5529 DX: bump required PHPUnit to v7+ (keradus)
    • minor #5532 Apply PHP 7.1 typing (keradus)
    • minor #5541 RuleSet - disallow null usage to disable the rule (keradus)
    • minor #5555 DX: further typing improvements (keradus)
    • minor #5562 Fix table row rendering for default values of array_syntax and list_syntax (derrabus)
    • minor #5608 DX: new cache filename (keradus)
    • minor #5609 Forbid old config filename usage (keradus)
    • minor #5638 DX: remove Utils::calculateBitmask (keradus)
    • minor #5641 DX: use constants for PHPUnit version on 3.0 line (keradus)
    • minor #5643 FixCommand - simplify help (keradus)
    • minor #5644 Token::toJson() - remove parameter (keradus)
    • minor #5645 DX: YodaStyleFixerTest - fix CI (keradus)
    • minor #5649 DX: YodaStyleFixerTest - fix 8.0 compat (keradus)
    • minor #5650 DX: FixCommand - drop outdated/duplicated docs (keradus)
    • minor #5656 DX: mark some constants as internal or private (keradus)
    • minor #5657 DX: convert some properties to constants (keradus)
    • minor #5669 Remove TrailingCommaInMultilineArrayFixer (kubawerlos, keradus)
    Source code(tar.gz)
    Source code(zip)
    php-cs-fixer.phar(2.05 MB)
    php-cs-fixer.phar.asc(566 bytes)
A tool to automatically fix Twig Coding Standards issues

Twig CS Fixer Installation This standard can be installed with the Composer dependency manager. Add the coding standard as a dependency of your projec

Vincent Langlet 50 Jan 6, 2023
Plugin to diagnose/fix ClassicPress SSL issues.

ClassicPress SSL Fix This plugin provides a way to work around the issue "cURL error 60: SSL certificate problem: certificate has expired" in ClassicP

ClassicPress Research 2 Oct 10, 2021
PHP_CodeSniffer tokenizes PHP files and detects violations of a defined set of coding standards.

PHP_CodeSniffer is a set of two PHP scripts; the main phpcs script that tokenizes PHP, JavaScript and CSS files to detect violations of a defined coding standard, and a second phpcbf script to automatically correct coding standard violations. PHP_CodeSniffer is an essential development tool that ensures your code remains clean and consistent.

Squiz Labs 9.9k Jan 5, 2023
Composer installer for PHP_CodeSniffer coding standards

PHP_CodeSniffer Standards Composer Installer Plugin This composer installer plugin allows for easy installation of PHP_CodeSniffer coding standards (r

Dealerdirect 462 Dec 22, 2022
This composer installer plugin allows for easy installation of PHP_CodeSniffer coding standards

PHP_CodeSniffer Standards Composer Installer Plugin This composer installer plugin allows for easy installation of PHP_CodeSniffer coding standards (r

PHPCSStandards 393 Feb 25, 2022
Coding-standard - Magento PHP CodeSniffer Coding Standard

ECG Magento Code Sniffer Coding Standard ECG Magento Code Sniffer Coding Standard is a set of rules and sniffs for PHP_CodeSniffer tool. It allows aut

Magento ECG 309 Jan 3, 2023
Documentation on clean coding and demonstration of studied clean coding principals with PHP.

practice-php-clean-code Documentation on clean coding and demonstration of studied clean coding principals with PHP. The document contained in this re

Ferdous Islam 1 Feb 21, 2022
Standards Alignment Tool

Standards Alignment Tool (SALT) [] Overview This is a prototype for testing the IMS Global Learning ConsortiumĀ® CASEā„¢ Specification and proving its us

OpenSALT 39 Dec 14, 2022
The tool converts different error reporting standards for deep compatibility with popular CI systems (TeamCity, IntelliJ IDEA, GitHub Actions, etc).

JBZoo / CI-Report-Converter Why? Installing Using as GitHub Action Example GitHub Action workflow Available Directions Help description in terminal Co

JBZoo Toolbox 17 Jun 16, 2022
Debug with Ray to fix problems faster

Debug with Ray to fix problems faster This package can be installed in any PHP application to send messages to the Ray app. The desktop app: can be us

Spatie 458 Dec 27, 2022
Container Open Inventory ID send bug fix PocketMine-MP plugin

ContainerOpenFixed Container Open Inventory ID send bug fix PocketMine-MP plugin Example use skh6075\containeropenfixed\IWindowType; use pocketmine\ne

avas 2 May 20, 2022
PHPCheckstyle is an open-source tool that helps PHP programmers adhere to certain coding conventions.

PHPCheckstyle Overview PHPCheckstyle is an open-source tool that helps PHP programmers adhere to certain coding conventions. The tools checks the inpu

PHPCheckstyle 157 Dec 5, 2022
Analyzer of PHP code to search issues with deprecated functionality in newer interpreter versions.

PhpDeprecationDetector PhpDeprecationDetector - analyzer of PHP code to search usages of deprecated functionality in newer interpreter versions - depr

Sergey 312 Dec 26, 2022
Analyzer of PHP code to search issues with deprecated functionality in newer interpreter versions.

PhpDeprecationDetector PhpDeprecationDetector - analyzer of PHP code to search usages of deprecated functionality in newer interpreter versions - depr

Sergey 312 Dec 26, 2022
A collection of standards as PHP Enums: ISO3166, ISO4217, ISO639...

Standards A collection of standards as PHP Enums Setup Make sure you are running PHP 8.1 or higher to use this package To start right away, run the fo

null 295 Dec 20, 2022
Issue tracking application extending GitHub's issues and pull requests for the Joomla! project.

Requirements The issue tracker application requires a server running: PHP 7.2 or 7.3 PHP's ext/curl and ext/intl should also be installed MySQL 5.5.3

Joomla! 68 Oct 27, 2022
A Kimai 2 plugin, which send duration of cards to GitLab spend issues of timesheet.

GitLabBundle A Kimai 2 plugin, which send duration of cards to GitLab spend issues of timesheet. Installation First clone it to your Kimai installatio

LibreCode coop 9 Nov 14, 2022
List of Magento extensions with known security issues.

Magento Vulnerability Database List of Magento 1 and 2 integrations with known security issues. Objective: easily identify insecure 3rd party software

Sansec 184 Dec 7, 2022
Fixes WordPress 5.9 global CSS styles specificity issues

Fixes WordPress 5.9 global CSS styles specificity issues

Oliver Juhas 3 Feb 22, 2022