@@ -23,7 +23,7 @@ |
||
23 | 23 | */ |
24 | 24 | public function write($source, SpecificationInterface $specification, Compiler $compiler) |
25 | 25 | { |
26 | - if (is_array($source)) { |
|
26 | + if (is_array($source)){ |
|
27 | 27 | $source[] = self::OUTPUT; |
28 | 28 | } |
29 | 29 |
@@ -23,7 +23,8 @@ |
||
23 | 23 | */ |
24 | 24 | public function write($source, SpecificationInterface $specification, Compiler $compiler) |
25 | 25 | { |
26 | - if (is_array($source)) { |
|
26 | + if (is_array($source)) |
|
27 | + { |
|
27 | 28 | $source[] = self::OUTPUT; |
28 | 29 | } |
29 | 30 |
@@ -52,19 +52,19 @@ |
||
52 | 52 | */ |
53 | 53 | public function leaveNode($node, VisitorContext $ctx) |
54 | 54 | { |
55 | - if (!$node instanceof Block || $node->name === null || !$this->blocks->has($node->name)) { |
|
55 | + if (!$node instanceof Block || $node->name === null || !$this->blocks->has($node->name)){ |
|
56 | 56 | return null; |
57 | 57 | } |
58 | 58 | |
59 | 59 | $inject = $this->blocks->claim($node->name); |
60 | 60 | |
61 | - if ($inject instanceof QuotedValue) { |
|
61 | + if ($inject instanceof QuotedValue){ |
|
62 | 62 | // exclude quotes |
63 | 63 | $inject = $inject->trimvalue(); |
64 | 64 | } |
65 | 65 | |
66 | 66 | // mount block:parent content |
67 | - if ($node->name !== 'parent') { |
|
67 | + if ($node->name !== 'parent'){ |
|
68 | 68 | $traverser = new Traverser(); |
69 | 69 | $traverser->addVisitor(new InjectBlocks(new BlockClaims([ |
70 | 70 | 'parent' => $node->nodes, |
@@ -52,19 +52,22 @@ |
||
52 | 52 | */ |
53 | 53 | public function leaveNode($node, VisitorContext $ctx) |
54 | 54 | { |
55 | - if (!$node instanceof Block || $node->name === null || !$this->blocks->has($node->name)) { |
|
55 | + if (!$node instanceof Block || $node->name === null || !$this->blocks->has($node->name)) |
|
56 | + { |
|
56 | 57 | return null; |
57 | 58 | } |
58 | 59 | |
59 | 60 | $inject = $this->blocks->claim($node->name); |
60 | 61 | |
61 | - if ($inject instanceof QuotedValue) { |
|
62 | + if ($inject instanceof QuotedValue) |
|
63 | + { |
|
62 | 64 | // exclude quotes |
63 | 65 | $inject = $inject->trimvalue(); |
64 | 66 | } |
65 | 67 | |
66 | 68 | // mount block:parent content |
67 | - if ($node->name !== 'parent') { |
|
69 | + if ($node->name !== 'parent') |
|
70 | + { |
|
68 | 71 | $traverser = new Traverser(); |
69 | 72 | $traverser->addVisitor(new InjectBlocks(new BlockClaims([ |
70 | 73 | 'parent' => $node->nodes, |
@@ -58,11 +58,11 @@ |
||
58 | 58 | 'content' => $this->content, |
59 | 59 | ]; |
60 | 60 | |
61 | - if ($this->grammar !== null) { |
|
61 | + if ($this->grammar !== null){ |
|
62 | 62 | $token['type'] = call_user_func([$this->grammar, 'tokenName'], $this->type); |
63 | 63 | } |
64 | 64 | |
65 | - if ($this->tokens !== []) { |
|
65 | + if ($this->tokens !== []){ |
|
66 | 66 | $token['tokens'] = $this->tokens; |
67 | 67 | } |
68 | 68 |
@@ -58,11 +58,13 @@ |
||
58 | 58 | 'content' => $this->content, |
59 | 59 | ]; |
60 | 60 | |
61 | - if ($this->grammar !== null) { |
|
61 | + if ($this->grammar !== null) |
|
62 | + { |
|
62 | 63 | $token['type'] = call_user_func([$this->grammar, 'tokenName'], $this->type); |
63 | 64 | } |
64 | 65 | |
65 | - if ($this->tokens !== []) { |
|
66 | + if ($this->tokens !== []) |
|
67 | + { |
|
66 | 68 | $token['tokens'] = $this->tokens; |
67 | 69 | } |
68 | 70 |
@@ -119,11 +119,11 @@ discard block |
||
119 | 119 | */ |
120 | 120 | public function starts(Buffer $src, Byte $n): bool |
121 | 121 | { |
122 | - if (!$this->active) { |
|
122 | + if (!$this->active){ |
|
123 | 123 | return false; |
124 | 124 | } |
125 | 125 | |
126 | - return $this->startSequence === ($n->char . $src->lookaheadByte(strlen($this->startSequence) - 1)); |
|
126 | + return $this->startSequence === ($n->char.$src->lookaheadByte(strlen($this->startSequence) - 1)); |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | /** |
@@ -139,30 +139,30 @@ discard block |
||
139 | 139 | new Token( |
140 | 140 | $this->startToken, |
141 | 141 | $n->offset, |
142 | - $n->char . $this->nextBytes($src, strlen($this->startSequence) - 1) |
|
142 | + $n->char.$this->nextBytes($src, strlen($this->startSequence) - 1) |
|
143 | 143 | ), |
144 | 144 | ]; |
145 | 145 | |
146 | - while ($n = $src->next()) { |
|
147 | - if (!$n instanceof Byte) { |
|
146 | + while ($n = $src->next()){ |
|
147 | + if (!$n instanceof Byte){ |
|
148 | 148 | // no other grammars are allowed |
149 | 149 | break; |
150 | 150 | } |
151 | 151 | |
152 | - switch ($n->char) { |
|
152 | + switch ($n->char){ |
|
153 | 153 | case '"': |
154 | 154 | case "'": |
155 | 155 | $this->body[] = $n; |
156 | - while ($nn = $src->next()) { |
|
156 | + while ($nn = $src->next()){ |
|
157 | 157 | $this->body[] = $nn; |
158 | - if ($nn instanceof Byte && $nn->char === $n->char) { |
|
158 | + if ($nn instanceof Byte && $nn->char === $n->char){ |
|
159 | 159 | break; |
160 | 160 | } |
161 | 161 | } |
162 | 162 | break; |
163 | 163 | |
164 | 164 | case $this->endSequence[0]: |
165 | - if (!$this->ends($src, $n)) { |
|
165 | + if (!$this->ends($src, $n)){ |
|
166 | 166 | // still part of body |
167 | 167 | $this->body[] = $n; |
168 | 168 | break; |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | $this->tokens[] = new Token( |
173 | 173 | $this->endToken, |
174 | 174 | $n->offset, |
175 | - $n->char . $this->nextBytes($src, strlen($this->endSequence) - 1) |
|
175 | + $n->char.$this->nextBytes($src, strlen($this->endSequence) - 1) |
|
176 | 176 | ); |
177 | 177 | |
178 | 178 | break 2; |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | } |
182 | 182 | } |
183 | 183 | |
184 | - if (count($this->tokens) !== 3) { |
|
184 | + if (count($this->tokens) !== 3){ |
|
185 | 185 | return null; |
186 | 186 | } |
187 | 187 | |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | */ |
198 | 198 | private function ends(Buffer $src, Byte $n): bool |
199 | 199 | { |
200 | - return $this->endSequence === ($n->char . $src->lookaheadByte(strlen($this->endSequence) - 1)); |
|
200 | + return $this->endSequence === ($n->char.$src->lookaheadByte(strlen($this->endSequence) - 1)); |
|
201 | 201 | } |
202 | 202 | |
203 | 203 | /** |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | private function nextBytes(Buffer $src, int $size): string |
211 | 211 | { |
212 | 212 | $result = ''; |
213 | - for ($i = 0; $i < $size; $i++) { |
|
213 | + for ($i = 0; $i < $size; $i++){ |
|
214 | 214 | $result .= $src->next()->char; |
215 | 215 | } |
216 | 216 | |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | */ |
223 | 223 | private function flushBody(): void |
224 | 224 | { |
225 | - if ($this->body === []) { |
|
225 | + if ($this->body === []){ |
|
226 | 226 | return; |
227 | 227 | } |
228 | 228 |
@@ -119,7 +119,8 @@ discard block |
||
119 | 119 | */ |
120 | 120 | public function starts(Buffer $src, Byte $n): bool |
121 | 121 | { |
122 | - if (!$this->active) { |
|
122 | + if (!$this->active) |
|
123 | + { |
|
123 | 124 | return false; |
124 | 125 | } |
125 | 126 | |
@@ -143,26 +144,32 @@ discard block |
||
143 | 144 | ), |
144 | 145 | ]; |
145 | 146 | |
146 | - while ($n = $src->next()) { |
|
147 | - if (!$n instanceof Byte) { |
|
147 | + while ($n = $src->next()) |
|
148 | + { |
|
149 | + if (!$n instanceof Byte) |
|
150 | + { |
|
148 | 151 | // no other grammars are allowed |
149 | 152 | break; |
150 | 153 | } |
151 | 154 | |
152 | - switch ($n->char) { |
|
155 | + switch ($n->char) |
|
156 | + { |
|
153 | 157 | case '"': |
154 | 158 | case "'": |
155 | 159 | $this->body[] = $n; |
156 | - while ($nn = $src->next()) { |
|
160 | + while ($nn = $src->next()) |
|
161 | + { |
|
157 | 162 | $this->body[] = $nn; |
158 | - if ($nn instanceof Byte && $nn->char === $n->char) { |
|
163 | + if ($nn instanceof Byte && $nn->char === $n->char) |
|
164 | + { |
|
159 | 165 | break; |
160 | 166 | } |
161 | 167 | } |
162 | 168 | break; |
163 | 169 | |
164 | 170 | case $this->endSequence[0]: |
165 | - if (!$this->ends($src, $n)) { |
|
171 | + if (!$this->ends($src, $n)) |
|
172 | + { |
|
166 | 173 | // still part of body |
167 | 174 | $this->body[] = $n; |
168 | 175 | break; |
@@ -181,7 +188,8 @@ discard block |
||
181 | 188 | } |
182 | 189 | } |
183 | 190 | |
184 | - if (count($this->tokens) !== 3) { |
|
191 | + if (count($this->tokens) !== 3) |
|
192 | + { |
|
185 | 193 | return null; |
186 | 194 | } |
187 | 195 | |
@@ -210,7 +218,8 @@ discard block |
||
210 | 218 | private function nextBytes(Buffer $src, int $size): string |
211 | 219 | { |
212 | 220 | $result = ''; |
213 | - for ($i = 0; $i < $size; $i++) { |
|
221 | + for ($i = 0; $i < $size; $i++) |
|
222 | + { |
|
214 | 223 | $result .= $src->next()->char; |
215 | 224 | } |
216 | 225 | |
@@ -222,7 +231,8 @@ discard block |
||
222 | 231 | */ |
223 | 232 | private function flushBody(): void |
224 | 233 | { |
225 | - if ($this->body === []) { |
|
234 | + if ($this->body === []) |
|
235 | + { |
|
226 | 236 | return; |
227 | 237 | } |
228 | 238 |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | |
10 | 10 | declare(strict_types=1); |
11 | 11 | |
12 | -if (!function_exists('inject')) { |
|
12 | +if (!function_exists('inject')){ |
|
13 | 13 | /** |
14 | 14 | * Macro function to be replaced by the injected value. |
15 | 15 | * |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | } |
24 | 24 | } |
25 | 25 | |
26 | -if (!function_exists('injected')) { |
|
26 | +if (!function_exists('injected')){ |
|
27 | 27 | /** |
28 | 28 | * Return true if block value has been defined. |
29 | 29 | * |
@@ -9,7 +9,8 @@ discard block |
||
9 | 9 | |
10 | 10 | declare(strict_types=1); |
11 | 11 | |
12 | -if (!function_exists('inject')) { |
|
12 | +if (!function_exists('inject')) |
|
13 | +{ |
|
13 | 14 | /** |
14 | 15 | * Macro function to be replaced by the injected value. |
15 | 16 | * |
@@ -23,7 +24,8 @@ discard block |
||
23 | 24 | } |
24 | 25 | } |
25 | 26 | |
26 | -if (!function_exists('injected')) { |
|
27 | +if (!function_exists('injected')) |
|
28 | +{ |
|
27 | 29 | /** |
28 | 30 | * Return true if block value has been defined. |
29 | 31 | * |
@@ -10,14 +10,14 @@ discard block |
||
10 | 10 | $vendorDir = dirname(dirname($vendorDir)); |
11 | 11 | $vendorID = null; |
12 | 12 | $vendorCount = 0; |
13 | -foreach ($stacktrace as $index => $trace) { |
|
13 | +foreach ($stacktrace as $index => $trace){ |
|
14 | 14 | $args = []; |
15 | - if (isset($trace['args'])) { |
|
15 | + if (isset($trace['args'])){ |
|
16 | 16 | $args = $valueWrapper->wrap($trace['args']); |
17 | 17 | } |
18 | 18 | |
19 | - $function = '<strong>' . $trace['function'] . '</strong>'; |
|
20 | - if (isset($trace['type']) && isset($trace['class'])) { |
|
19 | + $function = '<strong>'.$trace['function'].'</strong>'; |
|
20 | + if (isset($trace['type']) && isset($trace['class'])){ |
|
21 | 21 | $reflection = new ReflectionClass($trace['class']); |
22 | 22 | $function = sprintf( |
23 | 23 | '<span title="%s">%s</span>%s%s', |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | ); |
29 | 29 | } |
30 | 30 | |
31 | - if (!isset($trace['file']) || !file_exists($trace['file'])) { ?> |
|
31 | + if (!isset($trace['file']) || !file_exists($trace['file'])){ ?> |
|
32 | 32 | <div class="container no-trace"> |
33 | 33 | <?= $function ?>(<span class="arguments"><?= implode(', ', $args) ?></span>) |
34 | 34 | </div> |
@@ -37,21 +37,21 @@ discard block |
||
37 | 37 | } |
38 | 38 | |
39 | 39 | $isVendor = strpos($trace['file'], $vendorDir) === 0 && $index > 1; |
40 | - if ($isVendor) { |
|
41 | - if ($vendorID === null) { |
|
40 | + if ($isVendor){ |
|
41 | + if ($vendorID === null){ |
|
42 | 42 | $vendorID = $index; |
43 | 43 | $vendorCount++; |
44 | 44 | echo sprintf('<span id="hidden-trace-%s" style="display: none;">', $vendorID); |
45 | - } else { |
|
45 | + }else{ |
|
46 | 46 | $vendorCount++; |
47 | 47 | } |
48 | - } elseif ($vendorID !== null) { |
|
48 | + } elseif ($vendorID !== null){ |
|
49 | 49 | echo '</span>'; |
50 | 50 | echo sprintf( |
51 | 51 | '<div id="%s" class="container" style="cursor: pointer;" onclick="toggle(\'%s\'); toggle(\'%s\');">+ %s vendor frame(s)...</div>', |
52 | - 'toggle-trace-' . $vendorID, |
|
53 | - 'toggle-trace-' . $vendorID, |
|
54 | - 'hidden-trace-' . $vendorID, |
|
52 | + 'toggle-trace-'.$vendorID, |
|
53 | + 'toggle-trace-'.$vendorID, |
|
54 | + 'hidden-trace-'.$vendorID, |
|
55 | 55 | $vendorCount |
56 | 56 | ); |
57 | 57 | $vendorID = null; |
@@ -72,6 +72,6 @@ discard block |
||
72 | 72 | <?php |
73 | 73 | } |
74 | 74 | |
75 | -if ($vendorID !== null) { |
|
75 | +if ($vendorID !== null){ |
|
76 | 76 | echo '</span>'; |
77 | 77 | } |
@@ -10,14 +10,17 @@ discard block |
||
10 | 10 | $vendorDir = dirname(dirname($vendorDir)); |
11 | 11 | $vendorID = null; |
12 | 12 | $vendorCount = 0; |
13 | -foreach ($stacktrace as $index => $trace) { |
|
13 | +foreach ($stacktrace as $index => $trace) |
|
14 | +{ |
|
14 | 15 | $args = []; |
15 | - if (isset($trace['args'])) { |
|
16 | + if (isset($trace['args'])) |
|
17 | + { |
|
16 | 18 | $args = $valueWrapper->wrap($trace['args']); |
17 | 19 | } |
18 | 20 | |
19 | 21 | $function = '<strong>' . $trace['function'] . '</strong>'; |
20 | - if (isset($trace['type']) && isset($trace['class'])) { |
|
22 | + if (isset($trace['type']) && isset($trace['class'])) |
|
23 | + { |
|
21 | 24 | $reflection = new ReflectionClass($trace['class']); |
22 | 25 | $function = sprintf( |
23 | 26 | '<span title="%s">%s</span>%s%s', |
@@ -28,7 +31,9 @@ discard block |
||
28 | 31 | ); |
29 | 32 | } |
30 | 33 | |
31 | - if (!isset($trace['file']) || !file_exists($trace['file'])) { ?> |
|
34 | + if (!isset($trace['file']) || !file_exists($trace['file'])) |
|
35 | + { |
|
36 | +?> |
|
32 | 37 | <div class="container no-trace"> |
33 | 38 | <?= $function ?>(<span class="arguments"><?= implode(', ', $args) ?></span>) |
34 | 39 | </div> |
@@ -37,15 +42,21 @@ discard block |
||
37 | 42 | } |
38 | 43 | |
39 | 44 | $isVendor = strpos($trace['file'], $vendorDir) === 0 && $index > 1; |
40 | - if ($isVendor) { |
|
41 | - if ($vendorID === null) { |
|
45 | + if ($isVendor) |
|
46 | + { |
|
47 | + if ($vendorID === null) |
|
48 | + { |
|
42 | 49 | $vendorID = $index; |
43 | 50 | $vendorCount++; |
44 | 51 | echo sprintf('<span id="hidden-trace-%s" style="display: none;">', $vendorID); |
45 | - } else { |
|
52 | + } |
|
53 | + else |
|
54 | + { |
|
46 | 55 | $vendorCount++; |
47 | 56 | } |
48 | - } elseif ($vendorID !== null) { |
|
57 | + } |
|
58 | + elseif ($vendorID !== null) |
|
59 | + { |
|
49 | 60 | echo '</span>'; |
50 | 61 | echo sprintf( |
51 | 62 | '<div id="%s" class="container" style="cursor: pointer;" onclick="toggle(\'%s\'); toggle(\'%s\');">+ %s vendor frame(s)...</div>', |
@@ -72,6 +83,7 @@ discard block |
||
72 | 83 | <?php |
73 | 84 | } |
74 | 85 | |
75 | -if ($vendorID !== null) { |
|
86 | +if ($vendorID !== null) |
|
87 | +{ |
|
76 | 88 | echo '</span>'; |
77 | 89 | } |
@@ -24,19 +24,19 @@ |
||
24 | 24 | */ |
25 | 25 | public function leaveNode(Node $node): void |
26 | 26 | { |
27 | - if ($node instanceof Node\Stmt\ClassMethod && $node->name->name === '__construct') { |
|
28 | - foreach ($node->params as $param) { |
|
29 | - if ($param->type instanceof Node\NullableType) { |
|
30 | - if ($param->type->type instanceof Node\Identifier) { |
|
27 | + if ($node instanceof Node\Stmt\ClassMethod && $node->name->name === '__construct'){ |
|
28 | + foreach ($node->params as $param){ |
|
29 | + if ($param->type instanceof Node\NullableType){ |
|
30 | + if ($param->type->type instanceof Node\Identifier){ |
|
31 | 31 | $type = $param->type->type->name; |
32 | - } else { |
|
32 | + }else{ |
|
33 | 33 | $type = implode('\\', $param->type->type->parts); |
34 | 34 | } |
35 | 35 | |
36 | 36 | $type = "?$type"; |
37 | - } elseif ($param->type instanceof Node\Name) { |
|
37 | + } elseif ($param->type instanceof Node\Name){ |
|
38 | 38 | $type = implode('\\', $param->type->parts); |
39 | - } else { |
|
39 | + }else{ |
|
40 | 40 | $type = $param->type->name ?? null; |
41 | 41 | } |
42 | 42 |
@@ -24,19 +24,29 @@ |
||
24 | 24 | */ |
25 | 25 | public function leaveNode(Node $node): void |
26 | 26 | { |
27 | - if ($node instanceof Node\Stmt\ClassMethod && $node->name->name === '__construct') { |
|
28 | - foreach ($node->params as $param) { |
|
29 | - if ($param->type instanceof Node\NullableType) { |
|
30 | - if ($param->type->type instanceof Node\Identifier) { |
|
27 | + if ($node instanceof Node\Stmt\ClassMethod && $node->name->name === '__construct') |
|
28 | + { |
|
29 | + foreach ($node->params as $param) |
|
30 | + { |
|
31 | + if ($param->type instanceof Node\NullableType) |
|
32 | + { |
|
33 | + if ($param->type->type instanceof Node\Identifier) |
|
34 | + { |
|
31 | 35 | $type = $param->type->type->name; |
32 | - } else { |
|
36 | + } |
|
37 | + else |
|
38 | + { |
|
33 | 39 | $type = implode('\\', $param->type->type->parts); |
34 | 40 | } |
35 | 41 | |
36 | 42 | $type = "?$type"; |
37 | - } elseif ($param->type instanceof Node\Name) { |
|
43 | + } |
|
44 | + elseif ($param->type instanceof Node\Name) |
|
45 | + { |
|
38 | 46 | $type = implode('\\', $param->type->parts); |
39 | - } else { |
|
47 | + } |
|
48 | + else |
|
49 | + { |
|
40 | 50 | $type = $param->type->name ?? null; |
41 | 51 | } |
42 | 52 |
@@ -26,22 +26,22 @@ discard block |
||
26 | 26 | { |
27 | 27 | $lines = explode("\n", $comment); |
28 | 28 | |
29 | - foreach ($lines as $line) { |
|
29 | + foreach ($lines as $line){ |
|
30 | 30 | // strip up comment prefix |
31 | 31 | $line = preg_replace('/[\t ]*[\/]?\*[\/]? ?/', '', $line); |
32 | 32 | |
33 | - if (preg_match('/ *@([^ ]+) (.*)/u', $line, $matches)) { |
|
33 | + if (preg_match('/ *@([^ ]+) (.*)/u', $line, $matches)){ |
|
34 | 34 | $this->lines[] = new Line($matches[2], $matches[1]); |
35 | - } else { |
|
35 | + }else{ |
|
36 | 36 | $this->lines[] = new Line($line); |
37 | 37 | } |
38 | 38 | } |
39 | 39 | |
40 | - if (isset($this->lines[0]) && $this->lines[0]->isEmpty()) { |
|
40 | + if (isset($this->lines[0]) && $this->lines[0]->isEmpty()){ |
|
41 | 41 | array_shift($this->lines); |
42 | 42 | } |
43 | 43 | |
44 | - if (isset($this->lines[count($this->lines) - 1]) && $this->lines[count($this->lines) - 1]->isEmpty()) { |
|
44 | + if (isset($this->lines[count($this->lines) - 1]) && $this->lines[count($this->lines) - 1]->isEmpty()){ |
|
45 | 45 | array_pop($this->lines); |
46 | 46 | } |
47 | 47 | } |
@@ -55,8 +55,8 @@ discard block |
||
55 | 55 | $result[] = '/**'; |
56 | 56 | |
57 | 57 | // skip first and last tokens |
58 | - foreach ($this->lines as $line) { |
|
59 | - if ($line->type === null) { |
|
58 | + foreach ($this->lines as $line){ |
|
59 | + if ($line->type === null){ |
|
60 | 60 | $result[] = sprintf(' * %s', $line->value); |
61 | 61 | continue; |
62 | 62 | } |
@@ -26,22 +26,28 @@ discard block |
||
26 | 26 | { |
27 | 27 | $lines = explode("\n", $comment); |
28 | 28 | |
29 | - foreach ($lines as $line) { |
|
29 | + foreach ($lines as $line) |
|
30 | + { |
|
30 | 31 | // strip up comment prefix |
31 | 32 | $line = preg_replace('/[\t ]*[\/]?\*[\/]? ?/', '', $line); |
32 | 33 | |
33 | - if (preg_match('/ *@([^ ]+) (.*)/u', $line, $matches)) { |
|
34 | + if (preg_match('/ *@([^ ]+) (.*)/u', $line, $matches)) |
|
35 | + { |
|
34 | 36 | $this->lines[] = new Line($matches[2], $matches[1]); |
35 | - } else { |
|
37 | + } |
|
38 | + else |
|
39 | + { |
|
36 | 40 | $this->lines[] = new Line($line); |
37 | 41 | } |
38 | 42 | } |
39 | 43 | |
40 | - if (isset($this->lines[0]) && $this->lines[0]->isEmpty()) { |
|
44 | + if (isset($this->lines[0]) && $this->lines[0]->isEmpty()) |
|
45 | + { |
|
41 | 46 | array_shift($this->lines); |
42 | 47 | } |
43 | 48 | |
44 | - if (isset($this->lines[count($this->lines) - 1]) && $this->lines[count($this->lines) - 1]->isEmpty()) { |
|
49 | + if (isset($this->lines[count($this->lines) - 1]) && $this->lines[count($this->lines) - 1]->isEmpty()) |
|
50 | + { |
|
45 | 51 | array_pop($this->lines); |
46 | 52 | } |
47 | 53 | } |
@@ -55,8 +61,10 @@ discard block |
||
55 | 61 | $result[] = '/**'; |
56 | 62 | |
57 | 63 | // skip first and last tokens |
58 | - foreach ($this->lines as $line) { |
|
59 | - if ($line->type === null) { |
|
64 | + foreach ($this->lines as $line) |
|
65 | + { |
|
66 | + if ($line->type === null) |
|
67 | + { |
|
60 | 68 | $result[] = sprintf(' * %s', $line->value); |
61 | 69 | continue; |
62 | 70 | } |
@@ -10,8 +10,8 @@ discard block |
||
10 | 10 | * |
11 | 11 | * @see https://github.com/symplify/symplify/issues/2061 |
12 | 12 | */ |
13 | -\register_shutdown_function(static function () { |
|
14 | - $dest = \json_decode(\file_get_contents(__DIR__ . '/composer.json'), true); |
|
13 | +\register_shutdown_function(static function (){ |
|
14 | + $dest = \json_decode(\file_get_contents(__DIR__.'/composer.json'), true); |
|
15 | 15 | |
16 | 16 | $result = [ |
17 | 17 | 'name' => 'spiral/framework', |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | |
47 | 47 | $json = \json_encode($result, \JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES); |
48 | 48 | |
49 | - \file_put_contents(__DIR__ . '/composer.json', $json . "\n"); |
|
49 | + \file_put_contents(__DIR__.'/composer.json', $json."\n"); |
|
50 | 50 | }); |
51 | 51 | |
52 | 52 |
@@ -10,7 +10,8 @@ |
||
10 | 10 | * |
11 | 11 | * @see https://github.com/symplify/symplify/issues/2061 |
12 | 12 | */ |
13 | -\register_shutdown_function(static function () { |
|
13 | +\register_shutdown_function(static function () |
|
14 | +{ |
|
14 | 15 | $dest = \json_decode(\file_get_contents(__DIR__ . '/composer.json'), true); |
15 | 16 | |
16 | 17 | $result = [ |