@@ -37,11 +37,11 @@ |
||
37 | 37 | $ast = (new Parser())->parse(File::fromPathname($this->argument('schema'))); |
38 | 38 | |
39 | 39 | if ($root = $this->option('find')) { |
40 | - foreach ($ast->find((string)$root) as $child) { |
|
41 | - $this->writeln((string)$child); |
|
40 | + foreach ($ast->find((string) $root) as $child) { |
|
41 | + $this->writeln((string) $child); |
|
42 | 42 | } |
43 | 43 | } else { |
44 | - $this->writeln((string)$ast); |
|
44 | + $this->writeln((string) $ast); |
|
45 | 45 | } |
46 | 46 | } |
47 | 47 | } |
@@ -82,7 +82,7 @@ |
||
82 | 82 | */ |
83 | 83 | public function autoload(\Closure $then): void |
84 | 84 | { |
85 | - $this->dictionary->onTypeNotFound(function (string $type, ?Definition $from) use ($then): void { |
|
85 | + $this->dictionary->onTypeNotFound(function(string $type, ?Definition $from) use ($then) : void { |
|
86 | 86 | if (($file = $then($type, $from)) instanceof Readable) { |
87 | 87 | $this->compile($file); |
88 | 88 | } |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | */ |
75 | 75 | public function push(int $priority, callable $then): void |
76 | 76 | { |
77 | - if (! \array_key_exists($priority, $this->queue)) { |
|
77 | + if (!\array_key_exists($priority, $this->queue)) { |
|
78 | 78 | $this->queue[$priority] = $this->createList(); |
79 | 79 | } |
80 | 80 | |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | */ |
95 | 95 | public function count(): int |
96 | 96 | { |
97 | - return (int)\array_reduce($this->queue, function (int $result, \SplQueue $queue): int { |
|
97 | + return (int) \array_reduce($this->queue, function(int $result, \SplQueue $queue): int { |
|
98 | 98 | return $result + $queue->count(); |
99 | 99 | }, 0); |
100 | 100 | } |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | /** |
22 | 22 | * @var string |
23 | 23 | */ |
24 | - private const SCHEMA_SDL_GRAMMAR = __DIR__ . '/../../resources/grammar.pp2'; |
|
24 | + private const SCHEMA_SDL_GRAMMAR = __DIR__.'/../../resources/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\\Compiler') |
46 | - ->saveTo(__DIR__ . '/../Compiler'); |
|
46 | + ->saveTo(__DIR__.'/../Compiler'); |
|
47 | 47 | |
48 | 48 | $this->info('OK'); |
49 | 49 | } |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | */ |
94 | 94 | private function renderUtfSequences(string $body): string |
95 | 95 | { |
96 | - $callee = function (array $matches): string { |
|
96 | + $callee = function(array $matches): string { |
|
97 | 97 | [$char, $code] = [$matches[0], $matches[1]]; |
98 | 98 | |
99 | 99 | try { |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | { |
124 | 124 | try { |
125 | 125 | if (\function_exists('\\json_decode')) { |
126 | - $result = @\json_decode('{"char": "' . $body . '"}')->char; |
|
126 | + $result = @\json_decode('{"char": "'.$body.'"}')->char; |
|
127 | 127 | |
128 | 128 | if (\json_last_error() === \JSON_ERROR_NONE) { |
129 | 129 | $body = $result; |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | */ |
144 | 144 | private function renderSpecialCharacters(string $body): string |
145 | 145 | { |
146 | - $callee = function (array $matches): string { |
|
146 | + $callee = function(array $matches): string { |
|
147 | 147 | [$char, $code] = [$matches[0], $matches[1]]; |
148 | 148 | |
149 | 149 | switch ($code) { |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | */ |
8 | 8 | declare(strict_types=1); |
9 | 9 | |
10 | -if (! \function_exists('\\sdl')) { |
|
10 | +if (!\function_exists('\\sdl')) { |
|
11 | 11 | /** |
12 | 12 | * @param string $fileOrSources |
13 | 13 | * @param bool $filename |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | } |
26 | 26 | |
27 | 27 | |
28 | -if (! \function_exists('trait_uses_recursive')) { |
|
28 | +if (!\function_exists('trait_uses_recursive')) { |
|
29 | 29 | /** |
30 | 30 | * Returns all traits used by a trait and its traits. |
31 | 31 | * |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | } |
46 | 46 | |
47 | 47 | |
48 | -if (! \function_exists('class_uses_recursive')) { |
|
48 | +if (!\function_exists('class_uses_recursive')) { |
|
49 | 49 | /** |
50 | 50 | * Returns all traits used by a class, its parent classes and trait of their traits. |
51 | 51 | * |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | } |
70 | 70 | |
71 | 71 | |
72 | -if (! \function_exists('class_basename')) { |
|
72 | +if (!\function_exists('class_basename')) { |
|
73 | 73 | /** |
74 | 74 | * Get the class "basename" of the given object / class. |
75 | 75 | * |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | /** |
103 | 103 | * @validation <name: [Type] = Value> |
104 | 104 | */ |
105 | - if (! ($value instanceof ListValueNode)) { |
|
105 | + if (!($value instanceof ListValueNode)) { |
|
106 | 106 | $error = 'Value of %s should be a List, but %s given'; |
107 | 107 | throw (new TypeConflictException(\sprintf($error, $type, $value->toString())))->throwsIn($type->getFile(), |
108 | 108 | $value->getOffset()); |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | /** |
163 | 163 | * @validation <name: InputType = Value> |
164 | 164 | */ |
165 | - if (! ($value instanceof InputValueNode)) { |
|
165 | + if (!($value instanceof InputValueNode)) { |
|
166 | 166 | $error = 'Value of %s should be a %s, but %s given'; |
167 | 167 | throw (new TypeConflictException(\sprintf($error, $type, $type->getDefinition(), |
168 | 168 | $value->toString())))->throwsIn($type->getFile(), $value->getOffset()); |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | /** |
185 | 185 | * @validation <name: InputType = {nonExistentField: Value}> |
186 | 186 | */ |
187 | - if (! $definition->hasField($name)) { |
|
187 | + if (!$definition->hasField($name)) { |
|
188 | 188 | $error = 'Input field "%s" does not provided by %s, but %s given'; |
189 | 189 | throw (new TypeConflictException(\sprintf($error, $name, $type->getDefinition(), |
190 | 190 | $value->toString())))->throwsIn($type->getFile(), $value->getOffset()); |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | /** |
208 | 208 | * @validation <name: Enum = "NotEnumValue"> |
209 | 209 | */ |
210 | - if (! ($value instanceof ConstantValueNode)) { |
|
210 | + if (!($value instanceof ConstantValueNode)) { |
|
211 | 211 | $error = 'Value of %s can be one of %s value, but %s given'; |
212 | 212 | throw (new TypeConflictException(\sprintf($error, $type, $type->getDefinition(), |
213 | 213 | $value->toString())))->throwsIn($type->getFile(), $value->getOffset()); |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | /** |
222 | 222 | * @validation <name: Enum = NonExistentValue> |
223 | 223 | */ |
224 | - if (! $definition->hasValue($name)) { |
|
224 | + if (!$definition->hasValue($name)) { |
|
225 | 225 | $error = 'Enum %s does not provide value %s'; |
226 | 226 | throw (new TypeConflictException(\sprintf($error, $type->getDefinition(), $value->toString()))) |
227 | 227 | ->throwsIn($type->getFile(), $value->getOffset()); |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | */ |
123 | 123 | private function getFilter(): \Closure |
124 | 124 | { |
125 | - return function (TypeDefinition $resolved): bool { |
|
125 | + return function(TypeDefinition $resolved): bool { |
|
126 | 126 | return $this->shouldBreak($resolved); |
127 | 127 | }; |
128 | 128 | } |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | */ |
134 | 134 | private function shouldBreak(TypeDefinition $resolved): bool |
135 | 135 | { |
136 | - return ! isset($this->breakpoints[$resolved->getName()]); |
|
136 | + return !isset($this->breakpoints[$resolved->getName()]); |
|
137 | 137 | } |
138 | 138 | |
139 | 139 | /** |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | yield $type; |
147 | 147 | |
148 | 148 | foreach ($type->getChildrenInheritance() as $child) { |
149 | - if (! $filter($child)) { |
|
149 | + if (!$filter($child)) { |
|
150 | 150 | continue; |
151 | 151 | } |
152 | 152 |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | */ |
24 | 24 | public function toString(): string |
25 | 25 | { |
26 | - return (string)$this->toPrimitive(); |
|
26 | + return (string) $this->toPrimitive(); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | /** |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | return $this->parseInt($value->getValue()); |
60 | 60 | } |
61 | 61 | |
62 | - return (float)$value->getValue(); |
|
62 | + return (float) $value->getValue(); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | /** |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | */ |
114 | 114 | private function parseExponential(string $value): float |
115 | 115 | { |
116 | - return (float)$value; |
|
116 | + return (float) $value; |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | /** |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | */ |
132 | 132 | private function parseFloat(string $value): float |
133 | 133 | { |
134 | - return (float)$value; |
|
134 | + return (float) $value; |
|
135 | 135 | } |
136 | 136 | |
137 | 137 | /** |