@@ -7,7 +7,7 @@ discard block |
||
| 7 | 7 | use function DI\string; |
| 8 | 8 | |
| 9 | 9 | return [ |
| 10 | - 'router' => factory([RouterFactory::class, 'createRouter']) |
|
| 10 | + 'router' => factory([ RouterFactory::class, 'createRouter' ]) |
|
| 11 | 11 | ->parameter('params', get('router.configuration')), |
| 12 | 12 | |
| 13 | 13 | 'router.configuration' => [ |
@@ -24,5 +24,5 @@ discard block |
||
| 24 | 24 | |
| 25 | 25 | 'router.configuration.metadata.cache' => null, |
| 26 | 26 | |
| 27 | - 'router.configuration.middlewares' => [], |
|
| 27 | + 'router.configuration.middlewares' => [ ], |
|
| 28 | 28 | ]; |
@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | use function DI\get; |
| 9 | 9 | |
| 10 | 10 | return [ |
| 11 | - 'logger' => factory([MonologFactory::class, 'createLogger']) |
|
| 11 | + 'logger' => factory([ MonologFactory::class, 'createLogger' ]) |
|
| 12 | 12 | ->parameter('params', get('monolog.configuration')), |
| 13 | 13 | |
| 14 | 14 | 'monolog.configuration' => [ |
@@ -23,5 +23,5 @@ discard block |
||
| 23 | 23 | create(ErrorLogHandler::class), |
| 24 | 24 | ], |
| 25 | 25 | |
| 26 | - 'monolog.configuration.processors' => [], |
|
| 26 | + 'monolog.configuration.processors' => [ ], |
|
| 27 | 27 | ]; |
@@ -9,7 +9,7 @@ |
||
| 9 | 9 | use function DI\string; |
| 10 | 10 | |
| 11 | 11 | return [ |
| 12 | - 'entityManager' => factory([DoctrineFactory::class, 'createEntityManager']) |
|
| 12 | + 'entityManager' => factory([ DoctrineFactory::class, 'createEntityManager' ]) |
|
| 13 | 13 | ->parameter('params', get('doctrine.configuration')), |
| 14 | 14 | |
| 15 | 15 | 'doctrine.configuration' => [ |
@@ -7,7 +7,7 @@ |
||
| 7 | 7 | use function DI\string; |
| 8 | 8 | |
| 9 | 9 | return [ |
| 10 | - 'twig' => factory([TwigFactory::class, 'createEnvironment']) |
|
| 10 | + 'twig' => factory([ TwigFactory::class, 'createEnvironment' ]) |
|
| 11 | 11 | ->parameter('params', get('twig.configuration')), |
| 12 | 12 | |
| 13 | 13 | 'twig.configuration' => [ |
@@ -6,8 +6,8 @@ |
||
| 6 | 6 | use function DI\get; |
| 7 | 7 | |
| 8 | 8 | return [ |
| 9 | - 'openapi' => factory([OpenApiFactory::class, 'createOpenApi']) |
|
| 9 | + 'openapi' => factory([ OpenApiFactory::class, 'createOpenApi' ]) |
|
| 10 | 10 | ->parameter('params', get('openapi.configuration')), |
| 11 | 11 | |
| 12 | - 'openapi.configuration' => [], |
|
| 12 | + 'openapi.configuration' => [ ], |
|
| 13 | 13 | ]; |
@@ -2,7 +2,7 @@ |
||
| 2 | 2 | |
| 3 | 3 | error_reporting(E_ALL ^ E_DEPRECATED ^ E_USER_DEPRECATED); |
| 4 | 4 | |
| 5 | -set_error_handler(function ($severity, $message, $file, $line) { |
|
| 5 | +set_error_handler(function($severity, $message, $file, $line) { |
|
| 6 | 6 | if ($severity & error_reporting()) { |
| 7 | 7 | throw new ErrorException($message, 0, $severity, $file, $line); |
| 8 | 8 | } |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | $manager = $this->container->get('entityManager'); |
| 41 | 41 | |
| 42 | 42 | $entry = new Entry(); |
| 43 | - $entry->setName($data['name']); |
|
| 43 | + $entry->setName($data[ 'name' ]); |
|
| 44 | 44 | |
| 45 | 45 | $manager->persist($entry); |
| 46 | 46 | $manager->flush(); |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | |
| 60 | 60 | foreach ($variety as $data) { |
| 61 | 61 | $entry = new Entry(); |
| 62 | - $entry->setName($data['name']); |
|
| 62 | + $entry->setName($data[ 'name' ]); |
|
| 63 | 63 | |
| 64 | 64 | $manager->persist($entry); |
| 65 | 65 | } |
@@ -89,8 +89,8 @@ discard block |
||
| 89 | 89 | return; |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | - if (isset($data['name'])) { |
|
| 93 | - $entry->setName($data['name']); |
|
| 92 | + if (isset($data[ 'name' ])) { |
|
| 93 | + $entry->setName($data[ 'name' ]); |
|
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | $manager->flush(); |
@@ -190,14 +190,14 @@ discard block |
||
| 190 | 190 | $manager = $this->container->get('entityManager'); |
| 191 | 191 | $repository = $manager->getRepository(Entry::class); |
| 192 | 192 | |
| 193 | - $result = []; |
|
| 193 | + $result = [ ]; |
|
| 194 | 194 | foreach ($repository->getAll() as $entry) { |
| 195 | 195 | $item = [ |
| 196 | 196 | 'id' => $entry->getId(), |
| 197 | 197 | 'name' => $entry->getName(), |
| 198 | 198 | ]; |
| 199 | 199 | |
| 200 | - $result[] = $item; |
|
| 200 | + $result[ ] = $item; |
|
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | return $result; |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | */ |
| 107 | 107 | public function emptyOk(int $status = 200) : ResponseInterface |
| 108 | 108 | { |
| 109 | - return $this->ok([], $status); |
|
| 109 | + return $this->ok([ ], $status); |
|
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | /** |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | * |
| 166 | 166 | * @return ResponseInterface |
| 167 | 167 | */ |
| 168 | - public function error(string $message, array $errors = [], int $status = 500) : ResponseInterface |
|
| 168 | + public function error(string $message, array $errors = [ ], int $status = 500) : ResponseInterface |
|
| 169 | 169 | { |
| 170 | 170 | return $this->json([ |
| 171 | 171 | 'status' => 'error', |
@@ -69,7 +69,7 @@ |
||
| 69 | 69 | $service = $this->container->get('service.entry'); |
| 70 | 70 | |
| 71 | 71 | if (!$service->existsById($id)) { |
| 72 | - return (new ResponseFactory)->error('The requested entry was not found.', [], 404); |
|
| 72 | + return (new ResponseFactory)->error('The requested entry was not found.', [ ], 404); |
|
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | $service->updateById($id, $request->getParsedBody()); |