@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | ?string $comment = null, |
22 | 22 | ?string $namespace = null, |
23 | 23 | private readonly bool $isDomain = false, |
24 | - ) { |
|
24 | + ){ |
|
25 | 25 | parent::__construct($config, $name, $comment, $namespace); |
26 | 26 | } |
27 | 27 | |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | $this->class->addConstant('SINGLETONS', [])->setProtected(); |
42 | 42 | $this->class->addConstant('DEPENDENCIES', [])->setProtected(); |
43 | 43 | |
44 | - if ($this->isDomain) { |
|
44 | + if ($this->isDomain){ |
|
45 | 45 | $this->class->addConstant('INTERCEPTORS', [])->setProtected(); |
46 | 46 | $this->namespace->addUse(CoreInterface::class); |
47 | 47 | $this->class->getConstant('SINGLETONS')->setValue([ |
@@ -41,7 +41,8 @@ |
||
41 | 41 | $this->class->addConstant('SINGLETONS', [])->setProtected(); |
42 | 42 | $this->class->addConstant('DEPENDENCIES', [])->setProtected(); |
43 | 43 | |
44 | - if ($this->isDomain) { |
|
44 | + if ($this->isDomain) |
|
45 | + { |
|
45 | 46 | $this->class->addConstant('INTERCEPTORS', [])->setProtected(); |
46 | 47 | $this->namespace->addUse(CoreInterface::class); |
47 | 48 | $this->class->getConstant('SINGLETONS')->setValue([ |
@@ -24,7 +24,7 @@ |
||
24 | 24 | 'alias' => $alias, |
25 | 25 | '--description' => 'My sample command description', |
26 | 26 | ]; |
27 | - if ($alias === null) { |
|
27 | + if ($alias === null){ |
|
28 | 28 | unset($input['alias']); |
29 | 29 | } |
30 | 30 |
@@ -24,7 +24,8 @@ |
||
24 | 24 | 'alias' => $alias, |
25 | 25 | '--description' => 'My sample command description', |
26 | 26 | ]; |
27 | - if ($alias === null) { |
|
27 | + if ($alias === null) |
|
28 | + { |
|
28 | 29 | unset($input['alias']); |
29 | 30 | } |
30 | 31 |
@@ -48,11 +48,11 @@ |
||
48 | 48 | 'alias' => $this->alias ?? \strtolower(\preg_replace('/(?<!^)[A-Z]/', ':$0', $this->name)), |
49 | 49 | ]); |
50 | 50 | |
51 | - foreach ($this->arguments as $argument) { |
|
51 | + foreach ($this->arguments as $argument){ |
|
52 | 52 | $declaration->addArgument($argument); |
53 | 53 | } |
54 | 54 | |
55 | - foreach ($this->options as $option) { |
|
55 | + foreach ($this->options as $option){ |
|
56 | 56 | $declaration->addOption($option); |
57 | 57 | } |
58 | 58 |
@@ -48,11 +48,13 @@ |
||
48 | 48 | 'alias' => $this->alias ?? \strtolower(\preg_replace('/(?<!^)[A-Z]/', ':$0', $this->name)), |
49 | 49 | ]); |
50 | 50 | |
51 | - foreach ($this->arguments as $argument) { |
|
51 | + foreach ($this->arguments as $argument) |
|
52 | + { |
|
52 | 53 | $declaration->addArgument($argument); |
53 | 54 | } |
54 | 55 | |
55 | - foreach ($this->options as $option) { |
|
56 | + foreach ($this->options as $option) |
|
57 | + { |
|
56 | 58 | $declaration->addOption($option); |
57 | 59 | } |
58 | 60 |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | ?string $namespace = null, |
23 | 23 | private readonly ?string $alias = null, |
24 | 24 | private readonly ?string $description = null, |
25 | - ) { |
|
25 | + ){ |
|
26 | 26 | parent::__construct($config, $name, $comment, $namespace); |
27 | 27 | } |
28 | 28 | |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | 'name' => $this->alias, |
70 | 70 | ]; |
71 | 71 | |
72 | - if ($this->description) { |
|
72 | + if ($this->description){ |
|
73 | 73 | $commandDefinition['description'] = $this->description; |
74 | 74 | } |
75 | 75 |
@@ -69,7 +69,8 @@ |
||
69 | 69 | 'name' => $this->alias, |
70 | 70 | ]; |
71 | 71 | |
72 | - if ($this->description) { |
|
72 | + if ($this->description) |
|
73 | + { |
|
73 | 74 | $commandDefinition['description'] = $this->description; |
74 | 75 | } |
75 | 76 |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | protected ?string $comment = null, |
33 | 33 | private readonly string $directory = '', |
34 | 34 | ?string $namespace = null, |
35 | - ) { |
|
35 | + ){ |
|
36 | 36 | parent::__construct($config, $name, $comment, $namespace); |
37 | 37 | } |
38 | 38 | |
@@ -41,8 +41,8 @@ discard block |
||
41 | 41 | $this->class->addConstant('CONFIG', $configName)->setPublic(); |
42 | 42 | |
43 | 43 | $filename = $this->makeConfigFilename($configName); |
44 | - if ($reverse) { |
|
45 | - if (!$this->files->exists($filename)) { |
|
44 | + if ($reverse){ |
|
45 | + if (!$this->files->exists($filename)){ |
|
46 | 46 | throw new ScaffolderException(\sprintf("Config filename %s doesn't exist", $filename)); |
47 | 47 | } |
48 | 48 | |
@@ -50,8 +50,8 @@ discard block |
||
50 | 50 | $this->declareGetters($defaultsFromFile); |
51 | 51 | |
52 | 52 | $this->class->getProperty('config')->setValue($this->defaultValues->get($defaultsFromFile)); |
53 | - } else { |
|
54 | - if (!$this->files->exists($filename)) { |
|
53 | + }else{ |
|
54 | + if (!$this->files->exists($filename)){ |
|
55 | 55 | $this->touchConfigFile($filename); |
56 | 56 | } |
57 | 57 | } |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | |
95 | 95 | $this->files->write( |
96 | 96 | $filename, |
97 | - $file->render() . PHP_EOL . (new Dumper())->dump(new Literal('return [];')), |
|
97 | + $file->render().PHP_EOL.(new Dumper())->dump(new Literal('return [];')), |
|
98 | 98 | FilesInterface::READONLY, |
99 | 99 | true, |
100 | 100 | ); |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | $getters = []; |
113 | 113 | $gettersByKey = []; |
114 | 114 | |
115 | - foreach ($defaults as $key => $value) { |
|
115 | + foreach ($defaults as $key => $value){ |
|
116 | 116 | $key = (string)$key; |
117 | 117 | $getter = $this->makeGetterName($key); |
118 | 118 | $getters[] = $getter; |
@@ -120,19 +120,19 @@ discard block |
||
120 | 120 | $method = $this->class->addMethod($getter)->setPublic(); |
121 | 121 | $method->setBody(\sprintf('return $this->config[\'%s\'];', $key)); |
122 | 122 | |
123 | - if (\is_array($value)) { |
|
123 | + if (\is_array($value)){ |
|
124 | 124 | $gettersByKey[] = ['key' => $key, 'value' => $value]; |
125 | 125 | } |
126 | 126 | |
127 | 127 | $returnTypeHint = $this->typeHints->getHint(\gettype($value)); |
128 | - if ($returnTypeHint !== null) { |
|
128 | + if ($returnTypeHint !== null){ |
|
129 | 129 | $method->setReturnType($returnTypeHint); |
130 | 130 | } |
131 | 131 | } |
132 | 132 | |
133 | - foreach ($gettersByKey as $item) { |
|
133 | + foreach ($gettersByKey as $item){ |
|
134 | 134 | $method = $this->declareGettersByKey($getters, $item['key'], $item['value']); |
135 | - if ($method !== null) { |
|
135 | + if ($method !== null){ |
|
136 | 136 | $getters[] = $method->getName(); |
137 | 137 | } |
138 | 138 | } |
@@ -141,30 +141,30 @@ discard block |
||
141 | 141 | private function declareGettersByKey(array $methodNames, string $key, array $value): ?Method |
142 | 142 | { |
143 | 143 | //Won't create if there's less than 2 sub-items |
144 | - if (\count($value) < 2) { |
|
144 | + if (\count($value) < 2){ |
|
145 | 145 | return null; |
146 | 146 | } |
147 | 147 | |
148 | 148 | $singularKey = $this->singularize($key); |
149 | 149 | $name = $this->makeGetterName($singularKey); |
150 | - if (\in_array($name, $methodNames, true)) { |
|
150 | + if (\in_array($name, $methodNames, true)){ |
|
151 | 151 | $name = $this->makeGetterName($singularKey, 'get', 'by'); |
152 | 152 | } |
153 | 153 | |
154 | 154 | //Name conflict, won't merge |
155 | - if (\in_array($name, $methodNames, true)) { |
|
155 | + if (\in_array($name, $methodNames, true)){ |
|
156 | 156 | return null; |
157 | 157 | } |
158 | 158 | |
159 | 159 | $keyType = defineArrayType(\array_keys($value), '-mixed-'); |
160 | 160 | $valueType = defineArrayType(\array_values($value), '-mixed-'); |
161 | 161 | //We need a fixed structure here |
162 | - if ($keyType === '-mixed-' || $valueType === '-mixed-') { |
|
162 | + if ($keyType === '-mixed-' || $valueType === '-mixed-'){ |
|
163 | 163 | return null; |
164 | 164 | } |
165 | 165 | |
166 | 166 | //Won't create for associated arrays |
167 | - if ($this->typeAnnotations->mapType($keyType) === 'int' && \array_is_list($value)) { |
|
167 | + if ($this->typeAnnotations->mapType($keyType) === 'int' && \array_is_list($value)){ |
|
168 | 168 | return null; |
169 | 169 | } |
170 | 170 | |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | |
175 | 175 | $param = $method->addParameter($singularKey); |
176 | 176 | $paramTypeHint = $this->typeHints->getHint($keyType); |
177 | - if ($paramTypeHint !== null) { |
|
177 | + if ($paramTypeHint !== null){ |
|
178 | 178 | $param->setType($paramTypeHint); |
179 | 179 | } |
180 | 180 | |
@@ -184,13 +184,13 @@ discard block |
||
184 | 184 | private function makeGetterName(string $name, string $prefix = 'get', string $postfix = ''): string |
185 | 185 | { |
186 | 186 | $chunks = []; |
187 | - if (!empty($prefix)) { |
|
187 | + if (!empty($prefix)){ |
|
188 | 188 | $chunks[] = $prefix; |
189 | 189 | } |
190 | 190 | |
191 | 191 | $name = $this->slugify->slugify($name, ['lowercase' => false]); |
192 | 192 | $chunks[] = \count($chunks) !== 0 ? $this->classify($name) : $name; |
193 | - if (!empty($postfix)) { |
|
193 | + if (!empty($postfix)){ |
|
194 | 194 | $chunks[] = \ucfirst($postfix); |
195 | 195 | } |
196 | 196 |
@@ -41,8 +41,10 @@ discard block |
||
41 | 41 | $this->class->addConstant('CONFIG', $configName)->setPublic(); |
42 | 42 | |
43 | 43 | $filename = $this->makeConfigFilename($configName); |
44 | - if ($reverse) { |
|
45 | - if (!$this->files->exists($filename)) { |
|
44 | + if ($reverse) |
|
45 | + { |
|
46 | + if (!$this->files->exists($filename)) |
|
47 | + { |
|
46 | 48 | throw new ScaffolderException(\sprintf("Config filename %s doesn't exist", $filename)); |
47 | 49 | } |
48 | 50 | |
@@ -50,8 +52,11 @@ discard block |
||
50 | 52 | $this->declareGetters($defaultsFromFile); |
51 | 53 | |
52 | 54 | $this->class->getProperty('config')->setValue($this->defaultValues->get($defaultsFromFile)); |
53 | - } else { |
|
54 | - if (!$this->files->exists($filename)) { |
|
55 | + } |
|
56 | + else |
|
57 | + { |
|
58 | + if (!$this->files->exists($filename)) |
|
59 | + { |
|
55 | 60 | $this->touchConfigFile($filename); |
56 | 61 | } |
57 | 62 | } |
@@ -112,7 +117,8 @@ discard block |
||
112 | 117 | $getters = []; |
113 | 118 | $gettersByKey = []; |
114 | 119 | |
115 | - foreach ($defaults as $key => $value) { |
|
120 | + foreach ($defaults as $key => $value) |
|
121 | + { |
|
116 | 122 | $key = (string)$key; |
117 | 123 | $getter = $this->makeGetterName($key); |
118 | 124 | $getters[] = $getter; |
@@ -120,19 +126,23 @@ discard block |
||
120 | 126 | $method = $this->class->addMethod($getter)->setPublic(); |
121 | 127 | $method->setBody(\sprintf('return $this->config[\'%s\'];', $key)); |
122 | 128 | |
123 | - if (\is_array($value)) { |
|
129 | + if (\is_array($value)) |
|
130 | + { |
|
124 | 131 | $gettersByKey[] = ['key' => $key, 'value' => $value]; |
125 | 132 | } |
126 | 133 | |
127 | 134 | $returnTypeHint = $this->typeHints->getHint(\gettype($value)); |
128 | - if ($returnTypeHint !== null) { |
|
135 | + if ($returnTypeHint !== null) |
|
136 | + { |
|
129 | 137 | $method->setReturnType($returnTypeHint); |
130 | 138 | } |
131 | 139 | } |
132 | 140 | |
133 | - foreach ($gettersByKey as $item) { |
|
141 | + foreach ($gettersByKey as $item) |
|
142 | + { |
|
134 | 143 | $method = $this->declareGettersByKey($getters, $item['key'], $item['value']); |
135 | - if ($method !== null) { |
|
144 | + if ($method !== null) |
|
145 | + { |
|
136 | 146 | $getters[] = $method->getName(); |
137 | 147 | } |
138 | 148 | } |
@@ -141,30 +151,35 @@ discard block |
||
141 | 151 | private function declareGettersByKey(array $methodNames, string $key, array $value): ?Method |
142 | 152 | { |
143 | 153 | //Won't create if there's less than 2 sub-items |
144 | - if (\count($value) < 2) { |
|
154 | + if (\count($value) < 2) |
|
155 | + { |
|
145 | 156 | return null; |
146 | 157 | } |
147 | 158 | |
148 | 159 | $singularKey = $this->singularize($key); |
149 | 160 | $name = $this->makeGetterName($singularKey); |
150 | - if (\in_array($name, $methodNames, true)) { |
|
161 | + if (\in_array($name, $methodNames, true)) |
|
162 | + { |
|
151 | 163 | $name = $this->makeGetterName($singularKey, 'get', 'by'); |
152 | 164 | } |
153 | 165 | |
154 | 166 | //Name conflict, won't merge |
155 | - if (\in_array($name, $methodNames, true)) { |
|
167 | + if (\in_array($name, $methodNames, true)) |
|
168 | + { |
|
156 | 169 | return null; |
157 | 170 | } |
158 | 171 | |
159 | 172 | $keyType = defineArrayType(\array_keys($value), '-mixed-'); |
160 | 173 | $valueType = defineArrayType(\array_values($value), '-mixed-'); |
161 | 174 | //We need a fixed structure here |
162 | - if ($keyType === '-mixed-' || $valueType === '-mixed-') { |
|
175 | + if ($keyType === '-mixed-' || $valueType === '-mixed-') |
|
176 | + { |
|
163 | 177 | return null; |
164 | 178 | } |
165 | 179 | |
166 | 180 | //Won't create for associated arrays |
167 | - if ($this->typeAnnotations->mapType($keyType) === 'int' && \array_is_list($value)) { |
|
181 | + if ($this->typeAnnotations->mapType($keyType) === 'int' && \array_is_list($value)) |
|
182 | + { |
|
168 | 183 | return null; |
169 | 184 | } |
170 | 185 | |
@@ -174,7 +189,8 @@ discard block |
||
174 | 189 | |
175 | 190 | $param = $method->addParameter($singularKey); |
176 | 191 | $paramTypeHint = $this->typeHints->getHint($keyType); |
177 | - if ($paramTypeHint !== null) { |
|
192 | + if ($paramTypeHint !== null) |
|
193 | + { |
|
178 | 194 | $param->setType($paramTypeHint); |
179 | 195 | } |
180 | 196 | |
@@ -184,13 +200,15 @@ discard block |
||
184 | 200 | private function makeGetterName(string $name, string $prefix = 'get', string $postfix = ''): string |
185 | 201 | { |
186 | 202 | $chunks = []; |
187 | - if (!empty($prefix)) { |
|
203 | + if (!empty($prefix)) |
|
204 | + { |
|
188 | 205 | $chunks[] = $prefix; |
189 | 206 | } |
190 | 207 | |
191 | 208 | $name = $this->slugify->slugify($name, ['lowercase' => false]); |
192 | 209 | $chunks[] = \count($chunks) !== 0 ? $this->classify($name) : $name; |
193 | - if (!empty($postfix)) { |
|
210 | + if (!empty($postfix)) |
|
211 | + { |
|
194 | 212 | $chunks[] = \ucfirst($postfix); |
195 | 213 | } |
196 | 214 |
@@ -95,7 +95,7 @@ |
||
95 | 95 | $this->files->write( |
96 | 96 | $filename, |
97 | 97 | $file->render() . PHP_EOL . (new Dumper())->dump(new Literal('return [];')), |
98 | - FilesInterface::READONLY, |
|
98 | + FilesInterface::readonly, |
|
99 | 99 | true, |
100 | 100 | ); |
101 | 101 | } |
@@ -137,17 +137,17 @@ discard block |
||
137 | 137 | ]; |
138 | 138 | |
139 | 139 | $reflectionMethods = []; |
140 | - foreach ($reflection->getMethods() as $method) { |
|
141 | - if ($method->getDeclaringClass()->name !== $reflection->name) { |
|
140 | + foreach ($reflection->getMethods() as $method){ |
|
141 | + if ($method->getDeclaringClass()->name !== $reflection->name){ |
|
142 | 142 | continue; |
143 | 143 | } |
144 | 144 | |
145 | 145 | $reflectionMethods[$method->name] = $method; |
146 | 146 | $this->assertArrayHasKey($method->name, $methods); |
147 | 147 | |
148 | - if (!$method->hasReturnType()) { |
|
148 | + if (!$method->hasReturnType()){ |
|
149 | 149 | $this->assertNull($methods[$method->name]['hint']); |
150 | - } else { |
|
150 | + }else{ |
|
151 | 151 | $this->assertEquals($methods[$method->name]['hint'], $method->getReturnType()->getName()); |
152 | 152 | } |
153 | 153 | } |
@@ -189,8 +189,8 @@ discard block |
||
189 | 189 | ]; |
190 | 190 | |
191 | 191 | $reflectionMethods = []; |
192 | - foreach ($reflection->getMethods() as $method) { |
|
193 | - if ($method->getDeclaringClass()->name !== $reflection->name) { |
|
192 | + foreach ($reflection->getMethods() as $method){ |
|
193 | + if ($method->getDeclaringClass()->name !== $reflection->name){ |
|
194 | 194 | continue; |
195 | 195 | } |
196 | 196 | $reflectionMethods[$method->name] = $method; |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | |
263 | 263 | clearstatcache(); |
264 | 264 | |
265 | - $filename = $this->app->directory('config') . "$name.php"; |
|
265 | + $filename = $this->app->directory('config')."$name.php"; |
|
266 | 266 | $this->assertFileExists($filename); |
267 | 267 | |
268 | 268 | return $filename; |
@@ -137,17 +137,22 @@ discard block |
||
137 | 137 | ]; |
138 | 138 | |
139 | 139 | $reflectionMethods = []; |
140 | - foreach ($reflection->getMethods() as $method) { |
|
141 | - if ($method->getDeclaringClass()->name !== $reflection->name) { |
|
140 | + foreach ($reflection->getMethods() as $method) |
|
141 | + { |
|
142 | + if ($method->getDeclaringClass()->name !== $reflection->name) |
|
143 | + { |
|
142 | 144 | continue; |
143 | 145 | } |
144 | 146 | |
145 | 147 | $reflectionMethods[$method->name] = $method; |
146 | 148 | $this->assertArrayHasKey($method->name, $methods); |
147 | 149 | |
148 | - if (!$method->hasReturnType()) { |
|
150 | + if (!$method->hasReturnType()) |
|
151 | + { |
|
149 | 152 | $this->assertNull($methods[$method->name]['hint']); |
150 | - } else { |
|
153 | + } |
|
154 | + else |
|
155 | + { |
|
151 | 156 | $this->assertEquals($methods[$method->name]['hint'], $method->getReturnType()->getName()); |
152 | 157 | } |
153 | 158 | } |
@@ -189,8 +194,10 @@ discard block |
||
189 | 194 | ]; |
190 | 195 | |
191 | 196 | $reflectionMethods = []; |
192 | - foreach ($reflection->getMethods() as $method) { |
|
193 | - if ($method->getDeclaringClass()->name !== $reflection->name) { |
|
197 | + foreach ($reflection->getMethods() as $method) |
|
198 | + { |
|
199 | + if ($method->getDeclaringClass()->name !== $reflection->name) |
|
200 | + { |
|
194 | 201 | continue; |
195 | 202 | } |
196 | 203 | $reflectionMethods[$method->name] = $method; |
@@ -19,11 +19,11 @@ discard block |
||
19 | 19 | */ |
20 | 20 | protected function deleteDeclaration(string $class): void |
21 | 21 | { |
22 | - if (class_exists($class)) { |
|
23 | - try { |
|
22 | + if (class_exists($class)){ |
|
23 | + try{ |
|
24 | 24 | $reflection = new ReflectionClass($class); |
25 | 25 | $this->files()->delete($reflection->getFileName()); |
26 | - } catch (Throwable $exception) { |
|
26 | + }catch (Throwable $exception){ |
|
27 | 27 | var_dump($exception->getMessage()); |
28 | 28 | } |
29 | 29 | } |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | { |
52 | 52 | parent::tearDown(); |
53 | 53 | |
54 | - if ($this->className) { |
|
54 | + if ($this->className){ |
|
55 | 55 | $this->deleteDeclaration($this->className); |
56 | 56 | } |
57 | 57 | } |
@@ -19,11 +19,15 @@ discard block |
||
19 | 19 | */ |
20 | 20 | protected function deleteDeclaration(string $class): void |
21 | 21 | { |
22 | - if (class_exists($class)) { |
|
23 | - try { |
|
22 | + if (class_exists($class)) |
|
23 | + { |
|
24 | + try |
|
25 | + { |
|
24 | 26 | $reflection = new ReflectionClass($class); |
25 | 27 | $this->files()->delete($reflection->getFileName()); |
26 | - } catch (Throwable $exception) { |
|
28 | + } |
|
29 | + catch (Throwable $exception) |
|
30 | + { |
|
27 | 31 | var_dump($exception->getMessage()); |
28 | 32 | } |
29 | 33 | } |
@@ -51,7 +55,8 @@ discard block |
||
51 | 55 | { |
52 | 56 | parent::tearDown(); |
53 | 57 | |
54 | - if ($this->className) { |
|
58 | + if ($this->className) |
|
59 | + { |
|
55 | 60 | $this->deleteDeclaration($this->className); |
56 | 61 | } |
57 | 62 | } |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | public function __construct( |
27 | 27 | private readonly ConfiguratorInterface $config, |
28 | 28 | private readonly KernelInterface $kernel, |
29 | - ) { |
|
29 | + ){ |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | public function init(ConsoleBootloader $console): void |
@@ -39,9 +39,9 @@ discard block |
||
39 | 39 | $console->addCommand(Command\MiddlewareCommand::class); |
40 | 40 | $console->addCommand(Command\FilterCommand::class); |
41 | 41 | |
42 | - try { |
|
42 | + try{ |
|
43 | 43 | $defaultNamespace = (new ReflectionClass($this->kernel))->getNamespaceName(); |
44 | - } catch (ReflectionException) { |
|
44 | + }catch (ReflectionException){ |
|
45 | 45 | $defaultNamespace = ''; |
46 | 46 | } |
47 | 47 | |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | * Base directory for generated classes, class will be automatically localed into sub directory |
57 | 57 | * using given namespace. |
58 | 58 | */ |
59 | - 'directory' => directory('app') . 'src/', |
|
59 | + 'directory' => directory('app').'src/', |
|
60 | 60 | |
61 | 61 | /* |
62 | 62 | * Default namespace to be applied for every generated class. By default uses Kernel namespace |
@@ -39,9 +39,12 @@ |
||
39 | 39 | $console->addCommand(Command\MiddlewareCommand::class); |
40 | 40 | $console->addCommand(Command\FilterCommand::class); |
41 | 41 | |
42 | - try { |
|
42 | + try |
|
43 | + { |
|
43 | 44 | $defaultNamespace = (new ReflectionClass($this->kernel))->getNamespaceName(); |
44 | - } catch (ReflectionException) { |
|
45 | + } |
|
46 | + catch (ReflectionException) |
|
47 | + { |
|
45 | 48 | $defaultNamespace = ''; |
46 | 49 | } |
47 | 50 |
@@ -33,11 +33,11 @@ |
||
33 | 33 | { |
34 | 34 | $declaration = $this->createDeclaration(ControllerDeclaration::class); |
35 | 35 | |
36 | - foreach ($this->actions as $action) { |
|
36 | + foreach ($this->actions as $action){ |
|
37 | 37 | $declaration->addAction($action); |
38 | 38 | } |
39 | 39 | |
40 | - if ($this->usePrototype) { |
|
40 | + if ($this->usePrototype){ |
|
41 | 41 | $declaration->addPrototypeTrait(); |
42 | 42 | } |
43 | 43 |
@@ -33,11 +33,13 @@ |
||
33 | 33 | { |
34 | 34 | $declaration = $this->createDeclaration(ControllerDeclaration::class); |
35 | 35 | |
36 | - foreach ($this->actions as $action) { |
|
36 | + foreach ($this->actions as $action) |
|
37 | + { |
|
37 | 38 | $declaration->addAction($action); |
38 | 39 | } |
39 | 40 | |
40 | - if ($this->usePrototype) { |
|
41 | + if ($this->usePrototype) |
|
42 | + { |
|
41 | 43 | $declaration->addPrototypeTrait(); |
42 | 44 | } |
43 | 45 |