@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | { |
144 | 144 | $this->load($document); |
145 | 145 | |
146 | - $build = function (Definition $definition): void { |
|
146 | + $build = function(Definition $definition): void { |
|
147 | 147 | $this->stack->push($definition); |
148 | 148 | |
149 | 149 | if ($definition instanceof Compilable) { |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | $this->typeCoercion->apply($definition); |
155 | 155 | } |
156 | 156 | |
157 | - if (! ($definition instanceof StandardType)) { |
|
157 | + if (!($definition instanceof StandardType)) { |
|
158 | 158 | $this->typeValidator->group(Definitions::class)->validate($definition); |
159 | 159 | } |
160 | 160 | |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | */ |
219 | 219 | private function onCompile(): \Closure |
220 | 220 | { |
221 | - return function (Readable $readable): Document { |
|
221 | + return function(Readable $readable): Document { |
|
222 | 222 | $ast = $this->parser->parse($readable); |
223 | 223 | |
224 | 224 | return $this->complete(new DocumentBuilder($ast, $readable, $this)); |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | /** |
18 | 18 | * @var string |
19 | 19 | */ |
20 | - public const GRAMMAR_PATHNAME = __DIR__ . '/../../../resources/grammar/sdl.pp'; |
|
20 | + public const GRAMMAR_PATHNAME = __DIR__.'/../../../resources/grammar/sdl.pp'; |
|
21 | 21 | |
22 | 22 | /** |
23 | 23 | * Make tokens public |
@@ -41,6 +41,6 @@ discard block |
||
41 | 41 | */ |
42 | 42 | public static function match(string $lexeme, string $value): bool |
43 | 43 | { |
44 | - return (bool)\preg_match(self::pattern($lexeme), $value); |
|
44 | + return (bool) \preg_match(self::pattern($lexeme), $value); |
|
45 | 45 | } |
46 | 46 | } |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | return; |
38 | 38 | } |
39 | 39 | |
40 | - if (! $type->hasDefaultValue()) { |
|
40 | + if (!$type->hasDefaultValue()) { |
|
41 | 41 | $this->inferenceValue($type); |
42 | 42 | return; |
43 | 43 | } |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | * field(arg: [Float] = null) → field(arg: [Float] = null) |
67 | 67 | * </code> |
68 | 68 | */ |
69 | - $isListDefinedByNonList = ($value !== null && ! \is_array($value)); |
|
69 | + $isListDefinedByNonList = ($value !== null && !\is_array($value)); |
|
70 | 70 | |
71 | 71 | /** |
72 | 72 | * The allowable conversion method for NULL: |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | * field(argument: Type = NULL): Type |
122 | 122 | * </code> |
123 | 123 | */ |
124 | - if (! $argument->isNonNull()) { |
|
124 | + if (!$argument->isNonNull()) { |
|
125 | 125 | $this->set($argument, null); |
126 | 126 | return; |
127 | 127 | } |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | */ |
134 | 134 | private function set(BaseArgument $argument, $value): void |
135 | 135 | { |
136 | - $invocation = function ($value): void { |
|
136 | + $invocation = function($value): void { |
|
137 | 137 | /** @var BaseArgument $this */ |
138 | 138 | $this->defaultValue = $value; |
139 | 139 | $this->hasDefaultValue = true; |
@@ -33,7 +33,7 @@ |
||
33 | 33 | */ |
34 | 34 | public function apply(TypeDefinition $directive): void |
35 | 35 | { |
36 | - $applier = function () use ($directive): void { |
|
36 | + $applier = function() use ($directive): void { |
|
37 | 37 | $this->deprecationReason = $directive->getPassedArgument(Deprecation::REASON_ARGUMENT); |
38 | 38 | }; |
39 | 39 |
@@ -51,7 +51,7 @@ |
||
51 | 51 | /** @var DirectiveDefinition $definition */ |
52 | 52 | $definition = $directive->getTypeDefinition(); |
53 | 53 | |
54 | - if (! $definition->isAllowedFor($directive->getParent())) { |
|
54 | + if (!$definition->isAllowedFor($directive->getParent())) { |
|
55 | 55 | $error = \vsprintf('Trying to define directive %s on %s, but only %s locations allowed.', [ |
56 | 56 | $directive, |
57 | 57 | $directive->getParent(), |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | |
72 | 72 | $this->getCallStack()->push($type); |
73 | 73 | |
74 | - if (! ($type instanceof Inputable)) { |
|
74 | + if (!($type instanceof Inputable)) { |
|
75 | 75 | $error = \sprintf('%s must be type of Scalar, Enum or Input', $type); |
76 | 76 | throw new TypeConflictException($error, $this->getCallStack()); |
77 | 77 | } |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | */ |
94 | 94 | private function validateSingleArgument(ArgumentDefinition $arg, Inputable $type, $value): void |
95 | 95 | { |
96 | - if (! $type->isCompatible($value)) { |
|
96 | + if (!$type->isCompatible($value)) { |
|
97 | 97 | $error = \vsprintf('The argument %s of %s contain non compatible value %s', [ |
98 | 98 | $arg->getName(), |
99 | 99 | $type, |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | */ |
113 | 113 | private function validateListArguments(ArgumentDefinition $arg, Inputable $type, $value): void |
114 | 114 | { |
115 | - if (! \is_iterable($value)) { |
|
115 | + if (!\is_iterable($value)) { |
|
116 | 116 | $error = \vsprintf('The argument %s of %s should contain list value, but %s given', [ |
117 | 117 | $arg->getName(), |
118 | 118 | $type, |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | */ |
136 | 136 | private function validateMissingArgument(HasPassedArguments $invocation, ArgumentDefinition $argument): void |
137 | 137 | { |
138 | - if (! $invocation->hasPassedArgument($argument->getName())) { |
|
138 | + if (!$invocation->hasPassedArgument($argument->getName())) { |
|
139 | 139 | $error = \sprintf('Required argument "%s" of %s not specified', $argument, $argument->getParent()); |
140 | 140 | |
141 | 141 | throw new TypeConflictException($error, $this->getCallStack()); |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | */ |
151 | 151 | private function validateArgumentExisting(HasArguments $container, string $argument): void |
152 | 152 | { |
153 | - if (! $container->hasArgument($argument)) { |
|
153 | + if (!$container->hasArgument($argument)) { |
|
154 | 154 | $error = \sprintf('In the %s there is no specified argument "%s"', $container, $argument); |
155 | 155 | |
156 | 156 | throw new TypeConflictException($error, $this->getCallStack()); |
@@ -41,7 +41,7 @@ |
||
41 | 41 | foreach ($locations as $location) { |
42 | 42 | $isValidLocation = $this->isSDLLocation($location) || $this->isQueryLocation($location); |
43 | 43 | |
44 | - if (! $isValidLocation) { |
|
44 | + if (!$isValidLocation) { |
|
45 | 45 | $error = \vsprintf('Trying to define directive %s, but %s location is invalid', [ |
46 | 46 | $definition, |
47 | 47 | $location, |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | { |
38 | 38 | $definition = $type->getTypeDefinition(); |
39 | 39 | |
40 | - if (! ($definition instanceof Inputable)) { |
|
40 | + if (!($definition instanceof Inputable)) { |
|
41 | 41 | $error = \sprintf('%s must be type of Scalar, Enum or Input', $type); |
42 | 42 | throw new TypeConflictException($error, $this->getCallStack()); |
43 | 43 | } |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | */ |
97 | 97 | private function validateArrayDefaultValue(ArgumentDefinition $type, array $defaults): void |
98 | 98 | { |
99 | - if (! $type->isList()) { |
|
99 | + if (!$type->isList()) { |
|
100 | 100 | $error = \sprintf('%s can not be initialized by List %s', |
101 | 101 | $type, $this->valueToString($defaults) |
102 | 102 | ); |
@@ -126,12 +126,12 @@ discard block |
||
126 | 126 | */ |
127 | 127 | private function validateDefaultListType(ArgumentDefinition $type, Inputable $definition, array $values): void |
128 | 128 | { |
129 | - $isNullable = ! $type->isListOfNonNulls(); |
|
129 | + $isNullable = !$type->isListOfNonNulls(); |
|
130 | 130 | |
131 | 131 | foreach ($values as $value) { |
132 | 132 | $isNull = $isNullable && $value === null; |
133 | 133 | |
134 | - if (! $isNull && ! $definition->isCompatible($value)) { |
|
134 | + if (!$isNull && !$definition->isCompatible($value)) { |
|
135 | 135 | $error = \sprintf('%s defined by %s can not be initialized by %s', |
136 | 136 | $type, |
137 | 137 | $this->typeIndicatorToString($type), |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | */ |
153 | 153 | private function validateDefaultType(ArgumentDefinition $type, Inputable $definition, $value): void |
154 | 154 | { |
155 | - if (! $definition->isCompatible($value)) { |
|
155 | + if (!$definition->isCompatible($value)) { |
|
156 | 156 | $error = \sprintf('%s contain non compatible default value %s', $type, $this->valueToString($value)); |
157 | 157 | throw new TypeConflictException($error, $this->getCallStack()); |
158 | 158 | } |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | |
83 | 83 | $exists = $object->hasField($field->getName()); |
84 | 84 | |
85 | - if (! $exists) { |
|
85 | + if (!$exists) { |
|
86 | 86 | $this->throwFieldNotDefined($interface, $object, $field); |
87 | 87 | } |
88 | 88 | |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | $this->getCallStack()->push($argument); |
138 | 138 | |
139 | 139 | $exists = $object->hasArgument($argument->getName()); |
140 | - if (! $exists) { |
|
140 | + if (!$exists) { |
|
141 | 141 | $this->throwArgumentNotDefined($interface, $object, $argument); |
142 | 142 | } |
143 | 143 |