@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | */ |
34 | 34 | public function __construct(array $config) |
35 | 35 | { |
36 | - if (! isset($config['name'])) { |
|
36 | + if (!isset($config['name'])) { |
|
37 | 37 | $config['name'] = $this->tryInferName(); |
38 | 38 | } |
39 | 39 | |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | |
54 | 54 | public function isPossibleType(Type $type) : bool |
55 | 55 | { |
56 | - if (! $type instanceof ObjectType) { |
|
56 | + if (!$type instanceof ObjectType) { |
|
57 | 57 | return false; |
58 | 58 | } |
59 | 59 | |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | public function getTypes() |
74 | 74 | { |
75 | 75 | if ($this->types === null) { |
76 | - if (! isset($this->config['types'])) { |
|
76 | + if (!isset($this->config['types'])) { |
|
77 | 77 | $types = null; |
78 | 78 | } elseif (is_callable($this->config['types'])) { |
79 | 79 | $types = call_user_func($this->config['types']); |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | $types = $this->config['types']; |
82 | 82 | } |
83 | 83 | |
84 | - if (! is_array($types)) { |
|
84 | + if (!is_array($types)) { |
|
85 | 85 | throw new InvariantViolation( |
86 | 86 | sprintf( |
87 | 87 | 'Must provide Array of types or a callable which returns such an array for Union %s', |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | { |
123 | 123 | parent::assertValid(); |
124 | 124 | |
125 | - if (! isset($this->config['resolveType'])) { |
|
125 | + if (!isset($this->config['resolveType'])) { |
|
126 | 126 | return; |
127 | 127 | } |
128 | 128 |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | { |
38 | 38 | $float = is_numeric($value) || is_bool($value) ? floatval($value) : null; |
39 | 39 | |
40 | - if ($float === null || ! is_finite($float)) { |
|
40 | + if ($float === null || !is_finite($float)) { |
|
41 | 41 | throw new Error( |
42 | 42 | 'Float cannot represent non numeric value: ' . |
43 | 43 | Utils::printSafe($value) |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | { |
57 | 57 | $float = is_float($value) || is_int($value) ? floatval($value) : null; |
58 | 58 | |
59 | - if ($float === null || ! is_finite($float)) { |
|
59 | + if ($float === null || !is_finite($float)) { |
|
60 | 60 | throw new Error( |
61 | 61 | 'Float cannot represent non numeric value: ' . |
62 | 62 | Utils::printSafe($value) |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | || (is_object($value) && method_exists($value, '__toString')) |
39 | 39 | || $value === null; |
40 | 40 | |
41 | - if (! $canCast) { |
|
41 | + if (!$canCast) { |
|
42 | 42 | throw new Error( |
43 | 43 | 'String cannot represent value: ' . Utils::printSafe($value) |
44 | 44 | ); |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | */ |
57 | 57 | public function parseValue($value) |
58 | 58 | { |
59 | - if (! is_string($value)) { |
|
59 | + if (!is_string($value)) { |
|
60 | 60 | throw new Error( |
61 | 61 | 'String cannot represent a non string value: ' . Utils::printSafe($value) |
62 | 62 | ); |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | */ |
80 | 80 | public function __construct(array $config) |
81 | 81 | { |
82 | - if (! isset($config['name'])) { |
|
82 | + if (!isset($config['name'])) { |
|
83 | 83 | $config['name'] = $this->tryInferName(); |
84 | 84 | } |
85 | 85 | |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | ? call_user_func($interfaces) |
190 | 190 | : $interfaces; |
191 | 191 | |
192 | - if ($interfaces !== null && ! is_array($interfaces)) { |
|
192 | + if ($interfaces !== null && !is_array($interfaces)) { |
|
193 | 193 | throw new InvariantViolation( |
194 | 194 | sprintf('%s interfaces must be an Array or a callable which returns an Array.', $this->name) |
195 | 195 | ); |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | |
43 | 43 | public function __construct($config) |
44 | 44 | { |
45 | - if (! isset($config['name'])) { |
|
45 | + if (!isset($config['name'])) { |
|
46 | 46 | $config['name'] = $this->tryInferName(); |
47 | 47 | } |
48 | 48 | |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | { |
65 | 65 | $lookup = $this->getNameLookup(); |
66 | 66 | |
67 | - if (! is_string($name)) { |
|
67 | + if (!is_string($name)) { |
|
68 | 68 | return null; |
69 | 69 | } |
70 | 70 | |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | |
74 | 74 | private function getNameLookup() : ArrayObject |
75 | 75 | { |
76 | - if (! $this->nameLookup) { |
|
76 | + if (!$this->nameLookup) { |
|
77 | 77 | /** @var ArrayObject<string, EnumValueDefinition> $lookup */ |
78 | 78 | $lookup = new ArrayObject(); |
79 | 79 | foreach ($this->getValues() as $value) { |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | $config = $this->config; |
96 | 96 | |
97 | 97 | if (isset($config['values'])) { |
98 | - if (! is_array($config['values'])) { |
|
98 | + if (!is_array($config['values'])) { |
|
99 | 99 | throw new InvariantViolation(sprintf('%s values must be an array', $this->name)); |
100 | 100 | } |
101 | 101 | foreach ($config['values'] as $name => $value) { |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | $values = $this->getValues(); |
212 | 212 | foreach ($values as $value) { |
213 | 213 | Utils::invariant( |
214 | - ! isset($value->config['isDeprecated']), |
|
214 | + !isset($value->config['isDeprecated']), |
|
215 | 215 | sprintf( |
216 | 216 | '%s.%s should provide "deprecationReason" instead of "isDeprecated".', |
217 | 217 | $this->name, |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | |
80 | 80 | public function hasType(string $type) : bool |
81 | 81 | { |
82 | - return count(array_filter($this->getReferencedTypes(), static function (string $referencedType) use ($type) { |
|
82 | + return count(array_filter($this->getReferencedTypes(), static function(string $referencedType) use ($type) { |
|
83 | 83 | return $type === $referencedType; |
84 | 84 | })) > 0; |
85 | 85 | } |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | |
95 | 95 | public function hasField(string $field) : bool |
96 | 96 | { |
97 | - return count(array_filter($this->getReferencedFields(), static function (string $referencedField) use ($field) { |
|
97 | + return count(array_filter($this->getReferencedFields(), static function(string $referencedField) use ($field) { |
|
98 | 98 | return $field === $referencedField; |
99 | 99 | })) > 0; |
100 | 100 | } |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | */ |
105 | 105 | public function subFields(string $typename) : array |
106 | 106 | { |
107 | - if (! array_key_exists($typename, $this->types)) { |
|
107 | + if (!array_key_exists($typename, $this->types)) { |
|
108 | 108 | return []; |
109 | 109 | } |
110 | 110 | |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | $implementors = []; |
121 | 121 | /** @var FieldNode $fieldNode */ |
122 | 122 | foreach ($fieldNodes as $fieldNode) { |
123 | - if (! $fieldNode->selectionSet) { |
|
123 | + if (!$fieldNode->selectionSet) { |
|
124 | 124 | continue; |
125 | 125 | } |
126 | 126 | |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | */ |
229 | 229 | private function mergeFields(Type $parentType, Type $type, array $fields, array $subfields, array &$implementors) : array |
230 | 230 | { |
231 | - if ($this->groupImplementorFields && $parentType instanceof AbstractType && ! $type instanceof AbstractType) { |
|
231 | + if ($this->groupImplementorFields && $parentType instanceof AbstractType && !$type instanceof AbstractType) { |
|
232 | 232 | $implementors[$type->name] = [ |
233 | 233 | 'type' => $type, |
234 | 234 | 'fields' => $this->arrayMergeDeep( |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | |
269 | 269 | foreach ($array2 as $key => & $value) { |
270 | 270 | if (is_numeric($key)) { |
271 | - if (! in_array($value, $merged, true)) { |
|
271 | + if (!in_array($value, $merged, true)) { |
|
272 | 272 | $merged[] = $value; |
273 | 273 | } |
274 | 274 | } elseif (is_array($value) && isset($merged[$key]) && is_array($merged[$key])) { |
@@ -41,7 +41,7 @@ |
||
41 | 41 | || is_int($value) |
42 | 42 | || (is_object($value) && method_exists($value, '__toString')); |
43 | 43 | |
44 | - if (! $canCast) { |
|
44 | + if (!$canCast) { |
|
45 | 45 | throw new Error('ID cannot represent value: ' . Utils::printSafe($value)); |
46 | 46 | } |
47 | 47 |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | */ |
32 | 32 | public function __construct(array $config) |
33 | 33 | { |
34 | - if (! isset($config['name'])) { |
|
34 | + if (!isset($config['name'])) { |
|
35 | 35 | $config['name'] = $this->tryInferName(); |
36 | 36 | } |
37 | 37 | |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | ? call_user_func($fields) |
74 | 74 | : $fields; |
75 | 75 | |
76 | - if (! is_array($fields)) { |
|
76 | + if (!is_array($fields)) { |
|
77 | 77 | throw new InvariantViolation( |
78 | 78 | sprintf('%s fields must be an array or a callable which returns such an array.', $this->name) |
79 | 79 | ); |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | parent::assertValid(); |
103 | 103 | |
104 | 104 | Utils::invariant( |
105 | - ! empty($this->getFields()), |
|
105 | + !empty($this->getFields()), |
|
106 | 106 | sprintf( |
107 | 107 | '%s fields must be an associative array with field names as keys or a callable which returns such an array.', |
108 | 108 | $this->name |
@@ -55,7 +55,7 @@ |
||
55 | 55 | */ |
56 | 56 | public function parseLiteral(Node $valueNode, ?array $variables = null) |
57 | 57 | { |
58 | - if (! $valueNode instanceof BooleanValueNode) { |
|
58 | + if (!$valueNode instanceof BooleanValueNode) { |
|
59 | 59 | // Intentionally without message, as all information already in wrapped Exception |
60 | 60 | throw new Exception(); |
61 | 61 | } |