@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | $entryManager = $container->get('entryManager'); |
| 45 | 45 | $this->assertSame(0, $entryManager->countAll()); |
| 46 | 46 | |
| 47 | - $entry = $entryManager->create(['name' => 'foo', 'slug' => 'foo']); |
|
| 47 | + $entry = $entryManager->create([ 'name' => 'foo', 'slug' => 'foo' ]); |
|
| 48 | 48 | |
| 49 | 49 | $request = (new ServerRequestFactory) |
| 50 | 50 | ->createServerRequest('PATCH', '/api/v1/entry/' . $entry->getId()->toString()) |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | $entryManager = $container->get('entryManager'); |
| 117 | 117 | $this->assertSame(0, $entryManager->countAll()); |
| 118 | 118 | |
| 119 | - $entry = $entryManager->create(['name' => 'foo', 'slug' => 'foo']); |
|
| 119 | + $entry = $entryManager->create([ 'name' => 'foo', 'slug' => 'foo' ]); |
|
| 120 | 120 | |
| 121 | 121 | $request = (new ServerRequestFactory) |
| 122 | 122 | ->createServerRequest('PATCH', '/api/v1/entry/' . $entry->getId()->toString()) |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | $entryManager = $container->get('entryManager'); |
| 151 | 151 | $this->assertSame(0, $entryManager->countAll()); |
| 152 | 152 | |
| 153 | - $entry = $entryManager->create(['name' => 'foo', 'slug' => 'foo']); |
|
| 153 | + $entry = $entryManager->create([ 'name' => 'foo', 'slug' => 'foo' ]); |
|
| 154 | 154 | |
| 155 | 155 | $request = (new ServerRequestFactory) |
| 156 | 156 | ->createServerRequest('PATCH', '/api/v1/entry/' . $entry->getId()->toString()) |
@@ -184,8 +184,8 @@ discard block |
||
| 184 | 184 | $entryManager = $container->get('entryManager'); |
| 185 | 185 | $this->assertSame(0, $entryManager->countAll()); |
| 186 | 186 | |
| 187 | - $entry = $entryManager->create(['name' => 'foo', 'slug' => 'foo']); |
|
| 188 | - $entryManager->create(['name' => 'bar', 'slug' => 'bar']); |
|
| 187 | + $entry = $entryManager->create([ 'name' => 'foo', 'slug' => 'foo' ]); |
|
| 188 | + $entryManager->create([ 'name' => 'bar', 'slug' => 'bar' ]); |
|
| 189 | 189 | |
| 190 | 190 | $request = (new ServerRequestFactory) |
| 191 | 191 | ->createServerRequest('PATCH', '/api/v1/entry/' . $entry->getId()->toString()) |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | ->createServerRequest('PATCH', '/api/v1/entry/e3f4f8bd-d455-4e67-86d5-ab6c9683bdd7') |
| 217 | 217 | ->withAttribute('entryId', 'e3f4f8bd-d455-4e67-86d5-ab6c9683bdd7') |
| 218 | 218 | ->withHeader('Content-Type', 'application/json') |
| 219 | - ->withParsedBody([null]); |
|
| 219 | + ->withParsedBody([ null ]); |
|
| 220 | 220 | |
| 221 | 221 | $this->expectException(BadRequestException::class); |
| 222 | 222 | |
@@ -42,8 +42,8 @@ discard block |
||
| 42 | 42 | $entryManager = $container->get('entryManager'); |
| 43 | 43 | $this->assertSame(0, $entryManager->countAll()); |
| 44 | 44 | |
| 45 | - $entryManager->create(['name' => 'foo', 'slug' => 'foo']); |
|
| 46 | - $entryManager->create(['name' => 'bar', 'slug' => 'bar']); |
|
| 45 | + $entryManager->create([ 'name' => 'foo', 'slug' => 'foo' ]); |
|
| 46 | + $entryManager->create([ 'name' => 'bar', 'slug' => 'bar' ]); |
|
| 47 | 47 | |
| 48 | 48 | $request = (new ServerRequestFactory) |
| 49 | 49 | ->createServerRequest('GET', '/api/v1/entry'); |
@@ -116,11 +116,11 @@ discard block |
||
| 116 | 116 | public function invalidLimitProvider() : array |
| 117 | 117 | { |
| 118 | 118 | return [ |
| 119 | - [null], |
|
| 120 | - [[]], |
|
| 121 | - ['-1'], |
|
| 122 | - ['0'], |
|
| 123 | - ['foo'], |
|
| 119 | + [ null ], |
|
| 120 | + [ [ ] ], |
|
| 121 | + [ '-1' ], |
|
| 122 | + [ '0' ], |
|
| 123 | + [ 'foo' ], |
|
| 124 | 124 | ]; |
| 125 | 125 | } |
| 126 | 126 | |
@@ -156,10 +156,10 @@ discard block |
||
| 156 | 156 | public function invalidOffsetProvider() : array |
| 157 | 157 | { |
| 158 | 158 | return [ |
| 159 | - [null], |
|
| 160 | - [[]], |
|
| 161 | - ['-1'], |
|
| 162 | - ['foo'], |
|
| 159 | + [ null ], |
|
| 160 | + [ [ ] ], |
|
| 161 | + [ '-1' ], |
|
| 162 | + [ 'foo' ], |
|
| 163 | 163 | ]; |
| 164 | 164 | } |
| 165 | 165 | } |
@@ -59,8 +59,8 @@ discard block |
||
| 59 | 59 | $this->assertSame(1, $entryManager->countAll()); |
| 60 | 60 | |
| 61 | 61 | $entries = $entryManager->getList(null, null); |
| 62 | - $this->assertSame('foo', $entries[0]->getName()); |
|
| 63 | - $this->assertSame('bar', $entries[0]->getSlug()); |
|
| 62 | + $this->assertSame('foo', $entries[ 0 ]->getName()); |
|
| 63 | + $this->assertSame('bar', $entries[ 0 ]->getSlug()); |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | /** |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | $this->assertSame(0, $entryManager->countAll()); |
| 143 | 143 | |
| 144 | 144 | // reserving the `foo` slug... |
| 145 | - $entryManager->create(['name' => 'foo', 'slug' => 'foo']); |
|
| 145 | + $entryManager->create([ 'name' => 'foo', 'slug' => 'foo' ]); |
|
| 146 | 146 | |
| 147 | 147 | $request = (new ServerRequestFactory) |
| 148 | 148 | ->createServerRequest('POST', '/api/v1/entry') |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | $request = (new ServerRequestFactory) |
| 172 | 172 | ->createServerRequest('POST', '/api/v1/entry') |
| 173 | 173 | ->withHeader('Content-Type', 'application/json') |
| 174 | - ->withParsedBody([null]); |
|
| 174 | + ->withParsedBody([ null ]); |
|
| 175 | 175 | |
| 176 | 176 | $this->expectException(BadRequestException::class); |
| 177 | 177 | |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | $entryManager = $container->get('entryManager'); |
| 41 | 41 | $this->assertSame(0, $entryManager->countAll()); |
| 42 | 42 | |
| 43 | - $entry = $entryManager->create(['name' => 'foo', 'slug' => 'foo']); |
|
| 43 | + $entry = $entryManager->create([ 'name' => 'foo', 'slug' => 'foo' ]); |
|
| 44 | 44 | $this->assertSame(1, $entryManager->countAll()); |
| 45 | 45 | |
| 46 | 46 | $request = (new ServerRequestFactory) |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | $entryManager = $container->get('entryManager'); |
| 43 | 43 | $this->assertSame(0, $entryManager->countAll()); |
| 44 | 44 | |
| 45 | - $entry = $entryManager->create(['name' => 'foo', 'slug' => 'foo']); |
|
| 45 | + $entry = $entryManager->create([ 'name' => 'foo', 'slug' => 'foo' ]); |
|
| 46 | 46 | |
| 47 | 47 | $request = (new ServerRequestFactory) |
| 48 | 48 | ->createServerRequest('GET', '/api/v1/entry/' . $entry->getId()->toString()) |
@@ -83,12 +83,12 @@ |
||
| 83 | 83 | $limit = 10; |
| 84 | 84 | $offset = 0; |
| 85 | 85 | |
| 86 | - if (isset($q['limit'])) { |
|
| 87 | - $limit = (int) $q['limit']; |
|
| 86 | + if (isset($q[ 'limit' ])) { |
|
| 87 | + $limit = (int) $q[ 'limit' ]; |
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | - if (isset($q['offset'])) { |
|
| 91 | - $offset = (int) $q['offset']; |
|
| 90 | + if (isset($q[ 'offset' ])) { |
|
| 91 | + $offset = (int) $q[ 'offset' ]; |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | $entries = $this->container->get('entryManager')->getList($limit, $offset); |
@@ -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 | } |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | */ |
| 43 | 43 | protected function execute(InputInterface $input, OutputInterface $output) : int |
| 44 | 44 | { |
| 45 | - $flags = JSON_UNESCAPED_SLASHES|JSON_UNESCAPED_UNICODE; |
|
| 45 | + $flags = JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE; |
|
| 46 | 46 | |
| 47 | 47 | $output->writeln(json_encode($this->container->get('openapi')->toArray(), $flags)); |
| 48 | 48 | |
@@ -3,8 +3,8 @@ |
||
| 3 | 3 | use DI\Container; |
| 4 | 4 | use DI\ContainerBuilder; |
| 5 | 5 | |
| 6 | -return (function () : Container { |
|
| 7 | - $env = $_ENV['APP_ENV'] ?? 'dev'; |
|
| 6 | +return (function() : Container { |
|
| 7 | + $env = $_ENV[ 'APP_ENV' ] ?? 'dev'; |
|
| 8 | 8 | |
| 9 | 9 | $builder = new ContainerBuilder(); |
| 10 | 10 | $builder->useAutowiring(true); |