Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update config for phpstan #180

Merged
merged 2 commits into from
Mar 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"assignees": [
"mimmi20"
],
"automerge": true,
"automerge": false,
"commitBody": "Signed-off-by: {{{gitAuthor}}}",
"commitBodyTable": true,
"dependencyDashboard": false,
Expand All @@ -19,7 +19,7 @@
"lockFileMaintenance": {
"enabled": false
},
"platformAutomerge": true,
"platformAutomerge": false,
"prBodyColumns": [
"Package",
"Change",
Expand Down
31 changes: 0 additions & 31 deletions .github/workflows/automerge.yml

This file was deleted.

51 changes: 48 additions & 3 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,73 @@ parameters:
- %currentWorkingDirectory%/vendor/squizlabs/php_codesniffer/autoload.php
- %currentWorkingDirectory%/vendor/squizlabs/php_codesniffer/src/Util/Tokens.php

# reports occurrences of type-checking functions always evaluated to true
checkAlwaysTrueCheckTypeFunctionCall: true

# reports instanceof occurrences always evaluated to true
checkAlwaysTrueInstanceof: true

# reports === and !== occurrences always evaluated to true
checkAlwaysTrueStrictComparison: true

# enable stricter analysis of benevolent union types
checkBenevolentUnionTypes: true

# reports use of dynamic properties as undefined
checkDynamicProperties: true

# reports code paths with missing return statement in functions and methods with @return mixed PHPDoc
checkExplicitMixedMissingReturn: true

# reports function and method calls with incorrect name case
checkFunctionNameCase: true
checkGenericClassInNonGenericObjectType: false

# it requires type variables always be specified in typehints
checkGenericClassInNonGenericObjectType: true

# be strict about values with an unspecified (implicit mixed) type
checkImplicitMixed: true

# reports references to built-in classes with incorrect name case
checkInternalClassCaseSensitivity: true

# require that callable signatures are specified
checkMissingCallableSignature: true

# checks for missing typehints in iterables
checkMissingIterableValueType: true

# reports return typehints that could be narrowed down because some of the listed types are never returned
checkTooWideReturnTypesInProtectedAndPublicMethods: true

# reports properties with native types that weren’t initialized in the class constructor
checkUninitializedProperties: true

# doesn’t require typehints for properties if the types can be inferred from constructor injection
inferPrivatePropertyTypeFromConstructor: false

# prevents reading key and value variables set in foreach when iterating over a non-empty array
polluteScopeWithAlwaysIterableForeach: false

# prevents reading variables set in for loop initial statement and while loop condition after the loop
polluteScopeWithLoopInitialAssignments: false
# reportAlwaysTrueInLastCondition: true

# report always true last condition in a series of elseif branches and match expression arms
reportAlwaysTrueInLastCondition: true

# reports violations of parameter type contravariance and return type covariance
reportMaybesInMethodSignatures: true

# reports violations of property type invariance
reportMaybesInPropertyPhpDocTypes: true

# reports violations of parameter type contravariance and return type covariance in static methods
reportStaticMethodSignatures: true
# reportWrongPhpDocTypeInVarTag: true

#
reportWrongPhpDocTypeInVarTag: true

# differentiate between PHPDoc and native types (if false)
treatPhpDocTypesAsCertain: false

tipsOfTheDay: false
Expand Down