We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -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; |
@@ -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()) { |
@@ -117,6 +117,9 @@ |
||
117 | 117 | ); |
118 | 118 | } |
119 | 119 | |
120 | + /** |
|
121 | + * @param Node $node |
|
122 | + */ |
|
120 | 123 | private function fieldComplexity($node, $complexity = 0) |
121 | 124 | { |
122 | 125 | if (isset($node->selectionSet) && $node->selectionSet instanceof SelectionSet) { |
@@ -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()) { |
@@ -79,6 +79,9 @@ |
||
79 | 79 | return $this->getMaxQueryDepth() !== static::DISABLED; |
80 | 80 | } |
81 | 81 | |
82 | + /** |
|
83 | + * @param Node $node |
|
84 | + */ |
|
82 | 85 | private function fieldDepth($node, $depth = 0, $maxDepth = 0) |
83 | 86 | { |
84 | 87 | if (isset($node->selectionSet) && $node->selectionSet instanceof SelectionSet) { |