@@ -23,9 +23,9 @@ discard block |
||
| 23 | 23 | public function getVisitor(ValidationContext $context) |
| 24 | 24 | { |
| 25 | 25 | return [ |
| 26 | - NodeKind::FIELD => function (FieldNode $node) use ($context) { |
|
| 26 | + NodeKind::FIELD => function(FieldNode $node) use ($context) { |
|
| 27 | 27 | $type = $context->getParentType(); |
| 28 | - if (! $type) { |
|
| 28 | + if (!$type) { |
|
| 29 | 29 | return; |
| 30 | 30 | } |
| 31 | 31 | |
@@ -84,19 +84,19 @@ discard block |
||
| 84 | 84 | |
| 85 | 85 | foreach ($schema->getPossibleTypes($type) as $possibleType) { |
| 86 | 86 | $fields = $possibleType->getFields(); |
| 87 | - if (! isset($fields[$fieldName])) { |
|
| 87 | + if (!isset($fields[$fieldName])) { |
|
| 88 | 88 | continue; |
| 89 | 89 | } |
| 90 | 90 | // This object type defines this field. |
| 91 | 91 | $suggestedObjectTypes[] = $possibleType->name; |
| 92 | 92 | foreach ($possibleType->getInterfaces() as $possibleInterface) { |
| 93 | 93 | $fields = $possibleInterface->getFields(); |
| 94 | - if (! isset($fields[$fieldName])) { |
|
| 94 | + if (!isset($fields[$fieldName])) { |
|
| 95 | 95 | continue; |
| 96 | 96 | } |
| 97 | 97 | // This interface type defines this field. |
| 98 | 98 | $interfaceUsageCount[$possibleInterface->name] = |
| 99 | - ! isset($interfaceUsageCount[$possibleInterface->name]) |
|
| 99 | + !isset($interfaceUsageCount[$possibleInterface->name]) |
|
| 100 | 100 | ? 0 |
| 101 | 101 | : $interfaceUsageCount[$possibleInterface->name] + 1; |
| 102 | 102 | } |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | $suggestions = Utils::quotedOrList($suggestedTypeNames); |
| 154 | 154 | |
| 155 | 155 | $message .= sprintf(' Did you mean to use an inline fragment on %s?', $suggestions); |
| 156 | - } elseif (! empty($suggestedFieldNames)) { |
|
| 156 | + } elseif (!empty($suggestedFieldNames)) { |
|
| 157 | 157 | $suggestions = Utils::quotedOrList($suggestedFieldNames); |
| 158 | 158 | |
| 159 | 159 | $message .= sprintf(' Did you mean %s?', $suggestions); |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | $context, |
| 29 | 29 | [ |
| 30 | 30 | NodeKind::OPERATION_DEFINITION => [ |
| 31 | - 'leave' => function (OperationDefinitionNode $operationDefinition) use ($context) { |
|
| 31 | + 'leave' => function(OperationDefinitionNode $operationDefinition) use ($context) { |
|
| 32 | 32 | $maxDepth = $this->fieldDepth($operationDefinition); |
| 33 | 33 | |
| 34 | 34 | if ($maxDepth <= $this->getMaxQueryDepth()) { |
@@ -43,11 +43,11 @@ discard block |
||
| 43 | 43 | $this->spreadPathIndexByName = []; |
| 44 | 44 | |
| 45 | 45 | return [ |
| 46 | - NodeKind::OPERATION_DEFINITION => function () { |
|
| 46 | + NodeKind::OPERATION_DEFINITION => function() { |
|
| 47 | 47 | return Visitor::skipNode(); |
| 48 | 48 | }, |
| 49 | - NodeKind::FRAGMENT_DEFINITION => function (FragmentDefinitionNode $node) use ($context) { |
|
| 50 | - if (! isset($this->visitedFrags[$node->name->value])) { |
|
| 49 | + NodeKind::FRAGMENT_DEFINITION => function(FragmentDefinitionNode $node) use ($context) { |
|
| 50 | + if (!isset($this->visitedFrags[$node->name->value])) { |
|
| 51 | 51 | $this->detectCycleRecursive($node, $context); |
| 52 | 52 | } |
| 53 | 53 | |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | $spreadName, |
| 99 | 99 | Utils::map( |
| 100 | 100 | $cyclePath, |
| 101 | - function ($s) { |
|
| 101 | + function($s) { |
|
| 102 | 102 | return $s->name->value; |
| 103 | 103 | } |
| 104 | 104 | ) |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | return sprintf( |
| 120 | 120 | 'Cannot spread fragment "%s" within itself%s.', |
| 121 | 121 | $fragName, |
| 122 | - ! empty($spreadNames) ? ' via ' . implode(', ', $spreadNames) : '' |
|
| 122 | + !empty($spreadNames) ? ' via ' . implode(', ', $spreadNames) : '' |
|
| 123 | 123 | ); |
| 124 | 124 | } |
| 125 | 125 | } |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | $this->cachedFieldsAndFragmentNames = new \SplObjectStorage(); |
| 59 | 59 | |
| 60 | 60 | return [ |
| 61 | - NodeKind::SELECTION_SET => function (SelectionSetNode $selectionSet) use ($context) { |
|
| 61 | + NodeKind::SELECTION_SET => function(SelectionSetNode $selectionSet) use ($context) { |
|
| 62 | 62 | $conflicts = $this->findConflictsWithinSelectionSet( |
| 63 | 63 | $context, |
| 64 | 64 | $context->getParentType(), |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | } |
| 257 | 257 | $responseName = $selection->alias ? $selection->alias->value : $fieldName; |
| 258 | 258 | |
| 259 | - if (! isset($astAndDefs[$responseName])) { |
|
| 259 | + if (!isset($astAndDefs[$responseName])) { |
|
| 260 | 260 | $astAndDefs[$responseName] = []; |
| 261 | 261 | } |
| 262 | 262 | $astAndDefs[$responseName][] = [$parentType, $selection, $fieldDef]; |
@@ -315,7 +315,7 @@ discard block |
||
| 315 | 315 | $fields[$i], |
| 316 | 316 | $fields[$j] |
| 317 | 317 | ); |
| 318 | - if (! $conflict) { |
|
| 318 | + if (!$conflict) { |
|
| 319 | 319 | continue; |
| 320 | 320 | } |
| 321 | 321 | |
@@ -365,7 +365,7 @@ discard block |
||
| 365 | 365 | $type1 = $def1 ? $def1->getType() : null; |
| 366 | 366 | $type2 = $def2 ? $def2->getType() : null; |
| 367 | 367 | |
| 368 | - if (! $areMutuallyExclusive) { |
|
| 368 | + if (!$areMutuallyExclusive) { |
|
| 369 | 369 | // Two aliases must refer to the same field. |
| 370 | 370 | $name1 = $ast1->name->value; |
| 371 | 371 | $name2 = $ast2->name->value; |
@@ -377,7 +377,7 @@ discard block |
||
| 377 | 377 | ]; |
| 378 | 378 | } |
| 379 | 379 | |
| 380 | - if (! $this->sameArguments($ast1->arguments ?: [], $ast2->arguments ?: [])) { |
|
| 380 | + if (!$this->sameArguments($ast1->arguments ?: [], $ast2->arguments ?: [])) { |
|
| 381 | 381 | return [ |
| 382 | 382 | [$responseName, 'they have differing arguments'], |
| 383 | 383 | [$ast1], |
@@ -439,11 +439,11 @@ discard block |
||
| 439 | 439 | break; |
| 440 | 440 | } |
| 441 | 441 | } |
| 442 | - if (! $argument2) { |
|
| 442 | + if (!$argument2) { |
|
| 443 | 443 | return false; |
| 444 | 444 | } |
| 445 | 445 | |
| 446 | - if (! $this->sameValue($argument1->value, $argument2->value)) { |
|
| 446 | + if (!$this->sameValue($argument1->value, $argument2->value)) { |
|
| 447 | 447 | return false; |
| 448 | 448 | } |
| 449 | 449 | } |
@@ -456,7 +456,7 @@ discard block |
||
| 456 | 456 | */ |
| 457 | 457 | private function sameValue(Node $value1, Node $value2) |
| 458 | 458 | { |
| 459 | - return (! $value1 && ! $value2) || (Printer::doPrint($value1) === Printer::doPrint($value2)); |
|
| 459 | + return (!$value1 && !$value2) || (Printer::doPrint($value1) === Printer::doPrint($value2)); |
|
| 460 | 460 | } |
| 461 | 461 | |
| 462 | 462 | /** |
@@ -470,23 +470,19 @@ discard block |
||
| 470 | 470 | { |
| 471 | 471 | if ($type1 instanceof ListOfType) { |
| 472 | 472 | return $type2 instanceof ListOfType ? |
| 473 | - $this->doTypesConflict($type1->getWrappedType(), $type2->getWrappedType()) : |
|
| 474 | - true; |
|
| 473 | + $this->doTypesConflict($type1->getWrappedType(), $type2->getWrappedType()) : true; |
|
| 475 | 474 | } |
| 476 | 475 | if ($type2 instanceof ListOfType) { |
| 477 | 476 | return $type1 instanceof ListOfType ? |
| 478 | - $this->doTypesConflict($type1->getWrappedType(), $type2->getWrappedType()) : |
|
| 479 | - true; |
|
| 477 | + $this->doTypesConflict($type1->getWrappedType(), $type2->getWrappedType()) : true; |
|
| 480 | 478 | } |
| 481 | 479 | if ($type1 instanceof NonNull) { |
| 482 | 480 | return $type2 instanceof NonNull ? |
| 483 | - $this->doTypesConflict($type1->getWrappedType(), $type2->getWrappedType()) : |
|
| 484 | - true; |
|
| 481 | + $this->doTypesConflict($type1->getWrappedType(), $type2->getWrappedType()) : true; |
|
| 485 | 482 | } |
| 486 | 483 | if ($type2 instanceof NonNull) { |
| 487 | 484 | return $type1 instanceof NonNull ? |
| 488 | - $this->doTypesConflict($type1->getWrappedType(), $type2->getWrappedType()) : |
|
| 489 | - true; |
|
| 485 | + $this->doTypesConflict($type1->getWrappedType(), $type2->getWrappedType()) : true; |
|
| 490 | 486 | } |
| 491 | 487 | if (Type::isLeafType($type1) || Type::isLeafType($type2)) { |
| 492 | 488 | return $type1 !== $type2; |
@@ -612,7 +608,7 @@ discard block |
||
| 612 | 608 | // maps, each field from the first field map must be compared to every field |
| 613 | 609 | // in the second field map to find potential conflicts. |
| 614 | 610 | foreach ($fieldMap1 as $responseName => $fields1) { |
| 615 | - if (! isset($fieldMap2[$responseName])) { |
|
| 611 | + if (!isset($fieldMap2[$responseName])) { |
|
| 616 | 612 | continue; |
| 617 | 613 | } |
| 618 | 614 | |
@@ -628,7 +624,7 @@ discard block |
||
| 628 | 624 | $fields1[$i], |
| 629 | 625 | $fields2[$j] |
| 630 | 626 | ); |
| 631 | - if (! $conflict) { |
|
| 627 | + if (!$conflict) { |
|
| 632 | 628 | continue; |
| 633 | 629 | } |
| 634 | 630 | |
@@ -662,7 +658,7 @@ discard block |
||
| 662 | 658 | $comparedFragments[$fragmentName] = true; |
| 663 | 659 | |
| 664 | 660 | $fragment = $context->getFragment($fragmentName); |
| 665 | - if (! $fragment) { |
|
| 661 | + if (!$fragment) { |
|
| 666 | 662 | return; |
| 667 | 663 | } |
| 668 | 664 | |
@@ -762,7 +758,7 @@ discard block |
||
| 762 | 758 | |
| 763 | 759 | $fragment1 = $context->getFragment($fragmentName1); |
| 764 | 760 | $fragment2 = $context->getFragment($fragmentName2); |
| 765 | - if (! $fragment1 || ! $fragment2) { |
|
| 761 | + if (!$fragment1 || !$fragment2) { |
|
| 766 | 762 | return; |
| 767 | 763 | } |
| 768 | 764 | |
@@ -834,7 +830,7 @@ discard block |
||
| 834 | 830 | [ |
| 835 | 831 | $responseName, |
| 836 | 832 | array_map( |
| 837 | - function ($conflict) { |
|
| 833 | + function($conflict) { |
|
| 838 | 834 | return $conflict[0]; |
| 839 | 835 | }, |
| 840 | 836 | $conflicts |
@@ -842,14 +838,14 @@ discard block |
||
| 842 | 838 | ], |
| 843 | 839 | array_reduce( |
| 844 | 840 | $conflicts, |
| 845 | - function ($allFields, $conflict) { |
|
| 841 | + function($allFields, $conflict) { |
|
| 846 | 842 | return array_merge($allFields, $conflict[1]); |
| 847 | 843 | }, |
| 848 | 844 | [$ast1] |
| 849 | 845 | ), |
| 850 | 846 | array_reduce( |
| 851 | 847 | $conflicts, |
| 852 | - function ($allFields, $conflict) { |
|
| 848 | + function($allFields, $conflict) { |
|
| 853 | 849 | return array_merge($allFields, $conflict[2]); |
| 854 | 850 | }, |
| 855 | 851 | [$ast2] |
@@ -876,7 +872,7 @@ discard block |
||
| 876 | 872 | { |
| 877 | 873 | if (is_array($reason)) { |
| 878 | 874 | $tmp = array_map( |
| 879 | - function ($tmp) { |
|
| 875 | + function($tmp) { |
|
| 880 | 876 | [$responseName, $subReason] = $tmp; |
| 881 | 877 | |
| 882 | 878 | $reasonMessage = self::reasonMessage($subReason); |
@@ -26,18 +26,18 @@ discard block |
||
| 26 | 26 | $this->fragmentDefs = []; |
| 27 | 27 | |
| 28 | 28 | return [ |
| 29 | - NodeKind::OPERATION_DEFINITION => function ($node) { |
|
| 29 | + NodeKind::OPERATION_DEFINITION => function($node) { |
|
| 30 | 30 | $this->operationDefs[] = $node; |
| 31 | 31 | |
| 32 | 32 | return Visitor::skipNode(); |
| 33 | 33 | }, |
| 34 | - NodeKind::FRAGMENT_DEFINITION => function (FragmentDefinitionNode $def) { |
|
| 34 | + NodeKind::FRAGMENT_DEFINITION => function(FragmentDefinitionNode $def) { |
|
| 35 | 35 | $this->fragmentDefs[] = $def; |
| 36 | 36 | |
| 37 | 37 | return Visitor::skipNode(); |
| 38 | 38 | }, |
| 39 | 39 | NodeKind::DOCUMENT => [ |
| 40 | - 'leave' => function () use ($context) { |
|
| 40 | + 'leave' => function() use ($context) { |
|
| 41 | 41 | $fragmentNameUsed = []; |
| 42 | 42 | |
| 43 | 43 | foreach ($this->operationDefs as $operation) { |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | |
| 49 | 49 | foreach ($this->fragmentDefs as $fragmentDef) { |
| 50 | 50 | $fragName = $fragmentDef->name->value; |
| 51 | - if (! empty($fragmentNameUsed[$fragName])) { |
|
| 51 | + if (!empty($fragmentNameUsed[$fragName])) { |
|
| 52 | 52 | continue; |
| 53 | 53 | } |
| 54 | 54 | |
@@ -45,9 +45,9 @@ discard block |
||
| 45 | 45 | public function getVisitor(ValidationContext $context) |
| 46 | 46 | { |
| 47 | 47 | return [ |
| 48 | - NodeKind::NULL => function (NullValueNode $node) use ($context) { |
|
| 48 | + NodeKind::NULL => function(NullValueNode $node) use ($context) { |
|
| 49 | 49 | $type = $context->getInputType(); |
| 50 | - if (! ($type instanceof NonNull)) { |
|
| 50 | + if (!($type instanceof NonNull)) { |
|
| 51 | 51 | return; |
| 52 | 52 | } |
| 53 | 53 | |
@@ -58,21 +58,21 @@ discard block |
||
| 58 | 58 | ) |
| 59 | 59 | ); |
| 60 | 60 | }, |
| 61 | - NodeKind::LST => function (ListValueNode $node) use ($context) { |
|
| 61 | + NodeKind::LST => function(ListValueNode $node) use ($context) { |
|
| 62 | 62 | // Note: TypeInfo will traverse into a list's item type, so look to the |
| 63 | 63 | // parent input type to check if it is a list. |
| 64 | 64 | $type = Type::getNullableType($context->getParentInputType()); |
| 65 | - if (! $type instanceof ListOfType) { |
|
| 65 | + if (!$type instanceof ListOfType) { |
|
| 66 | 66 | $this->isValidScalar($context, $node); |
| 67 | 67 | |
| 68 | 68 | return Visitor::skipNode(); |
| 69 | 69 | } |
| 70 | 70 | }, |
| 71 | - NodeKind::OBJECT => function (ObjectValueNode $node) use ($context) { |
|
| 71 | + NodeKind::OBJECT => function(ObjectValueNode $node) use ($context) { |
|
| 72 | 72 | // Note: TypeInfo will traverse into a list's item type, so look to the |
| 73 | 73 | // parent input type to check if it is a list. |
| 74 | 74 | $type = Type::getNamedType($context->getInputType()); |
| 75 | - if (! $type instanceof InputObjectType) { |
|
| 75 | + if (!$type instanceof InputObjectType) { |
|
| 76 | 76 | $this->isValidScalar($context, $node); |
| 77 | 77 | |
| 78 | 78 | return Visitor::skipNode(); |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | $nodeFields = iterator_to_array($node->fields); |
| 83 | 83 | $fieldNodeMap = array_combine( |
| 84 | 84 | array_map( |
| 85 | - function ($field) { |
|
| 85 | + function($field) { |
|
| 86 | 86 | return $field->name->value; |
| 87 | 87 | }, |
| 88 | 88 | $nodeFields |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | ); |
| 92 | 92 | foreach ($inputFields as $fieldName => $fieldDef) { |
| 93 | 93 | $fieldType = $fieldDef->getType(); |
| 94 | - if (isset($fieldNodeMap[$fieldName]) || ! ($fieldType instanceof NonNull)) { |
|
| 94 | + if (isset($fieldNodeMap[$fieldName]) || !($fieldType instanceof NonNull)) { |
|
| 95 | 95 | continue; |
| 96 | 96 | } |
| 97 | 97 | |
@@ -103,10 +103,10 @@ discard block |
||
| 103 | 103 | ); |
| 104 | 104 | } |
| 105 | 105 | }, |
| 106 | - NodeKind::OBJECT_FIELD => function (ObjectFieldNode $node) use ($context) { |
|
| 106 | + NodeKind::OBJECT_FIELD => function(ObjectFieldNode $node) use ($context) { |
|
| 107 | 107 | $parentType = Type::getNamedType($context->getParentInputType()); |
| 108 | 108 | $fieldType = $context->getInputType(); |
| 109 | - if ($fieldType || ! ($parentType instanceof InputObjectType)) { |
|
| 109 | + if ($fieldType || !($parentType instanceof InputObjectType)) { |
|
| 110 | 110 | return; |
| 111 | 111 | } |
| 112 | 112 | |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | $node->name->value, |
| 115 | 115 | array_keys($parentType->getFields()) |
| 116 | 116 | ); |
| 117 | - $didYouMean = $suggestions |
|
| 117 | + $didYouMean = $suggestions |
|
| 118 | 118 | ? 'Did you mean ' . Utils::orList($suggestions) . '?' |
| 119 | 119 | : null; |
| 120 | 120 | |
@@ -125,11 +125,11 @@ discard block |
||
| 125 | 125 | ) |
| 126 | 126 | ); |
| 127 | 127 | }, |
| 128 | - NodeKind::ENUM => function (EnumValueNode $node) use ($context) { |
|
| 128 | + NodeKind::ENUM => function(EnumValueNode $node) use ($context) { |
|
| 129 | 129 | $type = Type::getNamedType($context->getInputType()); |
| 130 | - if (! $type instanceof EnumType) { |
|
| 130 | + if (!$type instanceof EnumType) { |
|
| 131 | 131 | $this->isValidScalar($context, $node); |
| 132 | - } elseif (! $type->getValue($node->value)) { |
|
| 132 | + } elseif (!$type->getValue($node->value)) { |
|
| 133 | 133 | $context->reportError( |
| 134 | 134 | new Error( |
| 135 | 135 | self::badValueMessage( |
@@ -142,16 +142,16 @@ discard block |
||
| 142 | 142 | ); |
| 143 | 143 | } |
| 144 | 144 | }, |
| 145 | - NodeKind::INT => function (IntValueNode $node) use ($context) { |
|
| 145 | + NodeKind::INT => function(IntValueNode $node) use ($context) { |
|
| 146 | 146 | $this->isValidScalar($context, $node); |
| 147 | 147 | }, |
| 148 | - NodeKind::FLOAT => function (FloatValueNode $node) use ($context) { |
|
| 148 | + NodeKind::FLOAT => function(FloatValueNode $node) use ($context) { |
|
| 149 | 149 | $this->isValidScalar($context, $node); |
| 150 | 150 | }, |
| 151 | - NodeKind::STRING => function (StringValueNode $node) use ($context) { |
|
| 151 | + NodeKind::STRING => function(StringValueNode $node) use ($context) { |
|
| 152 | 152 | $this->isValidScalar($context, $node); |
| 153 | 153 | }, |
| 154 | - NodeKind::BOOLEAN => function (BooleanValueNode $node) use ($context) { |
|
| 154 | + NodeKind::BOOLEAN => function(BooleanValueNode $node) use ($context) { |
|
| 155 | 155 | $this->isValidScalar($context, $node); |
| 156 | 156 | }, |
| 157 | 157 | ]; |
@@ -168,13 +168,13 @@ discard block |
||
| 168 | 168 | // Report any error at the full type expected by the location. |
| 169 | 169 | $locationType = $context->getInputType(); |
| 170 | 170 | |
| 171 | - if (! $locationType) { |
|
| 171 | + if (!$locationType) { |
|
| 172 | 172 | return; |
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | $type = Type::getNamedType($locationType); |
| 176 | 176 | |
| 177 | - if (! $type instanceof ScalarType) { |
|
| 177 | + if (!$type instanceof ScalarType) { |
|
| 178 | 178 | $context->reportError( |
| 179 | 179 | new Error( |
| 180 | 180 | self::badValueMessage( |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | $suggestions = Utils::suggestionList( |
| 235 | 235 | Printer::doPrint($node), |
| 236 | 236 | array_map( |
| 237 | - function (EnumValueDefinition $value) { |
|
| 237 | + function(EnumValueDefinition $value) { |
|
| 238 | 238 | return $value->name; |
| 239 | 239 | }, |
| 240 | 240 | $type->getValues() |
@@ -19,10 +19,10 @@ discard block |
||
| 19 | 19 | { |
| 20 | 20 | return [ |
| 21 | 21 | NodeKind::FIELD => [ |
| 22 | - 'leave' => function (FieldNode $fieldNode) use ($context) { |
|
| 22 | + 'leave' => function(FieldNode $fieldNode) use ($context) { |
|
| 23 | 23 | $fieldDef = $context->getFieldDef(); |
| 24 | 24 | |
| 25 | - if (! $fieldDef) { |
|
| 25 | + if (!$fieldDef) { |
|
| 26 | 26 | return Visitor::skipNode(); |
| 27 | 27 | } |
| 28 | 28 | $argNodes = $fieldNode->arguments ?: []; |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | } |
| 34 | 34 | foreach ($fieldDef->args as $argDef) { |
| 35 | 35 | $argNode = $argNodeMap[$argDef->name] ?? null; |
| 36 | - if ($argNode || ! ($argDef->getType() instanceof NonNull)) { |
|
| 36 | + if ($argNode || !($argDef->getType() instanceof NonNull)) { |
|
| 37 | 37 | continue; |
| 38 | 38 | } |
| 39 | 39 | |
@@ -45,9 +45,9 @@ discard block |
||
| 45 | 45 | }, |
| 46 | 46 | ], |
| 47 | 47 | NodeKind::DIRECTIVE => [ |
| 48 | - 'leave' => function (DirectiveNode $directiveNode) use ($context) { |
|
| 48 | + 'leave' => function(DirectiveNode $directiveNode) use ($context) { |
|
| 49 | 49 | $directiveDef = $context->getDirective(); |
| 50 | - if (! $directiveDef) { |
|
| 50 | + if (!$directiveDef) { |
|
| 51 | 51 | return Visitor::skipNode(); |
| 52 | 52 | } |
| 53 | 53 | $argNodes = $directiveNode->arguments ?: []; |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | |
| 59 | 59 | foreach ($directiveDef->args as $argDef) { |
| 60 | 60 | $argNode = $argNodeMap[$argDef->name] ?? null; |
| 61 | - if ($argNode || ! ($argDef->getType() instanceof NonNull)) { |
|
| 61 | + if ($argNode || !($argDef->getType() instanceof NonNull)) { |
|
| 62 | 62 | continue; |
| 63 | 63 | } |
| 64 | 64 | |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | */ |
| 115 | 115 | public static function allRules() |
| 116 | 116 | { |
| 117 | - if (! self::$initRules) { |
|
| 117 | + if (!self::$initRules) { |
|
| 118 | 118 | static::$rules = array_merge(static::defaultRules(), self::securityRules(), self::$rules); |
| 119 | 119 | static::$initRules = true; |
| 120 | 120 | } |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | return is_array($value) |
| 236 | 236 | ? count(array_filter( |
| 237 | 237 | $value, |
| 238 | - function ($item) { |
|
| 238 | + function($item) { |
|
| 239 | 239 | return $item instanceof \Exception || $item instanceof \Throwable; |
| 240 | 240 | } |
| 241 | 241 | )) === count($value) |
@@ -133,8 +133,8 @@ discard block |
||
| 133 | 133 | { |
| 134 | 134 | $result = []; |
| 135 | 135 | |
| 136 | - if (! empty($this->errors)) { |
|
| 137 | - $errorsHandler = $this->errorsHandler ?: function (array $errors, callable $formatter) { |
|
| 136 | + if (!empty($this->errors)) { |
|
| 137 | + $errorsHandler = $this->errorsHandler ?: function(array $errors, callable $formatter) { |
|
| 138 | 138 | return array_map($formatter, $errors); |
| 139 | 139 | }; |
| 140 | 140 | |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | $result['data'] = $this->data; |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | - if (! empty($this->extensions)) { |
|
| 151 | + if (!empty($this->extensions)) { |
|
| 152 | 152 | $result['extensions'] = (array) $this->extensions; |
| 153 | 153 | } |
| 154 | 154 | |