Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #77 from object-calisthenics/symplify-4
bump to Symplify 4
- Loading branch information
Showing
38 changed files
with
411 additions
and
321 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
imports: | ||
- { resource: 'vendor/symplify/easy-coding-standard/config/symfony.yml' } | ||
- { resource: 'vendor/symplify/easy-coding-standard/config/php70.yml' } | ||
- { resource: 'vendor/symplify/easy-coding-standard/config/php71.yml' } | ||
# custom | ||
- { resource: 'vendor/symplify/easy-coding-standard/config/common.yml' } | ||
- { resource: 'vendor/symplify/easy-coding-standard/config/symplify.yml' } | ||
|
||
services: | ||
# All rules with default values | ||
|
||
# Rule 1: Only X indentation level per function/method (with default values) | ||
ObjectCalisthenics\Sniffs\Metrics\MaxNestingLevelSniff: | ||
maxNestingLevel: 2 | ||
|
||
# Rule 2: There is no "else" | ||
ObjectCalisthenics\Sniffs\ControlStructures\NoElseSniff: ~ | ||
|
||
# Rule 5: Only one object operator (->) per line (with default values) | ||
ObjectCalisthenics\Sniffs\CodeAnalysis\OneObjectOperatorPerLineSniff: | ||
variablesHoldingAFluentInterface: ["$queryBuilder", "$containerBuilder"] | ||
methodsStartingAFluentInterface: ["createQueryBuilder"] | ||
methodsEndingAFluentInterface: ["execute", "getQuery"] | ||
|
||
# Rule 6: Do not abbreviate (with default values) | ||
ObjectCalisthenics\Sniffs\NamingConventions\ElementNameMinimalLengthSniff: | ||
minLength: 3 | ||
allowedShortNames: ["i", "id", "to", "up"] | ||
|
||
# Rule 7: Keep your classes small (with default values) | ||
ObjectCalisthenics\Sniffs\Files\ClassTraitAndInterfaceLengthSniff: | ||
maxLength: 200 | ||
ObjectCalisthenics\Sniffs\Files\FunctionLengthSniff: | ||
maxLength: 20 | ||
ObjectCalisthenics\Sniffs\Metrics\PropertyPerClassLimitSniff: | ||
maxCount: 10 | ||
ObjectCalisthenics\Sniffs\Metrics\MethodPerClassLimitSniff: | ||
maxCount: 10 | ||
|
||
# Rule 9: Do not Use Getters and Setters | ||
ObjectCalisthenics\Sniffs\Classes\ForbiddenPublicPropertySniff: ~ | ||
ObjectCalisthenics\Sniffs\NamingConventions\NoSetterSniff: ~ | ||
|
||
PhpCsFixer\Fixer\ControlStructure\YodaStyleFixer: | ||
equal: false | ||
identical: false | ||
less_and_greater: false | ||
|
||
# Metrics | ||
PHP_CodeSniffer\Standards\Generic\Sniffs\Metrics\CyclomaticComplexitySniff: | ||
absoluteComplexity: 4 | ||
PHP_CodeSniffer\Standards\Generic\Sniffs\Metrics\NestingLevelSniff: | ||
absoluteNestingLevel: 2 | ||
|
||
# Slevomat | ||
SlevomatCodingStandard\Sniffs\Classes\UnusedPrivateElementsSniff: ~ | ||
SlevomatCodingStandard\Sniffs\Exceptions\ReferenceThrowableOnlySniff: ~ | ||
SlevomatCodingStandard\Sniffs\TypeHints\TypeHintDeclarationSniff: | ||
enableEachParameterAndReturnInspection: true | ||
|
||
parameters: | ||
skip: | ||
SlevomatCodingStandard\Sniffs\TypeHints\TypeHintDeclarationSniff: | ||
- '*src/ObjectCalisthenics/Sniffs/*/*Sniff.php' | ||
|
||
PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis\AssignmentInConditionSniff.Found: ~ | ||
|
||
exclude_checkers: | ||
- 'Symplify\CodingStandard\Sniffs\CleanCode\ForbiddenStaticFunctionSniff' | ||
# Symfony ruleset | ||
- 'PhpCsFixer\Fixer\PhpTag\BlankLineAfterOpeningTagFixer' | ||
- 'PhpCsFixer\Fixer\Operator\NewWithBracesFixer' | ||
- 'PhpCsFixer\Fixer\Phpdoc\PhpdocAlignFixer' | ||
# mutually excluded | ||
- 'SlevomatCodingStandard\Sniffs\ControlStructures\DisallowYodaComparisonSniff' | ||
- 'PhpCsFixer\Fixer\Operator\UnaryOperatorSpacesFixer' |
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 |
---|---|---|
@@ -1,7 +1,6 @@ | ||
parameters: | ||
autoload_files: | ||
- %currentWorkingDirectory%/tests/bootstrap.php | ||
- %currentWorkingDirectory%/vendor/squizlabs/php_codesniffer/autoload.php | ||
excludes_analyse: | ||
- **/ObjectCalisthenics/Helper/Slevomat/** | ||
ignoreErrors: | ||
- '#Method ObjectCalisthenics\\Sniffs\\Metrics\\MaxNestingLevelSniff::register\(\) should return int\[\] but returns \(int\|string\)\[\]#' |
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
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
Oops, something went wrong.