parameters: level: 5 paths: - src scanDirectories: # In order to 'recognize' Twig and Carbon functions in global scope - %currentWorkingDirectory%/vendor/twig/twig/src/Extension - %currentWorkingDirectory%/vendor/nesbot/carbon/src/Carbon ignoreErrors: # false positive: `Unreachable statement - code above always terminates.` # Note: https://github.com/phpstan/phpstan/issues/2651 is marked as fixed, but the issue remains. - message: '#Unreachable statement - code above always terminates#' path: %currentWorkingDirectory%/src/* # false positive: `TranslationInterface does not know about FieldTranslation::getValue().` Skip this error. - message: '#Call to an undefined method Knp\\DoctrineBehaviors\\Contract\\Entity\\TranslationInterface#' path: %currentWorkingDirectory%/src/* # false positive: Parameters in Storage\Directive\OrderDirective::orderByNumericField() aren't seen as integers - message: '#of method Doctrine\\ORM\\Query\\Expr::substring\(\) expects int#' path: %currentWorkingDirectory%/src/Storage/FieldQueryUtils.php # Call to undefined __get() - message: '#Call to an undefined method Sirius\\Upload\\Result\\ResultInterface|Symfony\\Component\\HttpFoundation\\File\\File::__get\(\)#' path: %currentWorkingDirectory%/src/Controller/Backend/Async/UploadController.php # false positive: An item to the Logger's Record added by us isn't recognized - message: "#Offset '.*' ([a-z ]*)on array#" path: %currentWorkingDirectory%/src/Log/LogHandler.php includes: - vendor/phpstan/phpstan-symfony/extension.neon - vendor/phpstan/phpstan-doctrine/extension.neon # - vendor/thecodingmachine/phpstan-safe-rule/phpstan-safe-rule.neon # make ON when thecodingmachine/safe will get stable # Todo: add these: https://tomasvotruba.com/blog/2020/12/14/new-in-symplify-9-more-than-110-phpstan-rules/ # services: # - # class: Symplify\CodingStandard\Rules\ForbiddenFuncCallRule # tags: [phpstan.rules.rule] # arguments: # forbiddenFunctions: ['d', 'dd', 'dump', 'var_dump', 'extract'] # # - Symplify\PackageBuilder\Matcher\ArrayStringAndFnMatcher