Skip to content

Commit

Permalink
Disable certain PHPStan checks for tests + CS
Browse files Browse the repository at this point in the history
  • Loading branch information
apfelbox committed Jun 6, 2024
1 parent b4a703f commit b3aeb37
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 23 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

* (improvement) Add `-v` flag to PHPStan call to also show the error identifiers.
* (improvement) Add editor URL to PHPStan config.
* (improvement) Disable certain PHPStan checks for tests.
* (improvement) Disable `missingType.iterableValue` PHPStan check globally.


1.3.2
Expand Down
52 changes: 32 additions & 20 deletions phpstan/lib.neon
Original file line number Diff line number Diff line change
@@ -1,24 +1,36 @@
parameters:
level: 9
level: 9

editorUrl: 'phpstorm://open?file=%%file%%&line=%%line%%'
editorUrl: 'phpstorm://open?file=%%file%%&line=%%line%%'

checkAlwaysTrueCheckTypeFunctionCall: true
checkAlwaysTrueInstanceof: true
checkAlwaysTrueStrictComparison: true
checkDynamicProperties: true
checkExplicitMixedMissingReturn: true
checkUninitializedProperties: true
inferPrivatePropertyTypeFromConstructor: true
polluteScopeWithLoopInitialAssignments: false
reportPossiblyNonexistentConstantArrayOffset: true
reportUnmatchedIgnoredErrors: false
treatPhpDocTypesAsCertain: false
checkAlwaysTrueCheckTypeFunctionCall: true
checkAlwaysTrueInstanceof: true
checkAlwaysTrueStrictComparison: true
checkDynamicProperties: true
checkExplicitMixedMissingReturn: true
checkUninitializedProperties: true
inferPrivatePropertyTypeFromConstructor: true
polluteScopeWithLoopInitialAssignments: false
reportPossiblyNonexistentConstantArrayOffset: true
reportUnmatchedIgnoredErrors: false
treatPhpDocTypesAsCertain: false

excludePaths:
analyse:
- %currentWorkingDirectory%/vendor
analyseAndScan:
- %currentWorkingDirectory%/node_modules
- %currentWorkingDirectory%/var
- %currentWorkingDirectory%/vendor-bin
excludePaths:
analyse:
- %currentWorkingDirectory%/vendor
analyseAndScan:
- %currentWorkingDirectory%/node_modules
- %currentWorkingDirectory%/var
- %currentWorkingDirectory%/vendor-bin

ignoreErrors:
- identifier: missingType.iterableValue
-
identifier: argument.type
path: %currentWorkingDirectory%/tests/*
-
identifier: staticMethod.alreadyNarrowedType
path: %currentWorkingDirectory%/tests/*
-
identifier: method.deprecated
path: %currentWorkingDirectory%/tests/*
6 changes: 3 additions & 3 deletions phpstan/symfony.neon
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
includes:
- lib.neon
- lib.neon

parameters:
symfony:
container_xml_path: %currentWorkingDirectory%/var/cache/dev/App_KernelDevDebugContainer.xml
symfony:
container_xml_path: %currentWorkingDirectory%/var/cache/dev/App_KernelDevDebugContainer.xml

0 comments on commit b3aeb37

Please sign in to comment.