We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -41,6 +41,7 @@ |
||
41 | 41 | * check if equal to 0 no check is done. Must be greater or equal to 0. |
42 | 42 | * |
43 | 43 | * @param $value |
44 | + * @param string $name |
|
44 | 45 | */ |
45 | 46 | protected static function checkIfGreaterOrEqualToZero($name, $value) |
46 | 47 | { |
@@ -14,7 +14,6 @@ |
||
14 | 14 | use GraphQL\Error; |
15 | 15 | use GraphQL\Executor\Values; |
16 | 16 | use GraphQL\Language\AST\Field; |
17 | -use GraphQL\Language\AST\FragmentSpread; |
|
18 | 17 | use GraphQL\Language\AST\Node; |
19 | 18 | use GraphQL\Language\AST\OperationDefinition; |
20 | 19 | use GraphQL\Language\AST\SelectionSet; |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | [ |
90 | 90 | // Visit FragmentDefinition after visiting FragmentSpread |
91 | 91 | 'visitSpreadFragments' => true, |
92 | - Node::SELECTION_SET => function (SelectionSet $selectionSet) use ($context) { |
|
92 | + Node::SELECTION_SET => function(SelectionSet $selectionSet) use ($context) { |
|
93 | 93 | $this->fieldAstAndDefs = $this->collectFieldASTsAndDefs( |
94 | 94 | $context, |
95 | 95 | $context->getParentType(), |
@@ -98,13 +98,13 @@ discard block |
||
98 | 98 | $this->fieldAstAndDefs |
99 | 99 | ); |
100 | 100 | }, |
101 | - Node::VARIABLE_DEFINITION => function ($def) { |
|
101 | + Node::VARIABLE_DEFINITION => function($def) { |
|
102 | 102 | $this->variableDefs[] = $def; |
103 | 103 | |
104 | 104 | return Visitor::skipNode(); |
105 | 105 | }, |
106 | 106 | Node::OPERATION_DEFINITION => [ |
107 | - 'leave' => function (OperationDefinition $operationDefinition) use ($context, &$complexity) { |
|
107 | + 'leave' => function(OperationDefinition $operationDefinition) use ($context, &$complexity) { |
|
108 | 108 | $complexity = $this->fieldComplexity($operationDefinition, $complexity); |
109 | 109 | |
110 | 110 | if ($complexity > $this->getMaxQueryComplexity()) { |
@@ -12,10 +12,8 @@ |
||
12 | 12 | namespace Overblog\GraphQLBundle\Request\Validator\Rule; |
13 | 13 | |
14 | 14 | use GraphQL\Error; |
15 | -use GraphQL\Language\AST\Field; |
|
16 | 15 | use GraphQL\Language\AST\Node; |
17 | 16 | use GraphQL\Language\AST\OperationDefinition; |
18 | -use GraphQL\Language\AST\SelectionSet; |
|
19 | 17 | use GraphQL\Validator\ValidationContext; |
20 | 18 | |
21 | 19 | class QueryDepth extends AbstractQuerySecurity |
@@ -60,7 +60,7 @@ |
||
60 | 60 | $context, |
61 | 61 | [ |
62 | 62 | Node::OPERATION_DEFINITION => [ |
63 | - 'leave' => function (OperationDefinition $operationDefinition) use ($context) { |
|
63 | + 'leave' => function(OperationDefinition $operationDefinition) use ($context) { |
|
64 | 64 | $maxDepth = $this->fieldDepth($operationDefinition); |
65 | 65 | |
66 | 66 | if ($maxDepth > $this->getMaxQueryDepth()) { |
@@ -111,12 +111,12 @@ |
||
111 | 111 | $node |
112 | 112 | ->info('Disabled if equal to false.') |
113 | 113 | ->beforeNormalization() |
114 | - ->ifTrue(function ($v) { return false === $v; }) |
|
115 | - ->then(function () use ($disabledValue) { return $disabledValue; }) |
|
114 | + ->ifTrue(function($v) { return false === $v; }) |
|
115 | + ->then(function() use ($disabledValue) { return $disabledValue; }) |
|
116 | 116 | ->end() |
117 | 117 | ->defaultFalse() |
118 | 118 | ->validate() |
119 | - ->ifTrue(function ($v) { return $v < 0; }) |
|
119 | + ->ifTrue(function($v) { return $v < 0; }) |
|
120 | 120 | ->thenInvalid('"overblog_graphql.security.'.$name.'" must be greater or equal to 0.') |
121 | 121 | ->end() |
122 | 122 | ; |
@@ -70,14 +70,14 @@ |
||
70 | 70 | 'fields' => [ |
71 | 71 | 'firstName' => ['type' => Type::nonNull(Type::string())], |
72 | 72 | 'dogs' => [ |
73 | - 'type' => function () { |
|
73 | + 'type' => function() { |
|
74 | 74 | return Type::nonNull( |
75 | 75 | Type::listOf( |
76 | 76 | Type::nonNull(self::buildDogType()) |
77 | 77 | ) |
78 | 78 | ); |
79 | 79 | }, |
80 | - 'complexity' => function ($childrenComplexity, $args) { |
|
80 | + 'complexity' => function($childrenComplexity, $args) { |
|
81 | 81 | $complexity = isset($args['name']) ? 1 : 10; |
82 | 82 | |
83 | 83 | return $childrenComplexity + $complexity; |