Download the PHP package erickskrauch/php-cs-fixer-custom-fixers without Composer
On this page you can find all versions of the php package erickskrauch/php-cs-fixer-custom-fixers. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download erickskrauch/php-cs-fixer-custom-fixers
More information about erickskrauch/php-cs-fixer-custom-fixers
Files in erickskrauch/php-cs-fixer-custom-fixers
Package php-cs-fixer-custom-fixers
Short Description A set of custom fixers for PHP-CS-Fixer
License MIT
Homepage https://github.com/erickskrauch/php-cs-fixer-custom-fixers
Informations about the package php-cs-fixer-custom-fixers
PHP-CS-Fixer custom fixers
A set of custom fixers for PHP-CS-Fixer.
Installation
Run:
Then in your configuration file (.php-cs-fixer.php
) register fixers and use them:
Fixers
Table of contents:
ErickSkrauch/align_multiline_parameters
- Align multiline function params (or remove alignment).ErickSkrauch/blank_line_around_class_body
- Add space inside class body.ErickSkrauch/blank_line_before_return
- Add blank line beforereturn
.ErickSkrauch/line_break_after_statements
- Add blank line after control structures.ErickSkrauch/multiline_if_statement_braces
- Fix brace position for multilineif
statements.ErickSkrauch/ordered_overrides
- Sort overridden methods.ErickSkrauch/remove_class_name_method_usages
- Replace::className()
with:class
(Yii2).
ErickSkrauch/align_multiline_parameters
Forces aligned or not aligned multiline function parameters:
Configuration:
-
variables
- when set totrue
, forces variables alignment. Onfalse
forces strictly no alignment. You can set it tonull
to disable touching of variables. Default:true
. defaults
- when set totrue
, forces defaults alignment. Onfalse
forces strictly no alignment. You can set it tonull
to disable touching of defaults. Default:false
.
ErickSkrauch/blank_line_around_class_body
Ensure that a class body contains one blank line after its definition and before its end:
Configuration:
-
apply_to_anonymous_classes
- should this fixer be applied to anonymous classes? If it is set tofalse
, than anonymous classes will be fixed to don't have empty lines around body. Default:true
. blank_lines_count
- adjusts an amount of the blank lines. Default:1
.
ErickSkrauch/blank_line_before_return
This is extended version of the original blank_line_before_statement
fixer. It applies only to return
statements
and only in cases, when on the current nesting level more than one statements.
ErickSkrauch/line_break_after_statements
Ensures that there is one blank line above the next statements: if
, switch
, for
, foreach
, while
, do-while
and try-catch-finally
.
ErickSkrauch/multiline_if_statement_braces
Ensures that multiline if statement body curly brace placed on the right line.
Configuration:
keep_on_own_line
- should this place closing bracket on its own line? If it's set tofalse
, than curly bracket will be placed right after the last condition statement. Default:true
.
ErickSkrauch/ordered_overrides
Overridden and implemented methods must be sorted in the same order as they are defined in parent classes.
Caveats:
-
This fixer is implemented against the PHP-CS-Fixer principle and relies on runtime, classes autoloading and reflection. If dependencies are missing or the autoloader isn't configured correctly, the fixer will not be able to discover the order of methods in parents.
-
Fixer prioritizes
extends
and appliesimplements
afterwards. It searches for the deepest parents of classes and takes them as the basis for sorting, ignoring later reordering. - This fixer runs BEFORE the
ordered_interfaces
fixer, so you might need to run PHP-CS-Fixer twice when you're using this fixer to get proper result. See this discussion for more info.
ErickSkrauch/remove_class_name_method_usages
(Yii2)
Replaces Yii2 BaseObject::className()
usages with native ::class
keyword, introduced in PHP 5.5.