@@ -19,7 +19,7 @@ |
||
19 | 19 | private readonly string $name, |
20 | 20 | private readonly mixed $payload, |
21 | 21 | private readonly array $headers, |
22 | - ) { |
|
22 | + ){ |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | public function getPayload(): mixed |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | |
24 | 24 | public function handle(Parser $parser, Assembler $asm, Token $token): void |
25 | 25 | { |
26 | - switch ($token->type) { |
|
26 | + switch ($token->type){ |
|
27 | 27 | case DynamicGrammar::TYPE_DIRECTIVE: |
28 | 28 | $this->directive = new Directive(new Parser\Context($token, $parser->getPath())); |
29 | 29 | $asm->push($this->directive); |
@@ -48,20 +48,20 @@ discard block |
||
48 | 48 | break; |
49 | 49 | |
50 | 50 | case DynamicGrammar::TYPE_KEYWORD: |
51 | - if ($this->directive !== null) { |
|
51 | + if ($this->directive !== null){ |
|
52 | 52 | $this->directive->name = $token->content; |
53 | 53 | } |
54 | 54 | break; |
55 | 55 | |
56 | 56 | case DynamicGrammar::TYPE_BODY: |
57 | - if ($this->directive !== null) { |
|
57 | + if ($this->directive !== null){ |
|
58 | 58 | $this->directive->body = $token->content; |
59 | 59 | $this->directive->values = $this->fetchValues($this->directive->body); |
60 | 60 | |
61 | 61 | $this->directive = null; |
62 | 62 | } |
63 | 63 | |
64 | - if ($this->output !== null) { |
|
64 | + if ($this->output !== null){ |
|
65 | 65 | $this->output->body = $token->content; |
66 | 66 | } |
67 | 67 | |
@@ -79,31 +79,31 @@ discard block |
||
79 | 79 | |
80 | 80 | $src = new StringStream($body); |
81 | 81 | |
82 | - while ($n = $src->peak()) { |
|
83 | - if (\in_array($n, ['"', "'"], true)) { |
|
82 | + while ($n = $src->peak()){ |
|
83 | + if (\in_array($n, ['"', "'"], true)){ |
|
84 | 84 | $values[\count($values) - 1] .= $n; |
85 | - while (($nn = $src->peak()) !== null) { |
|
85 | + while (($nn = $src->peak()) !== null){ |
|
86 | 86 | $values[\count($values) - 1] .= $nn; |
87 | - if ($nn === $n) { |
|
87 | + if ($nn === $n){ |
|
88 | 88 | break; |
89 | 89 | } |
90 | 90 | } |
91 | 91 | continue; |
92 | 92 | } |
93 | 93 | |
94 | - if ($n === ',' && $level === 0) { |
|
94 | + if ($n === ',' && $level === 0){ |
|
95 | 95 | $values[] = ''; |
96 | 96 | continue; |
97 | 97 | } |
98 | 98 | |
99 | 99 | $values[\count($values) - 1] .= $n; |
100 | 100 | |
101 | - if ($n === '(' || $n === '[' || $n === '{') { |
|
101 | + if ($n === '(' || $n === '[' || $n === '{'){ |
|
102 | 102 | $level++; |
103 | 103 | continue; |
104 | 104 | } |
105 | 105 | |
106 | - if ($n === ')' || $n === ']' || $n === '}') { |
|
106 | + if ($n === ')' || $n === ']' || $n === '}'){ |
|
107 | 107 | $level--; |
108 | 108 | } |
109 | 109 | } |
@@ -23,7 +23,8 @@ discard block |
||
23 | 23 | |
24 | 24 | public function handle(Parser $parser, Assembler $asm, Token $token): void |
25 | 25 | { |
26 | - switch ($token->type) { |
|
26 | + switch ($token->type) |
|
27 | + { |
|
27 | 28 | case DynamicGrammar::TYPE_DIRECTIVE: |
28 | 29 | $this->directive = new Directive(new Parser\Context($token, $parser->getPath())); |
29 | 30 | $asm->push($this->directive); |
@@ -48,20 +49,23 @@ discard block |
||
48 | 49 | break; |
49 | 50 | |
50 | 51 | case DynamicGrammar::TYPE_KEYWORD: |
51 | - if ($this->directive !== null) { |
|
52 | + if ($this->directive !== null) |
|
53 | + { |
|
52 | 54 | $this->directive->name = $token->content; |
53 | 55 | } |
54 | 56 | break; |
55 | 57 | |
56 | 58 | case DynamicGrammar::TYPE_BODY: |
57 | - if ($this->directive !== null) { |
|
59 | + if ($this->directive !== null) |
|
60 | + { |
|
58 | 61 | $this->directive->body = $token->content; |
59 | 62 | $this->directive->values = $this->fetchValues($this->directive->body); |
60 | 63 | |
61 | 64 | $this->directive = null; |
62 | 65 | } |
63 | 66 | |
64 | - if ($this->output !== null) { |
|
67 | + if ($this->output !== null) |
|
68 | + { |
|
65 | 69 | $this->output->body = $token->content; |
66 | 70 | } |
67 | 71 | |
@@ -79,31 +83,38 @@ discard block |
||
79 | 83 | |
80 | 84 | $src = new StringStream($body); |
81 | 85 | |
82 | - while ($n = $src->peak()) { |
|
83 | - if (\in_array($n, ['"', "'"], true)) { |
|
86 | + while ($n = $src->peak()) |
|
87 | + { |
|
88 | + if (\in_array($n, ['"', "'"], true)) |
|
89 | + { |
|
84 | 90 | $values[\count($values) - 1] .= $n; |
85 | - while (($nn = $src->peak()) !== null) { |
|
91 | + while (($nn = $src->peak()) !== null) |
|
92 | + { |
|
86 | 93 | $values[\count($values) - 1] .= $nn; |
87 | - if ($nn === $n) { |
|
94 | + if ($nn === $n) |
|
95 | + { |
|
88 | 96 | break; |
89 | 97 | } |
90 | 98 | } |
91 | 99 | continue; |
92 | 100 | } |
93 | 101 | |
94 | - if ($n === ',' && $level === 0) { |
|
102 | + if ($n === ',' && $level === 0) |
|
103 | + { |
|
95 | 104 | $values[] = ''; |
96 | 105 | continue; |
97 | 106 | } |
98 | 107 | |
99 | 108 | $values[\count($values) - 1] .= $n; |
100 | 109 | |
101 | - if ($n === '(' || $n === '[' || $n === '{') { |
|
110 | + if ($n === '(' || $n === '[' || $n === '{') |
|
111 | + { |
|
102 | 112 | $level++; |
103 | 113 | continue; |
104 | 114 | } |
105 | 115 | |
106 | - if ($n === ')' || $n === ']' || $n === '}') { |
|
116 | + if ($n === ')' || $n === ']' || $n === '}') |
|
117 | + { |
|
107 | 118 | $level--; |
108 | 119 | } |
109 | 120 | } |
@@ -14,7 +14,7 @@ |
||
14 | 14 | return \sprintf( |
15 | 15 | '<img title=%s src=%s size=%s type=%s>', |
16 | 16 | $directive->values[0], |
17 | - \str_starts_with($directive->values[1], '$') ? \sprintf('"<?php echo %s; ?>"', $directive->values[1]) : $directive->values[1], |
|
17 | + \str_starts_with($directive->values[1], '$') ? \sprintf('"<?php echo %s; ?>"', $directive->values[1]) : $directive->values[1], |
|
18 | 18 | $directive->values[2], |
19 | 19 | $directive->values[3], |
20 | 20 | ); |
@@ -21,8 +21,8 @@ |
||
21 | 21 | private readonly bool $isLegacy; |
22 | 22 | |
23 | 23 | public function __construct( |
24 | - private readonly CoreInterface|InterceptorHandler $core, |
|
25 | - ) { |
|
24 | + private readonly CoreInterface | InterceptorHandler $core, |
|
25 | + ){ |
|
26 | 26 | $this->isLegacy = !$core instanceof HandlerInterface; |
27 | 27 | } |
28 | 28 |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | $logger = $factory->getLogger(); |
56 | 56 | |
57 | 57 | $this->container->bind(ConfiguratorInterface::class, new ConfigManager( |
58 | - new class() implements LoaderInterface { |
|
58 | + new class() implements LoaderInterface{ |
|
59 | 59 | public function has(string $section): bool |
60 | 60 | { |
61 | 61 | return false; |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | $factory = new LogFactory(new MonologConfig([]), new ListenerRegistry(), new Container()); |
84 | 84 | |
85 | 85 | $this->container->bind(ConfiguratorInterface::class, new ConfigManager( |
86 | - new class() implements LoaderInterface { |
|
86 | + new class() implements LoaderInterface{ |
|
87 | 87 | public function has(string $section): bool |
88 | 88 | { |
89 | 89 | return false; |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | $this->container->get(StrategyBasedBootloadManager::class)->bootload([MonologBootloader::class]); |
103 | 103 | $this->container->bind(LogFactory::class, $factory); |
104 | 104 | |
105 | - $this->container->invoke(function (#[LoggerChannel('foo')] LoggerInterface $logger) { |
|
105 | + $this->container->invoke(function (#[LoggerChannel('foo')] LoggerInterface $logger){ |
|
106 | 106 | $this->assertSame('foo', $logger->getName()); |
107 | 107 | }); |
108 | 108 | } |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | public function testFinalizerShouldResetDefaultLogger() |
111 | 111 | { |
112 | 112 | $this->container->bind(ConfiguratorInterface::class, new ConfigManager( |
113 | - new class() implements LoaderInterface { |
|
113 | + new class() implements LoaderInterface{ |
|
114 | 114 | public function has(string $section): bool |
115 | 115 | { |
116 | 116 | return false; |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | public function testFinalizerShouldNotResetLoggerWhenApplicationTerminating() |
151 | 151 | { |
152 | 152 | $this->container->bind(ConfiguratorInterface::class, new ConfigManager( |
153 | - new class() implements LoaderInterface { |
|
153 | + new class() implements LoaderInterface{ |
|
154 | 154 | public function has(string $section): bool |
155 | 155 | { |
156 | 156 | return false; |
@@ -55,7 +55,8 @@ discard block |
||
55 | 55 | $logger = $factory->getLogger(); |
56 | 56 | |
57 | 57 | $this->container->bind(ConfiguratorInterface::class, new ConfigManager( |
58 | - new class() implements LoaderInterface { |
|
58 | + new class() implements LoaderInterface |
|
59 | + { |
|
59 | 60 | public function has(string $section): bool |
60 | 61 | { |
61 | 62 | return false; |
@@ -83,7 +84,8 @@ discard block |
||
83 | 84 | $factory = new LogFactory(new MonologConfig([]), new ListenerRegistry(), new Container()); |
84 | 85 | |
85 | 86 | $this->container->bind(ConfiguratorInterface::class, new ConfigManager( |
86 | - new class() implements LoaderInterface { |
|
87 | + new class() implements LoaderInterface |
|
88 | + { |
|
87 | 89 | public function has(string $section): bool |
88 | 90 | { |
89 | 91 | return false; |
@@ -102,7 +104,8 @@ discard block |
||
102 | 104 | $this->container->get(StrategyBasedBootloadManager::class)->bootload([MonologBootloader::class]); |
103 | 105 | $this->container->bind(LogFactory::class, $factory); |
104 | 106 | |
105 | - $this->container->invoke(function (#[LoggerChannel('foo')] LoggerInterface $logger) { |
|
107 | + $this->container->invoke(function (#[LoggerChannel('foo')] LoggerInterface $logger) |
|
108 | + { |
|
106 | 109 | $this->assertSame('foo', $logger->getName()); |
107 | 110 | }); |
108 | 111 | } |
@@ -110,7 +113,8 @@ discard block |
||
110 | 113 | public function testFinalizerShouldResetDefaultLogger() |
111 | 114 | { |
112 | 115 | $this->container->bind(ConfiguratorInterface::class, new ConfigManager( |
113 | - new class() implements LoaderInterface { |
|
116 | + new class() implements LoaderInterface |
|
117 | + { |
|
114 | 118 | public function has(string $section): bool |
115 | 119 | { |
116 | 120 | return false; |
@@ -150,7 +154,8 @@ discard block |
||
150 | 154 | public function testFinalizerShouldNotResetLoggerWhenApplicationTerminating() |
151 | 155 | { |
152 | 156 | $this->container->bind(ConfiguratorInterface::class, new ConfigManager( |
153 | - new class() implements LoaderInterface { |
|
157 | + new class() implements LoaderInterface |
|
158 | + { |
|
154 | 159 | public function has(string $section): bool |
155 | 160 | { |
156 | 161 | return false; |
@@ -19,7 +19,7 @@ |
||
19 | 19 | public function __construct( |
20 | 20 | callable $receptor, |
21 | 21 | private readonly string $channel |
22 | - ) { |
|
22 | + ){ |
|
23 | 23 | $this->receptor = $receptor(...); |
24 | 24 | } |
25 | 25 |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | |
21 | 21 | public function __construct( |
22 | 22 | private readonly LogsInterface $factory, |
23 | - ) { |
|
23 | + ){ |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | /** |
@@ -28,11 +28,11 @@ discard block |
||
28 | 28 | */ |
29 | 29 | public function createInjection( |
30 | 30 | \ReflectionClass $class, |
31 | - \ReflectionParameter|null|string $context = null, |
|
31 | + \ReflectionParameter | null | string $context = null, |
|
32 | 32 | ): LoggerInterface { |
33 | 33 | $channel = \is_object($context) ? $this->extractChannelAttribute($context) : null; |
34 | 34 | |
35 | - if ($channel === null) { |
|
35 | + if ($channel === null){ |
|
36 | 36 | /** |
37 | 37 | * Array of flags to check if the logger allows null argument |
38 | 38 | * |
@@ -32,7 +32,8 @@ |
||
32 | 32 | ): LoggerInterface { |
33 | 33 | $channel = \is_object($context) ? $this->extractChannelAttribute($context) : null; |
34 | 34 | |
35 | - if ($channel === null) { |
|
35 | + if ($channel === null) |
|
36 | + { |
|
36 | 37 | /** |
37 | 38 | * Array of flags to check if the logger allows null argument |
38 | 39 | * |
@@ -96,7 +96,8 @@ discard block |
||
96 | 96 | $output = ''; |
97 | 97 | |
98 | 98 | $response = $this->responseFactory->createResponse(200); |
99 | - try { |
|
99 | + try |
|
100 | + { |
|
100 | 101 | $action = $this->verbActions |
101 | 102 | ? \strtolower($request->getMethod()) . \ucfirst($this->action) |
102 | 103 | : $this->action; |
@@ -128,14 +129,21 @@ discard block |
||
128 | 129 | ] |
129 | 130 | ) |
130 | 131 | ); |
131 | - } catch (TargetCallException $e) { |
|
132 | + } |
|
133 | + catch (TargetCallException $e) |
|
134 | + { |
|
132 | 135 | \ob_get_clean(); |
133 | 136 | throw $this->mapException($e); |
134 | - } catch (\Throwable $e) { |
|
137 | + } |
|
138 | + catch (\Throwable $e) |
|
139 | + { |
|
135 | 140 | \ob_get_clean(); |
136 | 141 | throw $e; |
137 | - } finally { |
|
138 | - while (\ob_get_level() > $outputLevel + 1) { |
|
142 | + } |
|
143 | + finally |
|
144 | + { |
|
145 | + while (\ob_get_level() > $outputLevel + 1) |
|
146 | + { |
|
139 | 147 | $output = \ob_get_clean() . $output; |
140 | 148 | } |
141 | 149 | } |
@@ -156,21 +164,27 @@ discard block |
||
156 | 164 | */ |
157 | 165 | private function wrapResponse(Response $response, mixed $result = null, string $output = ''): Response |
158 | 166 | { |
159 | - if ($result instanceof Response) { |
|
160 | - if ($output !== '' && $result->getBody()->isWritable()) { |
|
167 | + if ($result instanceof Response) |
|
168 | + { |
|
169 | + if ($output !== '' && $result->getBody()->isWritable()) |
|
170 | + { |
|
161 | 171 | $result->getBody()->write($output); |
162 | 172 | } |
163 | 173 | |
164 | 174 | return $result; |
165 | 175 | } |
166 | 176 | |
167 | - if ($result instanceof \Generator) { |
|
177 | + if ($result instanceof \Generator) |
|
178 | + { |
|
168 | 179 | return $response->withBody(new GeneratorStream($result)); |
169 | 180 | } |
170 | 181 | |
171 | - if (\is_array($result) || $result instanceof \JsonSerializable) { |
|
182 | + if (\is_array($result) || $result instanceof \JsonSerializable) |
|
183 | + { |
|
172 | 184 | $response = $this->writeJson($response, $result); |
173 | - } else { |
|
185 | + } |
|
186 | + else |
|
187 | + { |
|
174 | 188 | $response->getBody()->write((string)$result); |
175 | 189 | } |
176 | 190 | |
@@ -203,7 +217,8 @@ discard block |
||
203 | 217 | */ |
204 | 218 | private function checkValues(): void |
205 | 219 | { |
206 | - if ($this->controller === null) { |
|
220 | + if ($this->controller === null) |
|
221 | + { |
|
207 | 222 | throw new HandlerException('Controller and action pair are not set.'); |
208 | 223 | } |
209 | 224 | } |
@@ -46,11 +46,11 @@ discard block |
||
46 | 46 | private bool $isLegacyPipeline; |
47 | 47 | |
48 | 48 | public function __construct( |
49 | - private readonly HandlerInterface|CoreInterface $core, |
|
49 | + private readonly HandlerInterface | CoreInterface $core, |
|
50 | 50 | private readonly ScopeInterface $scope, |
51 | 51 | private readonly ResponseFactoryInterface $responseFactory, |
52 | 52 | ?TracerInterface $tracer = null |
53 | - ) { |
|
53 | + ){ |
|
54 | 54 | $this->tracer = $tracer ?? new NullTracer($scope); |
55 | 55 | $this->isLegacyPipeline = !$core instanceof HandlerInterface; |
56 | 56 | } |
@@ -98,9 +98,9 @@ discard block |
||
98 | 98 | $output = ''; |
99 | 99 | |
100 | 100 | $response = $this->responseFactory->createResponse(200); |
101 | - try { |
|
101 | + try{ |
|
102 | 102 | $action = $this->verbActions |
103 | - ? \strtolower($request->getMethod()) . \ucfirst($this->action) |
|
103 | + ? \strtolower($request->getMethod()).\ucfirst($this->action) |
|
104 | 104 | : $this->action; |
105 | 105 | |
106 | 106 | // run the core withing PSR-7 Request/Response scope |
@@ -114,14 +114,14 @@ discard block |
||
114 | 114 | bindings: [Request::class => $request, Response::class => $response, $controller => $controller], |
115 | 115 | ), |
116 | 116 | fn (): mixed => $this->tracer->trace( |
117 | - name: 'Controller [' . $controller . ':' . $action . ']', |
|
117 | + name: 'Controller ['.$controller.':'.$action.']', |
|
118 | 118 | callback: $this->isLegacyPipeline |
119 | - ? fn (): mixed => $this->core->callAction( |
|
120 | - controller: $controller, |
|
121 | - action: $action, |
|
122 | - parameters: $parameters, |
|
119 | + ? fn () : mixed => $this->core->callAction( |
|
120 | + controller : $controller, |
|
121 | + action : $action, |
|
122 | + parameters : $parameters, |
|
123 | 123 | ) |
124 | - : fn (): mixed => $this->core->handle( |
|
124 | + : fn () : mixed => $this->core->handle( |
|
125 | 125 | new CallContext( |
126 | 126 | Target::fromPair($controller, $action), |
127 | 127 | $parameters, |
@@ -130,29 +130,29 @@ discard block |
||
130 | 130 | ], |
131 | 131 | ), |
132 | 132 | ), |
133 | - attributes: [ |
|
133 | + attributes : [ |
|
134 | 134 | 'route.controller' => $this->controller, |
135 | 135 | 'route.action' => $action, |
136 | 136 | 'route.parameters' => \array_keys($parameters), |
137 | 137 | ] |
138 | 138 | ) |
139 | 139 | ); |
140 | - } catch (TargetCallException $e) { |
|
140 | + }catch (TargetCallException $e){ |
|
141 | 141 | \ob_get_clean(); |
142 | 142 | throw $this->mapException($e); |
143 | - } catch (\Throwable $e) { |
|
143 | + }catch (\Throwable $e){ |
|
144 | 144 | \ob_get_clean(); |
145 | 145 | throw $e; |
146 | - } finally { |
|
147 | - while (\ob_get_level() > $outputLevel + 1) { |
|
148 | - $output = \ob_get_clean() . $output; |
|
146 | + }finally{ |
|
147 | + while (\ob_get_level() > $outputLevel + 1){ |
|
148 | + $output = \ob_get_clean().$output; |
|
149 | 149 | } |
150 | 150 | } |
151 | 151 | |
152 | 152 | return $this->wrapResponse( |
153 | 153 | $response, |
154 | 154 | $result, |
155 | - \ob_get_clean() . $output, |
|
155 | + \ob_get_clean().$output, |
|
156 | 156 | ); |
157 | 157 | } |
158 | 158 | |
@@ -165,21 +165,21 @@ discard block |
||
165 | 165 | */ |
166 | 166 | private function wrapResponse(Response $response, mixed $result = null, string $output = ''): Response |
167 | 167 | { |
168 | - if ($result instanceof Response) { |
|
169 | - if ($output !== '' && $result->getBody()->isWritable()) { |
|
168 | + if ($result instanceof Response){ |
|
169 | + if ($output !== '' && $result->getBody()->isWritable()){ |
|
170 | 170 | $result->getBody()->write($output); |
171 | 171 | } |
172 | 172 | |
173 | 173 | return $result; |
174 | 174 | } |
175 | 175 | |
176 | - if ($result instanceof \Generator) { |
|
176 | + if ($result instanceof \Generator){ |
|
177 | 177 | return $response->withBody(new GeneratorStream($result)); |
178 | 178 | } |
179 | 179 | |
180 | - if (\is_array($result) || $result instanceof \JsonSerializable) { |
|
180 | + if (\is_array($result) || $result instanceof \JsonSerializable){ |
|
181 | 181 | $response = $this->writeJson($response, $result); |
182 | - } else { |
|
182 | + }else{ |
|
183 | 183 | $response->getBody()->write((string)$result); |
184 | 184 | } |
185 | 185 | |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | */ |
213 | 213 | private function checkValues(): void |
214 | 214 | { |
215 | - if ($this->controller === null) { |
|
215 | + if ($this->controller === null){ |
|
216 | 216 | throw new HandlerException('Controller and action pair are not set.'); |
217 | 217 | } |
218 | 218 | } |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | public function __construct( |
15 | 15 | private readonly RouteCollection $parent, |
16 | 16 | private readonly RouteCollection $routes |
17 | - ) { |
|
17 | + ){ |
|
18 | 18 | } |
19 | 19 | |
20 | 20 | public function __destruct() |
@@ -24,17 +24,17 @@ discard block |
||
24 | 24 | |
25 | 25 | public function __sleep(): array |
26 | 26 | { |
27 | - throw new \BadMethodCallException('Cannot unserialize ' . self::class); |
|
27 | + throw new \BadMethodCallException('Cannot unserialize '.self::class); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | public function __wakeup() |
31 | 31 | { |
32 | - throw new \BadMethodCallException('Cannot unserialize ' . self::class); |
|
32 | + throw new \BadMethodCallException('Cannot unserialize '.self::class); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | public function defaults(array $defaults): self |
36 | 36 | { |
37 | - foreach ($this->routes->all() as $configurator) { |
|
37 | + foreach ($this->routes->all() as $configurator){ |
|
38 | 38 | $configurator->defaults($defaults); |
39 | 39 | } |
40 | 40 | |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | */ |
47 | 47 | public function group(string $group): self |
48 | 48 | { |
49 | - foreach ($this->routes->all() as $configurator) { |
|
49 | + foreach ($this->routes->all() as $configurator){ |
|
50 | 50 | $configurator->group($group); |
51 | 51 | } |
52 | 52 | |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | */ |
59 | 59 | public function prefix(string $prefix): self |
60 | 60 | { |
61 | - foreach ($this->routes->all() as $configurator) { |
|
61 | + foreach ($this->routes->all() as $configurator){ |
|
62 | 62 | $configurator->prefix($prefix); |
63 | 63 | } |
64 | 64 | |
@@ -70,26 +70,26 @@ discard block |
||
70 | 70 | */ |
71 | 71 | public function namePrefix(string $prefix): self |
72 | 72 | { |
73 | - foreach ($this->routes->all() as $name => $configurator) { |
|
74 | - $this->routes->add($prefix . $name, $configurator); |
|
73 | + foreach ($this->routes->all() as $name => $configurator){ |
|
74 | + $this->routes->add($prefix.$name, $configurator); |
|
75 | 75 | $this->routes->remove($name); |
76 | 76 | } |
77 | 77 | |
78 | 78 | return $this; |
79 | 79 | } |
80 | 80 | |
81 | - public function core(HandlerInterface|CoreInterface $core): self |
|
81 | + public function core(HandlerInterface | CoreInterface $core): self |
|
82 | 82 | { |
83 | - foreach ($this->routes->all() as $configurator) { |
|
83 | + foreach ($this->routes->all() as $configurator){ |
|
84 | 84 | $configurator->core($core); |
85 | 85 | } |
86 | 86 | |
87 | 87 | return $this; |
88 | 88 | } |
89 | 89 | |
90 | - public function middleware(MiddlewareInterface|string|array $middleware): self |
|
90 | + public function middleware(MiddlewareInterface | string | array $middleware): self |
|
91 | 91 | { |
92 | - foreach ($this->routes->all() as $configurator) { |
|
92 | + foreach ($this->routes->all() as $configurator){ |
|
93 | 93 | $configurator->middleware($middleware); |
94 | 94 | } |
95 | 95 |
@@ -34,7 +34,8 @@ discard block |
||
34 | 34 | |
35 | 35 | public function defaults(array $defaults): self |
36 | 36 | { |
37 | - foreach ($this->routes->all() as $configurator) { |
|
37 | + foreach ($this->routes->all() as $configurator) |
|
38 | + { |
|
38 | 39 | $configurator->defaults($defaults); |
39 | 40 | } |
40 | 41 | |
@@ -46,7 +47,8 @@ discard block |
||
46 | 47 | */ |
47 | 48 | public function group(string $group): self |
48 | 49 | { |
49 | - foreach ($this->routes->all() as $configurator) { |
|
50 | + foreach ($this->routes->all() as $configurator) |
|
51 | + { |
|
50 | 52 | $configurator->group($group); |
51 | 53 | } |
52 | 54 | |
@@ -58,7 +60,8 @@ discard block |
||
58 | 60 | */ |
59 | 61 | public function prefix(string $prefix): self |
60 | 62 | { |
61 | - foreach ($this->routes->all() as $configurator) { |
|
63 | + foreach ($this->routes->all() as $configurator) |
|
64 | + { |
|
62 | 65 | $configurator->prefix($prefix); |
63 | 66 | } |
64 | 67 | |
@@ -70,7 +73,8 @@ discard block |
||
70 | 73 | */ |
71 | 74 | public function namePrefix(string $prefix): self |
72 | 75 | { |
73 | - foreach ($this->routes->all() as $name => $configurator) { |
|
76 | + foreach ($this->routes->all() as $name => $configurator) |
|
77 | + { |
|
74 | 78 | $this->routes->add($prefix . $name, $configurator); |
75 | 79 | $this->routes->remove($name); |
76 | 80 | } |
@@ -80,7 +84,8 @@ discard block |
||
80 | 84 | |
81 | 85 | public function core(HandlerInterface|CoreInterface $core): self |
82 | 86 | { |
83 | - foreach ($this->routes->all() as $configurator) { |
|
87 | + foreach ($this->routes->all() as $configurator) |
|
88 | + { |
|
84 | 89 | $configurator->core($core); |
85 | 90 | } |
86 | 91 | |
@@ -89,7 +94,8 @@ discard block |
||
89 | 94 | |
90 | 95 | public function middleware(MiddlewareInterface|string|array $middleware): self |
91 | 96 | { |
92 | - foreach ($this->routes->all() as $configurator) { |
|
97 | + foreach ($this->routes->all() as $configurator) |
|
98 | + { |
|
93 | 99 | $configurator->middleware($middleware); |
94 | 100 | } |
95 | 101 |