@@ -142,7 +142,7 @@ |
||
142 | 142 | |
143 | 143 | return $this->error( |
144 | 144 | $e->getMessage(), |
145 | - $e->getFile() .':'. $e->getLine(), |
|
145 | + $e->getFile() . ':' . $e->getLine(), |
|
146 | 146 | $e->getCode(), |
147 | 147 | 500 |
148 | 148 | ); |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | return [ |
14 | 14 | 'doctrine' => autowire(ManagerRegistry::class), |
15 | 15 | |
16 | - 'doctrine.types' => [], |
|
16 | + 'doctrine.types' => [ ], |
|
17 | 17 | |
18 | 18 | 'doctrine.configuration' => [ |
19 | 19 | 'master' => [ |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | ], |
41 | 41 | ], |
42 | 42 | |
43 | - 'doctrine.configuration.master.connection' => ['url' => env('DB_MASTER_URL')], |
|
43 | + 'doctrine.configuration.master.connection' => [ 'url' => env('DB_MASTER_URL') ], |
|
44 | 44 | 'doctrine.configuration.master.metadata_sources' => get('doctrine.configuration.default.metadata_sources'), |
45 | 45 | 'doctrine.configuration.master.metadata_cache' => get('doctrine.configuration.default.metadata_cache'), |
46 | 46 | 'doctrine.configuration.master.query_cache' => get('doctrine.configuration.default.query_cache'), |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | 'doctrine.configuration.master.proxy_auto_generate' => get('doctrine.configuration.default.proxy_auto_generate'), |
51 | 51 | 'doctrine.configuration.master.sql_logger' => get('doctrine.configuration.default.sql_logger'), |
52 | 52 | |
53 | - 'doctrine.configuration.slave.connection' => ['url' => env('DB_SLAVE_URL')], |
|
53 | + 'doctrine.configuration.slave.connection' => [ 'url' => env('DB_SLAVE_URL') ], |
|
54 | 54 | 'doctrine.configuration.slave.metadata_sources' => get('doctrine.configuration.default.metadata_sources'), |
55 | 55 | 'doctrine.configuration.slave.metadata_cache' => get('doctrine.configuration.default.metadata_cache'), |
56 | 56 | 'doctrine.configuration.slave.query_cache' => get('doctrine.configuration.default.query_cache'), |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | 'doctrine.configuration.slave.proxy_auto_generate' => get('doctrine.configuration.default.proxy_auto_generate'), |
61 | 61 | 'doctrine.configuration.slave.sql_logger' => get('doctrine.configuration.default.sql_logger'), |
62 | 62 | |
63 | - 'doctrine.configuration.default.metadata_sources' => [string('{app.root}/src/Entity')], |
|
63 | + 'doctrine.configuration.default.metadata_sources' => [ string('{app.root}/src/Entity') ], |
|
64 | 64 | 'doctrine.configuration.default.metadata_cache' => get('doctrine.configuration.default.default_cache'), |
65 | 65 | 'doctrine.configuration.default.query_cache' => get('doctrine.configuration.default.default_cache'), |
66 | 66 | 'doctrine.configuration.default.result_cache' => get('doctrine.configuration.default.default_cache'), |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | 'doctrine.configuration.default.proxy_auto_generate' => true, |
71 | 71 | 'doctrine.configuration.default.sql_logger' => null, |
72 | 72 | |
73 | - 'commands' => decorate(function ($previous, $container) { |
|
73 | + 'commands' => decorate(function($previous, $container) { |
|
74 | 74 | // Proxy Commands for the Doctrine Library... |
75 | 75 | $additional = $container->get('doctrine')->getCommands(); |
76 | 76 |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | use function DI\string; |
10 | 10 | |
11 | 11 | return [ |
12 | - 'router' => factory(function ($container) { |
|
12 | + 'router' => factory(function($container) { |
|
13 | 13 | $loader = new DescriptorDirectoryLoader(); |
14 | 14 | $loader->setContainer($container); |
15 | 15 | $loader->setCache($container->get('router.configuration.metadata_cache')); |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | return $router; |
22 | 22 | }), |
23 | 23 | |
24 | - 'router.configuration.metadata_cache' => factory(function () { |
|
24 | + 'router.configuration.metadata_cache' => factory(function() { |
|
25 | 25 | return new Cache(new ArrayAdapter()); |
26 | 26 | }), |
27 | 27 |
@@ -7,7 +7,7 @@ |
||
7 | 7 | use function DI\factory; |
8 | 8 | |
9 | 9 | return [ |
10 | - 'validator' => factory(function ($container) : ValidatorInterface { |
|
10 | + 'validator' => factory(function($container) : ValidatorInterface { |
|
11 | 11 | return Validation::createValidatorBuilder() |
12 | 12 | ->enableAnnotationMapping(true) |
13 | 13 | ->addDefaultDoctrineAnnotationReader() |
@@ -66,7 +66,7 @@ |
||
66 | 66 | ->getRepository(Entry::class) |
67 | 67 | ->find($id); |
68 | 68 | |
69 | - if (! ($entry instanceof Entry)) { |
|
69 | + if (!($entry instanceof Entry)) { |
|
70 | 70 | throw new EntityNotFoundException(); |
71 | 71 | } |
72 | 72 |
@@ -66,23 +66,23 @@ |
||
66 | 66 | $user = trim(`id -u -n`); |
67 | 67 | $group = trim(`id -g -n`); |
68 | 68 | $questioner = $this->getHelper('question'); |
69 | - $replacements = []; |
|
69 | + $replacements = [ ]; |
|
70 | 70 | |
71 | 71 | $format = 'RR path [<fg=yellow>%s</>]: '; |
72 | 72 | $question = new Question(sprintf($format, $rr), $rr); |
73 | - $replacements['{rr}'] = $questioner->ask($input, $output, $question); |
|
73 | + $replacements[ '{rr}' ] = $questioner->ask($input, $output, $question); |
|
74 | 74 | |
75 | 75 | $format = 'App root [<fg=yellow>%s</>]: '; |
76 | 76 | $question = new Question(sprintf($format, $cwd), $cwd); |
77 | - $replacements['{cwd}'] = $questioner->ask($input, $output, $question); |
|
77 | + $replacements[ '{cwd}' ] = $questioner->ask($input, $output, $question); |
|
78 | 78 | |
79 | 79 | $format = 'User name [<fg=yellow>%s</>]: '; |
80 | 80 | $question = new Question(sprintf($format, $user), $user); |
81 | - $replacements['{user}'] = $questioner->ask($input, $output, $question); |
|
81 | + $replacements[ '{user}' ] = $questioner->ask($input, $output, $question); |
|
82 | 82 | |
83 | 83 | $format = 'Group name [<fg=yellow>%s</>]: '; |
84 | 84 | $question = new Question(sprintf($format, $group), $group); |
85 | - $replacements['{group}'] = $questioner->ask($input, $output, $question); |
|
85 | + $replacements[ '{group}' ] = $questioner->ask($input, $output, $question); |
|
86 | 86 | |
87 | 87 | $output->writeln(strtr(static::TEMPLATE, $replacements)); |
88 | 88 |
@@ -77,9 +77,9 @@ |
||
77 | 77 | */ |
78 | 78 | public function serializeList(Entry ...$entries) : array |
79 | 79 | { |
80 | - $result = []; |
|
80 | + $result = [ ]; |
|
81 | 81 | foreach ($entries as $entry) { |
82 | - $result[] = $this->serialize($entry); |
|
82 | + $result[ ] = $this->serialize($entry); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | return $result; |
@@ -35,10 +35,10 @@ discard block |
||
35 | 35 | $entryManager = $container->get('entryManager'); |
36 | 36 | $this->assertSame(0, $entryManager->countAll()); |
37 | 37 | |
38 | - $entryManager->create(['name' => 'foo', 'slug' => 'foo']); |
|
38 | + $entryManager->create([ 'name' => 'foo', 'slug' => 'foo' ]); |
|
39 | 39 | $this->assertSame(1, $entryManager->countAll()); |
40 | 40 | |
41 | - $entryManager->create(['name' => 'bar', 'slug' => 'bar']); |
|
41 | + $entryManager->create([ 'name' => 'bar', 'slug' => 'bar' ]); |
|
42 | 42 | $this->assertSame(2, $entryManager->countAll()); |
43 | 43 | } |
44 | 44 | |
@@ -60,26 +60,26 @@ discard block |
||
60 | 60 | $this->assertSame(0, $entryManager->countAll()); |
61 | 61 | |
62 | 62 | $entries = $entryManager->getList(null, null); |
63 | - $this->assertSame([], $entries); |
|
63 | + $this->assertSame([ ], $entries); |
|
64 | 64 | |
65 | - $foo = $entryManager->create(['name' => 'foo', 'slug' => 'foo']); |
|
65 | + $foo = $entryManager->create([ 'name' => 'foo', 'slug' => 'foo' ]); |
|
66 | 66 | $entries = $entryManager->getList(null, null); |
67 | 67 | $this->assertCount(1, $entries); |
68 | - $this->assertSame($foo->getId()->toString(), (string) $entries[0]->getId()); |
|
68 | + $this->assertSame($foo->getId()->toString(), (string) $entries[ 0 ]->getId()); |
|
69 | 69 | |
70 | - $bar = $entryManager->create(['name' => 'bar', 'slug' => 'bar']); |
|
70 | + $bar = $entryManager->create([ 'name' => 'bar', 'slug' => 'bar' ]); |
|
71 | 71 | $entries = $entryManager->getList(null, null); |
72 | 72 | $this->assertCount(2, $entries); |
73 | - $this->assertSame($bar->getId()->toString(), (string) $entries[0]->getId()); |
|
74 | - $this->assertSame($foo->getId()->toString(), (string) $entries[1]->getId()); |
|
73 | + $this->assertSame($bar->getId()->toString(), (string) $entries[ 0 ]->getId()); |
|
74 | + $this->assertSame($foo->getId()->toString(), (string) $entries[ 1 ]->getId()); |
|
75 | 75 | |
76 | 76 | $entries = $entryManager->getList(1, null); |
77 | 77 | $this->assertCount(1, $entries); |
78 | - $this->assertSame($bar->getId()->toString(), (string) $entries[0]->getId()); |
|
78 | + $this->assertSame($bar->getId()->toString(), (string) $entries[ 0 ]->getId()); |
|
79 | 79 | |
80 | 80 | $entries = $entryManager->getList(null, 1); |
81 | 81 | $this->assertCount(1, $entries); |
82 | - $this->assertSame($foo->getId()->toString(), (string) $entries[0]->getId()); |
|
82 | + $this->assertSame($foo->getId()->toString(), (string) $entries[ 0 ]->getId()); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | /** |
@@ -99,8 +99,8 @@ discard block |
||
99 | 99 | // the database MUST be empty... |
100 | 100 | $this->assertSame(0, $entryManager->countAll()); |
101 | 101 | |
102 | - $foo = $entryManager->create(['name' => 'foo', 'slug' => 'foo']); |
|
103 | - $bar = $entryManager->create(['name' => 'bar', 'slug' => 'bar']); |
|
102 | + $foo = $entryManager->create([ 'name' => 'foo', 'slug' => 'foo' ]); |
|
103 | + $bar = $entryManager->create([ 'name' => 'bar', 'slug' => 'bar' ]); |
|
104 | 104 | |
105 | 105 | $found = $entryManager->findById($foo->getId()->toString()); |
106 | 106 | $this->assertSame($foo->getId()->toString(), (string) $found->getId()); |
@@ -129,12 +129,12 @@ discard block |
||
129 | 129 | // the database MUST be empty... |
130 | 130 | $this->assertSame(0, $entryManager->countAll()); |
131 | 131 | |
132 | - $foo = $entryManager->create(['name' => 'foo', 'slug' => 'foo']); |
|
132 | + $foo = $entryManager->create([ 'name' => 'foo', 'slug' => 'foo' ]); |
|
133 | 133 | $found = $entryManager->findById($foo->getId()->toString()); |
134 | 134 | $this->assertSame('foo', $found->getName()); |
135 | 135 | $this->assertSame('foo', $found->getSlug()); |
136 | 136 | |
137 | - $bar = $entryManager->create(['name' => 'bar', 'slug' => 'bar']); |
|
137 | + $bar = $entryManager->create([ 'name' => 'bar', 'slug' => 'bar' ]); |
|
138 | 138 | $found = $entryManager->findById($bar->getId()->toString()); |
139 | 139 | $this->assertSame('bar', $found->getName()); |
140 | 140 | $this->assertSame('bar', $found->getSlug()); |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | $this->assertSame(0, $entryManager->countAll()); |
159 | 159 | |
160 | 160 | $this->expectException(InvalidEntityException::class); |
161 | - $entryManager->create(['name' => '', 'slug' => 'foo']); |
|
161 | + $entryManager->create([ 'name' => '', 'slug' => 'foo' ]); |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | /** |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | $this->assertSame(0, $entryManager->countAll()); |
180 | 180 | |
181 | 181 | $this->expectException(InvalidEntityException::class); |
182 | - $entryManager->create(['name' => 'foo', 'slug' => '']); |
|
182 | + $entryManager->create([ 'name' => 'foo', 'slug' => '' ]); |
|
183 | 183 | } |
184 | 184 | |
185 | 185 | /** |
@@ -199,10 +199,10 @@ discard block |
||
199 | 199 | // the database MUST be empty... |
200 | 200 | $this->assertSame(0, $entryManager->countAll()); |
201 | 201 | |
202 | - $entryManager->create(['name' => 'foo', 'slug' => 'foo']); |
|
202 | + $entryManager->create([ 'name' => 'foo', 'slug' => 'foo' ]); |
|
203 | 203 | |
204 | 204 | $this->expectException(InvalidEntityException::class); |
205 | - $entryManager->create(['name' => 'bar', 'slug' => 'foo']); |
|
205 | + $entryManager->create([ 'name' => 'bar', 'slug' => 'foo' ]); |
|
206 | 206 | } |
207 | 207 | |
208 | 208 | /** |
@@ -222,8 +222,8 @@ discard block |
||
222 | 222 | // the database MUST be empty... |
223 | 223 | $this->assertSame(0, $entryManager->countAll()); |
224 | 224 | |
225 | - $foo = $entryManager->create(['name' => 'foo', 'slug' => 'foo']); |
|
226 | - $entryManager->update($foo, ['name' => 'bar', 'slug' => 'bar']); |
|
225 | + $foo = $entryManager->create([ 'name' => 'foo', 'slug' => 'foo' ]); |
|
226 | + $entryManager->update($foo, [ 'name' => 'bar', 'slug' => 'bar' ]); |
|
227 | 227 | $found = $entryManager->findById($foo->getId()->toString()); |
228 | 228 | |
229 | 229 | $this->assertSame('bar', $found->getName()); |
@@ -247,10 +247,10 @@ discard block |
||
247 | 247 | // the database MUST be empty... |
248 | 248 | $this->assertSame(0, $entryManager->countAll()); |
249 | 249 | |
250 | - $foo = $entryManager->create(['name' => 'foo', 'slug' => 'foo']); |
|
250 | + $foo = $entryManager->create([ 'name' => 'foo', 'slug' => 'foo' ]); |
|
251 | 251 | |
252 | 252 | $this->expectException(InvalidEntityException::class); |
253 | - $entryManager->update($foo, ['name' => '', 'slug' => 'bar']); |
|
253 | + $entryManager->update($foo, [ 'name' => '', 'slug' => 'bar' ]); |
|
254 | 254 | } |
255 | 255 | |
256 | 256 | /** |
@@ -270,10 +270,10 @@ discard block |
||
270 | 270 | // the database MUST be empty... |
271 | 271 | $this->assertSame(0, $entryManager->countAll()); |
272 | 272 | |
273 | - $foo = $entryManager->create(['name' => 'foo', 'slug' => 'foo']); |
|
273 | + $foo = $entryManager->create([ 'name' => 'foo', 'slug' => 'foo' ]); |
|
274 | 274 | |
275 | 275 | $this->expectException(InvalidEntityException::class); |
276 | - $entryManager->update($foo, ['name' => 'bar', 'slug' => '']); |
|
276 | + $entryManager->update($foo, [ 'name' => 'bar', 'slug' => '' ]); |
|
277 | 277 | } |
278 | 278 | |
279 | 279 | /** |
@@ -293,11 +293,11 @@ discard block |
||
293 | 293 | // the database MUST be empty... |
294 | 294 | $this->assertSame(0, $entryManager->countAll()); |
295 | 295 | |
296 | - $foo = $entryManager->create(['name' => 'foo', 'slug' => 'foo']); |
|
297 | - $bar = $entryManager->create(['name' => 'bar', 'slug' => 'bar']); |
|
296 | + $foo = $entryManager->create([ 'name' => 'foo', 'slug' => 'foo' ]); |
|
297 | + $bar = $entryManager->create([ 'name' => 'bar', 'slug' => 'bar' ]); |
|
298 | 298 | |
299 | 299 | $this->expectException(InvalidEntityException::class); |
300 | - $entryManager->update($foo, ['name' => 'baz', 'slug' => 'bar']); |
|
300 | + $entryManager->update($foo, [ 'name' => 'baz', 'slug' => 'bar' ]); |
|
301 | 301 | } |
302 | 302 | |
303 | 303 | /** |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | // the database MUST be empty... |
318 | 318 | $this->assertSame(0, $entryManager->countAll()); |
319 | 319 | |
320 | - $foo = $entryManager->create(['name' => 'foo', 'slug' => 'foo']); |
|
320 | + $foo = $entryManager->create([ 'name' => 'foo', 'slug' => 'foo' ]); |
|
321 | 321 | $entryManager->delete($foo); |
322 | 322 | |
323 | 323 | $this->expectException(EntityNotFoundException::class); |
@@ -84,6 +84,6 @@ |
||
84 | 84 | { |
85 | 85 | $entry = $this->container->get('entryManager')->create($request->getParsedBody()); |
86 | 86 | |
87 | - return $this->ok($this->container->get('entrySerializer')->serialize($entry), [], 201); |
|
87 | + return $this->ok($this->container->get('entrySerializer')->serialize($entry), [ ], 201); |
|
88 | 88 | } |
89 | 89 | } |