@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | */ |
96 | 96 | private function renderSpecialCharacters(string $body): string |
97 | 97 | { |
98 | - $callee = function (array $matches): string { |
|
98 | + $callee = function(array $matches): string { |
|
99 | 99 | [$char, $code] = [$matches[0], $matches[1]]; |
100 | 100 | |
101 | 101 | switch ($code) { |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | */ |
128 | 128 | private function renderUtfSequences(string $body): string |
129 | 129 | { |
130 | - $callee = function (array $matches): string { |
|
130 | + $callee = function(array $matches): string { |
|
131 | 131 | [$char, $code] = [$matches[0], $matches[1]]; |
132 | 132 | |
133 | 133 | try { |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | { |
158 | 158 | try { |
159 | 159 | if (\function_exists('\\json_decode')) { |
160 | - $result = @\json_decode('{"char": "' . $body . '"}')->char; |
|
160 | + $result = @\json_decode('{"char": "'.$body.'"}')->char; |
|
161 | 161 | |
162 | 162 | if (\json_last_error() === \JSON_ERROR_NONE) { |
163 | 163 | $body = $result; |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | */ |
33 | 33 | protected static function getAstName(): string |
34 | 34 | { |
35 | - throw new \LogicException(__METHOD__ . ' is non-allowed'); |
|
35 | + throw new \LogicException(__METHOD__.' is non-allowed'); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | /** |
@@ -41,6 +41,6 @@ discard block |
||
41 | 41 | */ |
42 | 42 | protected function parse(NodeInterface $rule): string |
43 | 43 | { |
44 | - return (string)$rule->getValue(); |
|
44 | + return (string) $rule->getValue(); |
|
45 | 45 | } |
46 | 46 | } |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | return $this->parseInt($value->getValue()); |
53 | 53 | } |
54 | 54 | |
55 | - return (float)$value->getValue(); |
|
55 | + return (float) $value->getValue(); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | /** |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | */ |
80 | 80 | private function parseExponential(string $value): float |
81 | 81 | { |
82 | - return (float)$value; |
|
82 | + return (float) $value; |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | /** |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | */ |
89 | 89 | private function parseFloat(string $value): float |
90 | 90 | { |
91 | - return (float)$value; |
|
91 | + return (float) $value; |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | /** |
@@ -60,7 +60,7 @@ |
||
60 | 60 | |
61 | 61 | $this->definition = $this->bootDefinition($this->document); |
62 | 62 | |
63 | - $this->stack->transaction($this->definition, function (AbstractDefinition $record): void { |
|
63 | + $this->stack->transaction($this->definition, function(AbstractDefinition $record): void { |
|
64 | 64 | $record->withOffset($this->getOffset()); |
65 | 65 | |
66 | 66 | if ($record instanceof TypeDefinition) { |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | */ |
85 | 85 | public function autoload(\Closure $then): void |
86 | 86 | { |
87 | - $this->dictionary->onTypeNotFound(function (string $type, ?Definition $from) use ($then): void { |
|
87 | + $this->dictionary->onTypeNotFound(function(string $type, ?Definition $from) use ($then) : void { |
|
88 | 88 | if (($file = $then($type, $from)) instanceof Readable) { |
89 | 89 | $this->compile($file); |
90 | 90 | } |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | { |
117 | 117 | $key = $document->getFile()->getHash(); |
118 | 118 | |
119 | - if (! isset($this->documents[$key])) { |
|
119 | + if (!isset($this->documents[$key])) { |
|
120 | 120 | $otherwise && $otherwise($document); |
121 | 121 | } |
122 | 122 | |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | */ |
130 | 130 | public function compile(Readable $file): DocumentInterface |
131 | 131 | { |
132 | - return $this->memomize(new Document($this->reflection, $file), function (Document $document) use ($file): void { |
|
132 | + return $this->memomize(new Document($this->reflection, $file), function(Document $document) use ($file): void { |
|
133 | 133 | $ast = $this->parse($document, $file); |
134 | 134 | |
135 | 135 | foreach ($ast as $type) { |
@@ -11,7 +11,7 @@ |
||
11 | 11 | use Railt\Reflection\Contracts\Document; |
12 | 12 | use Railt\SDL\Compiler; |
13 | 13 | |
14 | -if (! \function_exists('\\sdl')) { |
|
14 | +if (!\function_exists('\\sdl')) { |
|
15 | 15 | /** |
16 | 16 | * @param string $fileOrSources |
17 | 17 | * @param bool $filename |
@@ -67,8 +67,8 @@ discard block |
||
67 | 67 | */ |
68 | 68 | public function __toString(): string |
69 | 69 | { |
70 | - $result = $this->getHeader() . \PHP_EOL; |
|
71 | - $result .= 'Stack trace:' . \PHP_EOL; |
|
70 | + $result = $this->getHeader().\PHP_EOL; |
|
71 | + $result .= 'Stack trace:'.\PHP_EOL; |
|
72 | 72 | $result .= $this->getFullTraceAsString(); |
73 | 73 | |
74 | 74 | return $result; |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | |
84 | 84 | if ($this->stack) { |
85 | 85 | foreach ($this->stack as $def) { |
86 | - $result .= \sprintf('#%d %s(%d): %s', $i++, $def->getFile(), $def->getLine(), $def) . \PHP_EOL; |
|
86 | + $result .= \sprintf('#%d %s(%d): %s', $i++, $def->getFile(), $def->getLine(), $def).\PHP_EOL; |
|
87 | 87 | } |
88 | 88 | } |
89 | 89 | |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | continue; |
93 | 93 | } |
94 | 94 | |
95 | - $result .= \preg_replace('/#\d+\h/iu', \sprintf('#%d ', $i++), $line) . "\n"; |
|
95 | + $result .= \preg_replace('/#\d+\h/iu', \sprintf('#%d ', $i++), $line)."\n"; |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | return $result; |
@@ -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 | } |
@@ -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') |
46 | - ->saveTo(__DIR__ . '/../'); |
|
46 | + ->saveTo(__DIR__.'/../'); |
|
47 | 47 | |
48 | 48 | $this->info('OK'); |
49 | 49 | } |