-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch the codestyle config from phpcs to ecs
- Loading branch information
Showing
11 changed files
with
121 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use PHP_CodeSniffer\Standards\Generic\Sniffs\Arrays\ArrayIndentSniff; | ||
use PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting\SpaceAfterCastSniff; | ||
use PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\ForbiddenFunctionsSniff; | ||
use PhpCsFixer\Fixer\ClassNotation\FinalClassFixer; | ||
use PhpCsFixer\Fixer\PhpUnit\PhpUnitConstructFixer; | ||
use PhpCsFixer\Fixer\PhpUnit\PhpUnitDedicateAssertFixer; | ||
use PhpCsFixer\Fixer\Strict\DeclareStrictTypesFixer; | ||
use PhpCsFixer\Fixer\Whitespace\NoExtraBlankLinesFixer; | ||
use SlevomatCodingStandard\Sniffs\Classes\ClassConstantVisibilitySniff; | ||
use SlevomatCodingStandard\Sniffs\Classes\ClassStructureSniff; | ||
use SlevomatCodingStandard\Sniffs\Classes\MethodSpacingSniff; | ||
use SlevomatCodingStandard\Sniffs\Commenting\EmptyCommentSniff; | ||
use SlevomatCodingStandard\Sniffs\Functions\StaticClosureSniff; | ||
use SlevomatCodingStandard\Sniffs\Functions\StrictCallSniff; | ||
use SlevomatCodingStandard\Sniffs\Namespaces\ReferenceUsedNamesOnlySniff; | ||
use SlevomatCodingStandard\Sniffs\Namespaces\UnusedUsesSniff; | ||
use SlevomatCodingStandard\Sniffs\Namespaces\UselessAliasSniff; | ||
use SlevomatCodingStandard\Sniffs\Namespaces\UseSpacingSniff; | ||
use SlevomatCodingStandard\Sniffs\Variables\DisallowSuperGlobalVariableSniff; | ||
use Symplify\EasyCodingStandard\Config\ECSConfig; | ||
|
||
return ECSConfig::configure() | ||
->withPaths([ | ||
__DIR__ . '/src', | ||
__DIR__ . '/tests', | ||
]) | ||
|
||
->withPreparedSets( | ||
psr12: true, | ||
cleanCode: true, | ||
) | ||
->withSkip([ | ||
FinalClassFixer::class => [ | ||
__DIR__ . '/tests/TestCase.php', | ||
__DIR__ . '/src/Exceptions/GitHashException.php', | ||
], | ||
]) | ||
->withConfiguredRule(UnusedUsesSniff::class, [ | ||
'searchAnnotations' => true, | ||
]) | ||
->withConfiguredRule(ForbiddenFunctionsSniff::class, [ | ||
'forbiddenFunctions' => [ | ||
'sizeof' => 'count', //keep the default option | ||
'delete' => 'unset', //keep the default option | ||
'dump' => null, //debug statement | ||
'dd' => null, //debug statement | ||
'var_dump' => null, //debug statement | ||
'print_r' => null, //debug statement | ||
'exit' => null, | ||
], | ||
]) | ||
->withConfiguredRule(ClassStructureSniff::class, [ | ||
'groups' => [ | ||
'uses', | ||
'constants', | ||
'enum cases', | ||
'properties', | ||
'constructor', | ||
'static constructors', | ||
'destructor', | ||
'magic methods', | ||
'all public methods', | ||
'all protected methods', | ||
'all private methods', | ||
], | ||
]) | ||
->withConfiguredRule(ReferenceUsedNamesOnlySniff::class, [ | ||
'searchAnnotations' => true, | ||
'allowFullyQualifiedNameForCollidingClasses' => true, | ||
]) | ||
->withRules([ | ||
ArrayIndentSniff::class, | ||
SpaceAfterCastSniff::class, | ||
StaticClosureSniff::class, | ||
DisallowSuperGlobalVariableSniff::class, | ||
ClassConstantVisibilitySniff::class, | ||
DeclareStrictTypesFixer::class, | ||
NoExtraBlankLinesFixer::class, | ||
FinalClassFixer::class, | ||
MethodSpacingSniff::class, | ||
UselessAliasSniff::class, | ||
EmptyCommentSniff::class, | ||
UseSpacingSniff::class, | ||
StrictCallSniff::class, | ||
PhpUnitConstructFixer::class, | ||
PhpUnitDedicateAssertFixer::class, | ||
]) | ||
; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters