@@ -67,7 +67,7 @@ |
||
67 | 67 | $service = $this->container->get('service.entry'); |
68 | 68 | |
69 | 69 | if (!$service->existsById($id)) { |
70 | - return (new ResponseFactory)->error('The requested entry was not found.', [], 404); |
|
70 | + return (new ResponseFactory)->error('The requested entry was not found.', [ ], 404); |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | return (new ResponseFactory)->ok($service->readById($id), 200); |
@@ -41,7 +41,7 @@ |
||
41 | 41 | */ |
42 | 42 | public function handle(ServerRequestInterface $request) : ResponseInterface |
43 | 43 | { |
44 | - $uri = $this->container->get('router')->generateUri('home', []); |
|
44 | + $uri = $this->container->get('router')->generateUri('home', [ ]); |
|
45 | 45 | |
46 | 46 | return (new ResponseFactory)->createResponse(301) |
47 | 47 | ->withHeader('Location', $uri); |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | ServerRequestInterface $request, |
86 | 86 | MethodNotAllowedException $exception |
87 | 87 | ) : ResponseInterface { |
88 | - return (new ResponseFactory)->error($exception->getMessage(), [], 405) |
|
88 | + return (new ResponseFactory)->error($exception->getMessage(), [ ], 405) |
|
89 | 89 | ->withHeader('Allow', implode(',', $exception->getAllowedMethods())); |
90 | 90 | } |
91 | 91 | |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | ServerRequestInterface $request, |
102 | 102 | RouteNotFoundException $exception |
103 | 103 | ) : ResponseInterface { |
104 | - return (new ResponseFactory)->error($exception->getMessage(), [], 404); |
|
104 | + return (new ResponseFactory)->error($exception->getMessage(), [ ], 404); |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | /** |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | ServerRequestInterface $request, |
117 | 117 | UnsupportedMediaTypeException $exception |
118 | 118 | ) : ResponseInterface { |
119 | - return (new ResponseFactory)->error($exception->getMessage(), [], 415) |
|
119 | + return (new ResponseFactory)->error($exception->getMessage(), [ ], 415) |
|
120 | 120 | ->withHeader('Accept', implode(',', $exception->getSupportedTypes())); |
121 | 121 | } |
122 | 122 |
@@ -29,16 +29,16 @@ |
||
29 | 29 | */ |
30 | 30 | public function createEntityManager(array $params, ContainerInterface $container) : EntityManagerInterface |
31 | 31 | { |
32 | - $configuration = Setup::createConfiguration(false, $params['proxyDir'], $params['cache']); |
|
32 | + $configuration = Setup::createConfiguration(false, $params[ 'proxyDir' ], $params[ 'cache' ]); |
|
33 | 33 | |
34 | 34 | $configuration->setMetadataDriverImpl( |
35 | - $configuration->newDefaultAnnotationDriver($params['metadata']['sources'], true) |
|
35 | + $configuration->newDefaultAnnotationDriver($params[ 'metadata' ][ 'sources' ], true) |
|
36 | 36 | ); |
37 | 37 | |
38 | 38 | $configuration->setRepositoryFactory( |
39 | 39 | new InjectableRepositoryFactory($container) |
40 | 40 | ); |
41 | 41 | |
42 | - return EntityManager::create($params['connection'], $configuration); |
|
42 | + return EntityManager::create($params[ 'connection' ], $configuration); |
|
43 | 43 | } |
44 | 44 | } |
@@ -28,16 +28,16 @@ |
||
28 | 28 | public function createRouter(array $params, ContainerInterface $container) : Router |
29 | 29 | { |
30 | 30 | $router = new Router(); |
31 | - $router->addMiddleware(...$params['middlewares']); |
|
31 | + $router->addMiddleware(...$params[ 'middlewares' ]); |
|
32 | 32 | |
33 | 33 | $loader = new AnnotationDirectoryLoader(); |
34 | 34 | $loader->setContainer($container); |
35 | 35 | |
36 | - if (isset($params['metadata']['cache'])) { |
|
37 | - $loader->setCache($params['metadata']['cache']); |
|
36 | + if (isset($params[ 'metadata' ][ 'cache' ])) { |
|
37 | + $loader->setCache($params[ 'metadata' ][ 'cache' ]); |
|
38 | 38 | } |
39 | 39 | |
40 | - $loader->attach(...$params['metadata']['sources']); |
|
40 | + $loader->attach(...$params[ 'metadata' ][ 'sources' ]); |
|
41 | 41 | $router->load($loader); |
42 | 42 | |
43 | 43 | return $router; |
@@ -25,7 +25,7 @@ |
||
25 | 25 | */ |
26 | 26 | public function createEnvironment(array $params) : Environment |
27 | 27 | { |
28 | - $loader = new FilesystemLoader($params['loader']['paths']); |
|
28 | + $loader = new FilesystemLoader($params[ 'loader' ][ 'paths' ]); |
|
29 | 29 | |
30 | 30 | return new Environment($loader); |
31 | 31 | } |
@@ -26,9 +26,9 @@ |
||
26 | 26 | public function createLogger(array $params) : LoggerInterface |
27 | 27 | { |
28 | 28 | return new Logger( |
29 | - $params['name'], |
|
30 | - $params['handlers'], |
|
31 | - $params['processors'] |
|
29 | + $params[ 'name' ], |
|
30 | + $params[ 'handlers' ], |
|
31 | + $params[ 'processors' ] |
|
32 | 32 | ); |
33 | 33 | } |
34 | 34 | } |
@@ -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 = 'The RoadRunner 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 = 'The directory in which the service will be started [<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 = 'The user on whose behalf the service will be started [<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 = 'The group on whose behalf the service will be started [<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 |