imports:
    - { resource: 'config/object-calisthenics.yml' }

services:
    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: ~

parameters:
    sets:
        - 'symfony'
        - 'php70'
        - 'php71'
        - 'psr12'
        # custom
        - 'common'
        - 'symplify'

    skip:
        PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis\AssignmentInConditionSniff.FoundInWhileCondition: ~

        Symplify\CodingStandard\Sniffs\CleanCode\ForbiddenStaticFunctionSniff: ~
        Symplify\CodingStandard\Sniffs\CleanCode\CognitiveComplexitySniff:
            - '*src/ObjectCalisthenics/Sniffs/CodeAnalysis/OneObjectOperatorPerLineSniff.php'
        # Symfony ruleset
        PhpCsFixer\Fixer\PhpTag\BlankLineAfterOpeningTagFixer: ~
        PhpCsFixer\Fixer\Operator\NewWithBracesFixer: ~
        PhpCsFixer\Fixer\Phpdoc\PhpdocAlignFixer: ~
        # mutually excluded
        SlevomatCodingStandard\Sniffs\ControlStructures\DisallowYodaComparisonSniff: ~
        PhpCsFixer\Fixer\Operator\UnaryOperatorSpacesFixer: ~
