phpstan.neon.dist

Summary

Maintainability
Test Coverage
includes:
    - phar://phpstan.phar/conf/bleedingEdge.neon

parameters:
    level: 6
    checkMissingOverrideMethodAttribute: true
    paths:
        - .
    excludePaths:
        - vendor

    ignoreErrors:
        # relax strict rules
        - '~^Only booleans are allowed in .+, .+ given( on the (left|right) side)?\.$~'
        - '~^Variable (static )?(property access|method call) on .+\.$~'

        # fix unresolveable atk4/ui \Atk4\Ui\App class
        - '~^(.+(?<!\w)Atk4\\Ui\\App(?!\w).+|Call to an undefined method .+::(issetApp|getApp)\(\)\.)$~'

        -
            path: 'tests/DynamicMethodTraitTest.php'
            message: '~^Call to an undefined method Atk4\\Core\\Tests\\(DynamicMethodMock|DynamicMethodWithoutHookMock)::\w+\(\)\.$~'
            count: 10

        # remove once PHPUnit 9.x support is removed
        -
            path: 'src/Phpunit/TestCase.php'
            message: '~^Access to constant (STATUS_INCOMPLETE|STATUS_SKIPPED) on an unknown class PHPUnit\\Runner\\BaseTestRunner\.$~'
            count: 2
        -
            path: 'src/Phpunit/TestCase.php'
            message: '~^Call to an undefined method Atk4\\Core\\Phpunit\\TestCase::(getName|getStatus|getTestResultObject)\(\)\.$~'
            count: 5
        -
            path: 'src/Phpunit/TestCase.php'
            message: '~^Call to an undefined static method PHPUnit\\Util\\Test::(getLinesToBeCovered|getLinesToBeUsed|parseTestMethodAnnotations)\(\)\.$~'
            count: 3
        -
            path: 'src/Phpunit/TestCase.php'
            message: '~^Cannot call method (className|methodName)\(\) on array<int, string>\|PHPUnit\\Metadata\\Metadata\.$~'
            count: 2
        -
            path: 'tests/HookTraitTest.php'
            message: '~^Call to an undefined method Atk4\\Core\\Tests\\HookTraitTest::getName\(\)\.$~'
            count: 2
        -
            path: 'tests/Phpunit/TestCaseTest.php'
            message: '~^Call to an undefined method Atk4\\Core\\Tests\\Phpunit\\TestCaseTest::getStatus\(\)\.$~'
            count: 1
        -
            path: 'tests/Phpunit/TestCaseTest.php'
            message: '~^Access to constant STATUS_INCOMPLETE on an unknown class PHPUnit\\Runner\\BaseTestRunner\.$~'
            count: 1

        # https://github.com/phpstan/phpstan/issues/10150
        -
            path: 'src/DebugTrait.php'
            message: '~^Method Atk4\\Core\\Tests\\DebugPsrMock::\w+\(\) overrides method Psr\\Log\\LoggerInterface::\w+\(\) but is missing the #\[\\Override\] attribute\.$~'
            count: 9