forked from janatjak/graphqlite-bundle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve phpstan config, add baseline
- Loading branch information
1 parent
0532bbc
commit 498296d
Showing
4 changed files
with
188 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ | |
/var | ||
/cache | ||
.phpunit.result.cache | ||
.phpstan-cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,162 @@ | ||
parameters: | ||
ignoreErrors: | ||
- | ||
message: "#^Anonymous function should have native return typehint \"array\"\\.$#" | ||
count: 1 | ||
path: Controller/GraphqliteController.php | ||
|
||
- | ||
message: "#^Instanceof between GraphQL\\\\Executor\\\\Promise\\\\Promise and GraphQL\\\\Executor\\\\Promise\\\\Promise will always evaluate to true\\.$#" | ||
count: 1 | ||
path: Controller/GraphqliteController.php | ||
|
||
- | ||
message: "#^Anonymous function should have native return typehint \"array\"\\.$#" | ||
count: 1 | ||
path: DependencyInjection/GraphqliteCompilerPass.php | ||
|
||
- | ||
message: "#^Argument of an invalid type array\\|bool\\|float\\|int\\|string\\|null supplied for foreach, only iterables are supported\\.$#" | ||
count: 3 | ||
path: DependencyInjection/GraphqliteCompilerPass.php | ||
|
||
- | ||
message: "#^Binary operation \"\\.\" between 'security\\.firewall…' and array\\|bool\\|float\\|int\\|string\\|null results in an error\\.$#" | ||
count: 2 | ||
path: DependencyInjection/GraphqliteCompilerPass.php | ||
|
||
- | ||
message: "#^Cannot cast \\(array&nonEmpty\\)\\|float\\|int\\<min, \\-1\\>\\|int\\<1, max\\>\\|string\\|true to int\\.$#" | ||
count: 2 | ||
path: DependencyInjection/GraphqliteCompilerPass.php | ||
|
||
- | ||
message: "#^Negated boolean expression is always true\\.$#" | ||
count: 1 | ||
path: DependencyInjection/GraphqliteCompilerPass.php | ||
|
||
- | ||
message: "#^Property TheCodingMachine\\\\Graphqlite\\\\Bundle\\\\DependencyInjection\\\\GraphqliteCompilerPass\\:\\:\\$cacheDir \\(string\\) does not accept array\\|bool\\|float\\|int\\|string\\|null\\.$#" | ||
count: 1 | ||
path: DependencyInjection/GraphqliteCompilerPass.php | ||
|
||
- | ||
message: "#^Anonymous function should have native return typehint \"string\"\\.$#" | ||
count: 2 | ||
path: DependencyInjection/GraphqliteExtension.php | ||
|
||
- | ||
message: "#^Method TheCodingMachine\\\\Graphqlite\\\\Bundle\\\\DependencyInjection\\\\GraphqliteExtension\\:\\:getNamespaceDir\\(\\) is unused\\.$#" | ||
count: 1 | ||
path: DependencyInjection/GraphqliteExtension.php | ||
|
||
- | ||
message: "#^Class Overblog\\\\GraphiQLBundle\\\\Config\\\\GraphQLEndpoint\\\\RootResolver referenced with incorrect case\\: Overblog\\\\GraphiQLBundle\\\\Config\\\\GraphqlEndpoint\\\\RootResolver\\.$#" | ||
count: 1 | ||
path: DependencyInjection/OverblogGraphiQLEndpointWiringPass.php | ||
|
||
- | ||
message: "#^Call to static method forSchemaAndResolver\\(\\) on an unknown class TheCodingMachine\\\\Graphqlite\\\\Bundle\\\\GraphiQL\\\\GraphQLEndpointInvalidSchemaException\\.$#" | ||
count: 1 | ||
path: GraphiQL/EndpointResolver.php | ||
|
||
- | ||
message: "#^Property TheCodingMachine\\\\Graphqlite\\\\Bundle\\\\GraphiQL\\\\EndpointResolver\\:\\:\\$requestStack has no typehint specified\\.$#" | ||
count: 1 | ||
path: GraphiQL/EndpointResolver.php | ||
|
||
- | ||
message: "#^Call to an undefined method ReflectionType\\:\\:getName\\(\\)\\.$#" | ||
count: 1 | ||
path: Mappers/RequestParameterMiddleware.php | ||
|
||
- | ||
message: "#^Parameter \\#2 \\.\\.\\.\\$args of function array_merge expects array, array\\<GraphQL\\\\Validator\\\\Rules\\\\ValidationRule\\>\\|\\(callable\\) given\\.$#" | ||
count: 1 | ||
path: Server/ServerConfig.php | ||
|
||
- | ||
message: "#^Method TheCodingMachine\\\\Graphqlite\\\\Bundle\\\\Tests\\\\Fixtures\\\\Controller\\\\TestGraphqlController\\:\\:contacts\\(\\) return type has no value type specified in iterable type Porpaginas\\\\Arrays\\\\ArrayResult\\.$#" | ||
count: 1 | ||
path: Tests/Fixtures/Controller/TestGraphqlController.php | ||
|
||
- | ||
message: "#^PHPDoc tag @return with type array\\<TheCodingMachine\\\\Graphqlite\\\\Bundle\\\\Tests\\\\Fixtures\\\\Entities\\\\Contact\\> is incompatible with native type Porpaginas\\\\Arrays\\\\ArrayResult\\.$#" | ||
count: 1 | ||
path: Tests/Fixtures/Controller/TestGraphqlController.php | ||
|
||
- | ||
message: "#^Method TheCodingMachine\\\\Graphqlite\\\\Bundle\\\\Tests\\\\Fixtures\\\\Entities\\\\Contact\\:\\:injectServicePrefetch\\(\\) has parameter \\$prefetchData with no typehint specified\\.$#" | ||
count: 1 | ||
path: Tests/Fixtures/Entities/Contact.php | ||
|
||
- | ||
message: "#^Method TheCodingMachine\\\\Graphqlite\\\\Bundle\\\\Tests\\\\Fixtures\\\\Entities\\\\Contact\\:\\:prefetchData\\(\\) has no return typehint specified\\.$#" | ||
count: 1 | ||
path: Tests/Fixtures/Entities/Contact.php | ||
|
||
- | ||
message: "#^Method TheCodingMachine\\\\Graphqlite\\\\Bundle\\\\Tests\\\\Fixtures\\\\Entities\\\\Contact\\:\\:prefetchData\\(\\) has parameter \\$iterable with no value type specified in iterable type iterable\\.$#" | ||
count: 1 | ||
path: Tests/Fixtures/Entities/Contact.php | ||
|
||
- | ||
message: "#^Cannot call method assertValid\\(\\) on object\\|null\\.$#" | ||
count: 2 | ||
path: Tests/FunctionalTest.php | ||
|
||
- | ||
message: "#^Cannot call method handleRequest\\(\\) on object\\|null\\.$#" | ||
count: 1 | ||
path: Tests/FunctionalTest.php | ||
|
||
- | ||
message: "#^Method TheCodingMachine\\\\Graphqlite\\\\Bundle\\\\Tests\\\\FunctionalTest\\:\\:logIn\\(\\) has no return typehint specified\\.$#" | ||
count: 1 | ||
path: Tests/FunctionalTest.php | ||
|
||
- | ||
message: "#^Parameter \\#1 \\$json of function json_decode expects string, string\\|false given\\.$#" | ||
count: 15 | ||
path: Tests/FunctionalTest.php | ||
|
||
- | ||
message: "#^Parameter \\#3 \\$message of method PHPUnit\\\\Framework\\\\Assert\\:\\:assertSame\\(\\) expects string, string\\|false given\\.$#" | ||
count: 1 | ||
path: Tests/FunctionalTest.php | ||
|
||
- | ||
message: "#^Anonymous function should have native return typehint \"void\"\\.$#" | ||
count: 1 | ||
path: Tests/GraphqliteTestingKernel.php | ||
|
||
- | ||
message: "#^Method TheCodingMachine\\\\Graphqlite\\\\Bundle\\\\Tests\\\\GraphqliteTestingKernel\\:\\:configureContainer\\(\\) has no return typehint specified\\.$#" | ||
count: 1 | ||
path: Tests/GraphqliteTestingKernel.php | ||
|
||
- | ||
message: "#^Method TheCodingMachine\\\\Graphqlite\\\\Bundle\\\\Tests\\\\GraphqliteTestingKernel\\:\\:configureRoutes\\(\\) has no return typehint specified\\.$#" | ||
count: 1 | ||
path: Tests/GraphqliteTestingKernel.php | ||
|
||
- | ||
message: "#^Method TheCodingMachine\\\\Graphqlite\\\\Bundle\\\\Tests\\\\GraphqliteTestingKernel\\:\\:configureRoutes\\(\\) has parameter \\$routes with no typehint specified\\.$#" | ||
count: 1 | ||
path: Tests/GraphqliteTestingKernel.php | ||
|
||
- | ||
message: "#^Property TheCodingMachine\\\\Graphqlite\\\\Bundle\\\\Tests\\\\GraphqliteTestingKernel\\:\\:\\$enableLogin \\(string\\) does not accept string\\|null\\.$#" | ||
count: 1 | ||
path: Tests/GraphqliteTestingKernel.php | ||
|
||
- | ||
message: "#^Cannot call method assertValid\\(\\) on object\\|null\\.$#" | ||
count: 1 | ||
path: Tests/NoSecurityBundleTest.php | ||
|
||
- | ||
message: "#^Parameter \\#1 \\$json of function json_decode expects string, string\\|false given\\.$#" | ||
count: 1 | ||
path: Tests/NoSecurityBundleTest.php | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,26 @@ | ||
includes: | ||
- vendor/phpstan/phpstan/conf/bleedingEdge.neon | ||
- vendor/thecodingmachine/phpstan-strict-rules/phpstan-strict-rules.neon | ||
- phpstan.baseline.neon | ||
parameters: | ||
tmpDir: .phpstan-cache | ||
paths: | ||
- . | ||
excludePaths: | ||
- vendor | ||
- cache | ||
- .phpstan-cache | ||
level: max | ||
polluteScopeWithLoopInitialAssignments: false | ||
polluteScopeWithAlwaysIterableForeach: false | ||
checkAlwaysTrueCheckTypeFunctionCall: true | ||
checkAlwaysTrueInstanceof: true | ||
checkAlwaysTrueStrictComparison: true | ||
checkExplicitMixedMissingReturn: true | ||
checkFunctionNameCase: true | ||
checkInternalClassCaseSensitivity: true | ||
checkMissingClosureNativeReturnTypehintRule: true | ||
checkTooWideReturnTypesInProtectedAndPublicMethods: true | ||
treatPhpDocTypesAsCertain: false | ||
ignoreErrors: | ||
- "#Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition::children\\(\\)#" | ||
#includes: | ||
# - vendor/thecodingmachine/phpstan-strict-rules/phpstan-strict-rules.neon |