.php-cs-fixer.dist.php
Call to method __construct
from undeclared class \PhpCsFixer\Config
(Did you mean class \App\Config or class \Tests\App\Config) Open
Open
$config = new PhpCsFixer\Config();
- Exclude checks
Call to method create
from undeclared class \PhpCsFixer\Finder
Open
Open
PhpCsFixer\Finder::create()
- Exclude checks
Call to method setRiskyAllowed
from undeclared class \PhpCsFixer\Config
(Did you mean class \App\Config or class \Tests\App\Config) Open
Open
$config->setRiskyAllowed(true)
- Exclude checks
Define a constant instead of duplicating this literal "elements" 3 times. Open
Open
'class_attributes_separation' => ['elements' => ['method' => 'one']],
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Line exceeds 120 characters; contains 270 characters Open
Open
'phpdoc_separation' => ['groups' => [['deprecated', 'link', 'see', 'since'], ['author', 'copyright', 'license'], ['category', 'package', 'subpackage'], ['property', 'property-read', 'property-write'], ['param'], ['return']], 'skip_unlisted_annotations' => true],
- Exclude checks
Line exceeds 120 characters; contains 175 characters Open
Open
'no_extra_blank_lines' => ['tokens' => ['break', 'continue', 'extra', 'return', 'throw', 'use', 'parenthesis_brace_block', 'square_brace_block', 'curly_brace_block']],
- Exclude checks