@@ -186,7 +186,7 @@ |
||
186 | 186 | /** |
187 | 187 | * Set the value at the given offset. |
188 | 188 | * |
189 | - * @param string|int $offset |
|
189 | + * @param string $offset |
|
190 | 190 | * @param mixed $value |
191 | 191 | * @return void |
192 | 192 | */ |
@@ -79,9 +79,9 @@ discard block |
||
79 | 79 | { |
80 | 80 | $skipNullable = $this->skip === static::SKIP_NULL && $value === null; |
81 | 81 | |
82 | - $skipEmpty = $this->skip === static::SKIP_EMPTY && ! $value; |
|
82 | + $skipEmpty = $this->skip === static::SKIP_EMPTY && !$value; |
|
83 | 83 | |
84 | - if (! $skipEmpty && ! $skipNullable) { |
|
84 | + if (!$skipEmpty && !$skipNullable) { |
|
85 | 85 | $this->attributes[$key ?? \count($this->attributes)] = |
86 | 86 | \is_iterable($value) ? new self($value) : $value; |
87 | 87 | } |
@@ -139,9 +139,9 @@ discard block |
||
139 | 139 | */ |
140 | 140 | public function jsonSerialize() |
141 | 141 | { |
142 | - $applicator = function ($value) { |
|
142 | + $applicator = function($value) { |
|
143 | 143 | if (\is_object($value) && \method_exists($value, '__toString')) { |
144 | - return (string)$value; |
|
144 | + return (string) $value; |
|
145 | 145 | } |
146 | 146 | |
147 | 147 | return $value; |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | */ |
159 | 159 | public function toJson(int $options = 0): string |
160 | 160 | { |
161 | - return (string)\json_encode($this->jsonSerialize(), $options); |
|
161 | + return (string) \json_encode($this->jsonSerialize(), $options); |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | /** |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | /** |
38 | 38 | * @var string |
39 | 39 | */ |
40 | - public const INTERFACE = 'Interface'; |
|
40 | + public const interface = 'Interface'; |
|
41 | 41 | |
42 | 42 | /** |
43 | 43 | * @var string |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | self::SCHEMA, |
156 | 156 | self::SCALAR, |
157 | 157 | self::OBJECT, |
158 | - self::INTERFACE, |
|
158 | + self::interface, |
|
159 | 159 | self::UNION, |
160 | 160 | self::ENUM, |
161 | 161 | self::INPUT_OBJECT, |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | public const ALLOWS_TO_OUTPUT = [ |
204 | 204 | self::SCALAR, |
205 | 205 | self::OBJECT, |
206 | - self::INTERFACE, |
|
206 | + self::interface, |
|
207 | 207 | self::UNION, |
208 | 208 | self::ENUM, |
209 | 209 | self::INPUT_OBJECT, |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | * @var string[]|array[] |
221 | 221 | */ |
222 | 222 | public const INHERITANCE_TREE = [ |
223 | - self::INTERFACE => [ |
|
223 | + self::interface => [ |
|
224 | 224 | self::OBJECT => [ |
225 | 225 | self::INPUT_OBJECT, |
226 | 226 | ], |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | * @param TypeInterface $type |
278 | 278 | * @return bool |
279 | 279 | */ |
280 | - public function instanceOf(TypeInterface $type): bool; |
|
280 | + public function instanceof(TypeInterface $type): bool; |
|
281 | 281 | |
282 | 282 | /** |
283 | 283 | * Returns true if the type is the same as the current type. |
@@ -78,7 +78,7 @@ |
||
78 | 78 | */ |
79 | 79 | private function bootInheritance(\SplStack $stack, array $children = []): void |
80 | 80 | { |
81 | - $push = function (string $type) use ($stack): void { |
|
81 | + $push = function(string $type) use ($stack): void { |
|
82 | 82 | self::$inheritance[$type] = \array_values(\iterator_to_array($stack)); |
83 | 83 | self::$inheritance[$type][] = static::ROOT_TYPE; |
84 | 84 |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | /** |
22 | 22 | * @var string |
23 | 23 | */ |
24 | - private const SCHEMA_SDL_GRAMMAR = __DIR__ . '/../../resources/sdl/grammar.pp2'; |
|
24 | + private const SCHEMA_SDL_GRAMMAR = __DIR__.'/../../resources/sdl/grammar.pp2'; |
|
25 | 25 | |
26 | 26 | /** |
27 | 27 | * @var string |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | Compiler::load(File::fromPathname(self::SCHEMA_SDL_GRAMMAR)) |
44 | 44 | ->setClassName('Parser') |
45 | 45 | ->setNamespace('Railt\\SDL\\Frontend') |
46 | - ->saveTo(__DIR__ . '/../Frontend'); |
|
46 | + ->saveTo(__DIR__.'/../Frontend'); |
|
47 | 47 | |
48 | 48 | $this->info('OK'); |
49 | 49 | } |
@@ -67,7 +67,7 @@ |
||
67 | 67 | |
68 | 68 | default: |
69 | 69 | throw new InternalException( |
70 | - 'Unrecognized struct ' . $value->toJson(\JSON_PRETTY_PRINT) |
|
70 | + 'Unrecognized struct '.$value->toJson(\JSON_PRETTY_PRINT) |
|
71 | 71 | ); |
72 | 72 | } |
73 | 73 | } |
@@ -31,7 +31,7 @@ |
||
31 | 31 | $interface = new TypeDefinition($ast->getFullName()); |
32 | 32 | $interface->in($file, $ast->getOffset()); |
33 | 33 | |
34 | - $interface->type = Type::of(Type::INTERFACE); |
|
34 | + $interface->type = Type::of(Type::interface); |
|
35 | 35 | $interface->description = $ast->getDescription(); |
36 | 36 | |
37 | 37 | $this->loadInterfaces($ast, $interface); |