Download the PHP package kubawerlos/php-cs-fixer-custom-fixers without Composer
On this page you can find all versions of the php package kubawerlos/php-cs-fixer-custom-fixers. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download kubawerlos/php-cs-fixer-custom-fixers
More information about kubawerlos/php-cs-fixer-custom-fixers
Files in kubawerlos/php-cs-fixer-custom-fixers
Package php-cs-fixer-custom-fixers
Short Description A set of custom fixers for PHP CS Fixer
License MIT
Informations about the package php-cs-fixer-custom-fixers
PHP CS Fixer: custom fixers
A set of custom fixers for PHP CS Fixer.
Installation
PHP CS Fixer: custom fixers can be installed by running:
Usage
In your PHP CS Fixer configuration register fixers and use them:
:warning: When PHP CS Fixer is installed via php-cs-fixer/shim
package,
requiring bootstrap may be needed to load PhpCsFixerCustomFixers
classes:
Fixers
CommentSurroundedBySpacesFixer
Comments must be surrounded by spaces.
CommentedOutFunctionFixer
The configured functions must be commented out. Risky: when any of the configured functions have side effects or are overwritten. Configuration options:
functions
(array
): list of functions to comment out; defaults to['print_r', 'var_dump', 'var_export']
ConstructorEmptyBracesFixer
Constructor's empty braces must be on a single line.
DataProviderNameFixer
Data provider names must match the name of the test.
DEPRECATED: use php_unit_data_provider_name
instead.
Risky: when relying on name of data provider function.
Configuration options:
prefix
(string
): prefix that replaces "test"; defaults to'provide'
suffix
(string
): suffix to be added at the end"; defaults to'Cases'
DataProviderReturnTypeFixer
The return type of PHPUnit data provider must be iterable
.
DEPRECATED: use php_unit_data_provider_return_type
instead.
Risky: when relying on signature of data provider.
DataProviderStaticFixer
Data providers must be static.
DEPRECATED: use php_unit_data_provider_static
instead.
Risky: when force
is set to true
.
Configuration options:
force
(bool
): whether to make static data providers having dynamic class calls; defaults tofalse
DeclareAfterOpeningTagFixer
Declare statement for strict types must be placed on the same line, after the opening tag.
EmptyFunctionBodyFixer
Empty function body must be abbreviated as {}
and placed on the same line as the previous symbol, separated with a space.
InternalClassCasingFixer
Classes defined internally by an extension or the core must be referenced with the correct case.
DEPRECATED: use class_reference_name_casing
instead.
IssetToArrayKeyExistsFixer
Function array_key_exists
must be used instead of isset
when possible.
Risky: when array is not defined, is multi-dimensional or behaviour is relying on the null value.
MultilineCommentOpeningClosingAloneFixer
Multiline comments or PHPDocs must contain an opening and closing line with no additional content.
MultilinePromotedPropertiesFixer
Promoted properties must be on separate lines. Configuration options:
keep_blank_lines
(bool
): whether to keep blank lines between properties; defaults tofalse
minimum_number_of_parameters
(int
): minimum number of parameters in the constructor to fix; defaults to1
NoCommentedOutCodeFixer
There must be no commented out code.
NoDoctrineMigrationsGeneratedCommentFixer
There must be no comments generated by Doctrine Migrations.
NoDuplicatedArrayKeyFixer
There must be no duplicate array keys. Configuration options:
ignore_expressions
(bool
): whether to keep duplicated expressions (as they might return different values) or not; defaults totrue
NoDuplicatedImportsFixer
There must be no duplicate use
statements.
NoImportFromGlobalNamespaceFixer
There must be no imports from the global namespace.
NoLeadingSlashInGlobalNamespaceFixer
Classes in the global namespace cannot contain leading slashes.
NoNullableBooleanTypeFixer
There must be no nullable boolean types. Risky: when the null is used.
NoPhpStormGeneratedCommentFixer
There must be no comments generated by PhpStorm.
NoReferenceInFunctionDefinitionFixer
There must be no parameters passed by reference in functions. Risky: when rely on reference.
NoSuperfluousConcatenationFixer
There must be no superfluous concatenation of literal strings. Configuration options:
allow_preventing_trailing_spaces
(bool
): whether to keep concatenation if it prevents having trailing spaces in string; defaults tofalse
keep_concatenation_for_different_quotes
(bool
): whether to keep concatenation if single-quoted and double-quoted would be concatenated; defaults tofalse
NoTrailingCommaInSinglelineFixer
An element list written on one line cannot contain a trailing comma.
NoUselessCommentFixer
There must be no useless comments.
NoUselessDirnameCallFixer
There must be no useless dirname
calls.
NoUselessDoctrineRepositoryCommentFixer
There can be no comments generated by Doctrine ORM.
NoUselessParenthesisFixer
There must be no useless parentheses.
NoUselessStrlenFixer
Functions strlen
and mb_strlen
must not be compared to 0.
Risky: when the function strlen
is overridden.
NumericLiteralSeparatorFixer
Numeric literals must have configured separators.
DEPRECATED: use numeric_literal_separator
instead.
Configuration options:
binary
(bool
,null
): whether add, remove or ignore separators in binary numbers.; defaults tofalse
decimal
(bool
,null
): whether add, remove or ignore separators in decimal numbers.; defaults tofalse
float
(bool
,null
): whether add, remove or ignore separators in float numbers.; defaults tofalse
hexadecimal
(bool
,null
): whether add, remove or ignore separators in hexadecimal numbers.; defaults tofalse
octal
(bool
,null
): whether add, remove or ignore separators in octal numbers.; defaults tofalse
PhpUnitAssertArgumentsOrderFixer
PHPUnit assertions must have expected argument before actual one. Risky: when original PHPUnit methods are overwritten.
PhpUnitDedicatedAssertFixer
PHPUnit assertions like assertCount
and assertInstanceOf
must be used over assertEquals
/assertSame
.
Risky: when original PHPUnit methods are overwritten.
PhpUnitNoUselessReturnFixer
PHPUnit fail
, markTestIncomplete
and markTestSkipped
functions must not be directly followed by return
.
Risky: when original PHPUnit methods are overwritten.
PhpdocArrayStyleFixer
Generic array style should be used in PHPDoc.
DEPRECATED: use phpdoc_array_type
instead.
PhpdocNoIncorrectVarAnnotationFixer
The @var
annotations must be used correctly in code.
PhpdocNoSuperfluousParamFixer
There must be no superfluous parameters in PHPDoc.
PhpdocOnlyAllowedAnnotationsFixer
Only the listed annotations are allowed in PHPDoc. Configuration options:
elements
(array
): list of annotations to keep in PHPDoc; defaults to[]
PhpdocParamOrderFixer
Orders all @param
annotations in DocBlocks according to method signature.
DEPRECATED: use phpdoc_param_order
instead.
PhpdocParamTypeFixer
The @param
annotations must have a type.
PhpdocSelfAccessorFixer
In PHPDoc, the class or interface element self
must be used instead of the class name itself.
PhpdocSingleLineVarFixer
The @var
annotation must be on a single line if it is the only content.
PhpdocTypeListFixer
PHPDoc type list
must be used instead of array
without a key type.
DEPRECATED: use phpdoc_list_type
instead.
PhpdocTypesCommaSpacesFixer
PHPDoc types commas must not be preceded by a whitespace, and must be succeeded by a single whitespace.
PhpdocTypesTrimFixer
PHPDoc types must be trimmed.
PhpdocVarAnnotationToAssertFixer
Converts @var
annotations to assert
calls when used in assignments.
PromotedConstructorPropertyFixer
Constructor properties must be promoted if possible. Configuration options:
promote_only_existing_properties
(bool
): whether to promote only properties that are defined in class; defaults tofalse
ReadonlyPromotedPropertiesFixer
Promoted properties must be declared as read-only. Risky: when property is written.
SingleSpaceAfterStatementFixer
Statements not followed by a semicolon must be followed by a single space. Configuration options:
allow_linebreak
(bool
): whether to allow statement followed by linebreak; defaults tofalse
SingleSpaceBeforeStatementFixer
Statements not preceded by a line break must be preceded by a single space.
StringableInterfaceFixer
A class that implements the __toString()
method must explicitly implement the Stringable
interface.
Contributing
Request a feature or report a bug by creating an issue.
Alternatively, fork the repository, commit your changes, and make sure everything is fine:
and submit a pull request.
All versions of php-cs-fixer-custom-fixers with dependencies
ext-filter Version *
ext-tokenizer Version *
friendsofphp/php-cs-fixer Version ^3.61.1