Skip to content

Commit d1e6439

Browse files
committed
Lint
It isn't really practical to fix these PHPStan errors unfortunately.
1 parent 0abf17e commit d1e6439

File tree

2 files changed

+37
-3
lines changed

2 files changed

+37
-3
lines changed

app/GraphQL/Directives/FilterableDirective.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use GraphQL\Language\AST\InterfaceTypeDefinitionNode;
99
use GraphQL\Language\AST\ObjectTypeDefinitionNode;
1010
use GraphQL\Language\Parser;
11+
use JsonException;
1112
use Nuwave\Lighthouse\Schema\AST\DocumentAST;
1213
use Nuwave\Lighthouse\Schema\Directives\BaseDirective;
1314
use Nuwave\Lighthouse\Support\Contracts\FieldManipulator;
@@ -21,12 +22,15 @@ public static function definition(): string
2122
GRAPHQL;
2223
}
2324

25+
/**
26+
* @throws JsonException
27+
* @throws \GraphQL\Error\SyntaxError
28+
*/
2429
public function manipulateFieldDefinition(
2530
DocumentAST &$documentAST,
2631
FieldDefinitionNode &$fieldDefinition,
2732
ObjectTypeDefinitionNode|InterfaceTypeDefinitionNode &$parentType,
28-
): void
29-
{
33+
): void {
3034
$typeName = $parentType->name->value . 'FilterInput';
3135

3236
// We only have to do this once per type, even though this is called once per filterable directive
@@ -50,7 +54,7 @@ public function manipulateFieldDefinition(
5054

5155
foreach ($filterableFields as $field) {
5256
$name = $field->name->value;
53-
$type = $field->type->name?->value ?? $field->type->type->name->value;
57+
$type = $field->type->name->value ?? $field->type->type->name->value;
5458
$description = $field->description?->value;
5559

5660
// Only allow one field at a time.

phpstan-baseline.neon

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,16 @@ parameters:
191191
count: 1
192192
path: app/Exceptions/Handler.php
193193

194+
-
195+
message: "#^Access to an undefined property GraphQL\\\\Language\\\\AST\\\\ListTypeNode\\|GraphQL\\\\Language\\\\AST\\\\NamedTypeNode\\|GraphQL\\\\Language\\\\AST\\\\NonNullTypeNode\\:\\:\\$name\\.$#"
196+
count: 1
197+
path: app/GraphQL/Directives/FilterDirective.php
198+
199+
-
200+
message: "#^Access to an undefined property GraphQL\\\\Language\\\\AST\\\\ListTypeNode\\|GraphQL\\\\Language\\\\AST\\\\NamedTypeNode\\|GraphQL\\\\Language\\\\AST\\\\NonNullTypeNode\\:\\:\\$type\\.$#"
201+
count: 1
202+
path: app/GraphQL/Directives/FilterDirective.php
203+
194204
-
195205
message: "#^Binary operation \"\\.\" between non\\-falsy\\-string and mixed results in an error\\.$#"
196206
count: 2
@@ -226,6 +236,26 @@ parameters:
226236
count: 1
227237
path: app/GraphQL/Directives/FilterDirective.php
228238

239+
-
240+
message: "#^Access to an undefined property GraphQL\\\\Language\\\\AST\\\\BooleanValueNode\\|GraphQL\\\\Language\\\\AST\\\\EnumValueNode\\|GraphQL\\\\Language\\\\AST\\\\FloatValueNode\\|GraphQL\\\\Language\\\\AST\\\\IntValueNode\\|GraphQL\\\\Language\\\\AST\\\\ListValueNode\\|GraphQL\\\\Language\\\\AST\\\\NullValueNode\\|GraphQL\\\\Language\\\\AST\\\\ObjectValueNode\\|GraphQL\\\\Language\\\\AST\\\\StringValueNode\\|GraphQL\\\\Language\\\\AST\\\\VariableNode\\:\\:\\$value\\.$#"
241+
count: 1
242+
path: app/GraphQL/Directives/FilterableDirective.php
243+
244+
-
245+
message: "#^Access to an undefined property GraphQL\\\\Language\\\\AST\\\\ListTypeNode\\|GraphQL\\\\Language\\\\AST\\\\NamedTypeNode\\|GraphQL\\\\Language\\\\AST\\\\NonNullTypeNode\\:\\:\\$name\\.$#"
246+
count: 2
247+
path: app/GraphQL/Directives/FilterableDirective.php
248+
249+
-
250+
message: "#^Access to an undefined property GraphQL\\\\Language\\\\AST\\\\ListTypeNode\\|GraphQL\\\\Language\\\\AST\\\\NamedTypeNode\\|GraphQL\\\\Language\\\\AST\\\\NonNullTypeNode\\:\\:\\$type\\.$#"
251+
count: 1
252+
path: app/GraphQL/Directives/FilterableDirective.php
253+
254+
-
255+
message: "#^Parameter \\#2 \\$array of function array_key_exists expects array, array\\<string, GraphQL\\\\Language\\\\AST\\\\Node&GraphQL\\\\Language\\\\AST\\\\TypeDefinitionNode\\>\\|GraphQL\\\\Language\\\\AST\\\\NodeList\\<GraphQL\\\\Language\\\\AST\\\\Node&GraphQL\\\\Language\\\\AST\\\\TypeDefinitionNode\\> given\\.$#"
256+
count: 1
257+
path: app/GraphQL/Directives/FilterableDirective.php
258+
229259
-
230260
message: "#^Dynamic call to static method Illuminate\\\\Contracts\\\\Auth\\\\Guard\\:\\:user\\(\\)\\.$#"
231261
count: 1

0 commit comments

Comments
 (0)