@@ -98,7 +98,7 @@ |
||
98 | 98 | /** |
99 | 99 | * Clears user session. |
100 | 100 | * |
101 | - * @return static |
|
101 | + * @return \Psr\Http\Message\ResponseInterface |
|
102 | 102 | */ |
103 | 103 | public function logout() : \Psr\Http\Message\ResponseInterface |
104 | 104 | { |
@@ -82,8 +82,8 @@ |
||
82 | 82 | } |
83 | 83 | |
84 | 84 | $data = $this->request->getParsedBody(); |
85 | - $email = isset($data['email']) ? $data['email'] : null; |
|
86 | - $password = isset($data['password']) ? $data['password'] : null; |
|
85 | + $email = isset($data[ 'email' ]) ? $data[ 'email' ] : null; |
|
86 | + $password = isset($data[ 'password' ]) ? $data[ 'password' ] : null; |
|
87 | 87 | |
88 | 88 | try { |
89 | 89 | $this->session->getStorage()->user = $this->adminUserService->loginUser($email, $password); |
@@ -32,7 +32,6 @@ |
||
32 | 32 | /** |
33 | 33 | * Invoked on middleware execution. |
34 | 34 | * |
35 | - * @param mixed $exception exception |
|
36 | 35 | * @param Request $request request |
37 | 36 | * @param Response $response response |
38 | 37 | * @return HtmlResponse |
@@ -5,14 +5,14 @@ |
||
5 | 5 | { |
6 | 6 | public function up() |
7 | 7 | { |
8 | - $this->table('articles', ['id' => false, 'primary_key' => 'article_uuid']) |
|
9 | - ->addColumn('article_uuid', 'binary', ['limit' => 16]) |
|
8 | + $this->table('articles', [ 'id' => false, 'primary_key' => 'article_uuid' ]) |
|
9 | + ->addColumn('article_uuid', 'binary', [ 'limit' => 16 ]) |
|
10 | 10 | ->addColumn('title', 'text') |
11 | 11 | ->addColumn('slug', 'text') |
12 | 12 | ->addColumn('type', 'integer') |
13 | 13 | ->addColumn('published_at', 'datetime') |
14 | - ->addIndex('type', ['name' => 'type_INDEX']) |
|
15 | - ->addIndex('published_at', ['name' => 'published_at_INDEX']) |
|
14 | + ->addIndex('type', [ 'name' => 'type_INDEX' ]) |
|
15 | + ->addIndex('published_at', [ 'name' => 'published_at_INDEX' ]) |
|
16 | 16 | ->create(); |
17 | 17 | } |
18 | 18 |
@@ -14,10 +14,10 @@ |
||
14 | 14 | 'error/404' => 'templates/error/404.phtml', |
15 | 15 | ], |
16 | 16 | 'paths' => [ |
17 | - 'web' => ['templates/web'], |
|
18 | - 'admin' => ['templates/admin'], |
|
19 | - 'layout' => ['templates/layout'], |
|
20 | - 'error' => ['templates/error'], |
|
17 | + 'web' => [ 'templates/web' ], |
|
18 | + 'admin' => [ 'templates/admin' ], |
|
19 | + 'layout' => [ 'templates/layout' ], |
|
20 | + 'error' => [ 'templates/error' ], |
|
21 | 21 | ], |
22 | 22 | ], |
23 | 23 |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | |
53 | 53 | // execute this middlweare on every /admin[*] path |
54 | 54 | 'permission' => [ |
55 | - 'middleware' => [Core\Middleware\AdminAuth::class], |
|
55 | + 'middleware' => [ Core\Middleware\AdminAuth::class ], |
|
56 | 56 | 'priority' => 100, |
57 | 57 | 'path' => '/admin' |
58 | 58 | ], |
@@ -74,12 +74,12 @@ discard block |
||
74 | 74 | ], |
75 | 75 | |
76 | 76 | 'error404' => [ |
77 | - 'middleware' => [Core\Middleware\ErrorNotFound::class], |
|
77 | + 'middleware' => [ Core\Middleware\ErrorNotFound::class ], |
|
78 | 78 | 'priority' => -1, |
79 | 79 | ], |
80 | 80 | |
81 | 81 | 'error' => [ |
82 | - 'middleware' => [Core\Middleware\Error::class], |
|
82 | + 'middleware' => [ Core\Middleware\Error::class ], |
|
83 | 83 | 'error' => true, |
84 | 84 | 'priority' => -10000, |
85 | 85 | ], |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | |
15 | 15 | $cachedConfigFile = 'data/cache/app_config.php'; |
16 | 16 | |
17 | -$config = []; |
|
17 | +$config = [ ]; |
|
18 | 18 | if (is_file($cachedConfigFile)) { |
19 | 19 | // Try to load the cached config |
20 | 20 | $config = include $cachedConfigFile; |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | } |
26 | 26 | |
27 | 27 | // Cache config if enabled |
28 | - if (isset($config['config_cache_enabled']) && $config['config_cache_enabled'] === true) { |
|
28 | + if (isset($config[ 'config_cache_enabled' ]) && $config[ 'config_cache_enabled' ] === true) { |
|
29 | 29 | file_put_contents($cachedConfigFile, '<?php return ' . var_export($config, true) . ';'); |
30 | 30 | } |
31 | 31 | } |
@@ -8,7 +8,7 @@ |
||
8 | 8 | |
9 | 9 | // Build container |
10 | 10 | $container = new ServiceManager(); |
11 | -(new Config($config['dependencies']))->configureServiceManager($container); |
|
11 | +(new Config($config[ 'dependencies' ]))->configureServiceManager($container); |
|
12 | 12 | |
13 | 13 | // Inject config |
14 | 14 | $container->setService('config', $config); |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if(php_sapi_name() === 'cli-server' && is_file(__DIR__ . parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH))){ |
|
3 | +if (php_sapi_name() === 'cli-server' && is_file(__DIR__ . parse_url($_SERVER[ 'REQUEST_URI' ], PHP_URL_PATH))) { |
|
4 | 4 | return false; |
5 | 5 | } |
6 | 6 |
@@ -54,7 +54,7 @@ |
||
54 | 54 | if (!$user) { |
55 | 55 | return $response->withStatus(302)->withHeader( |
56 | 56 | 'Location', |
57 | - $this->router->generateUri('auth', ['action' => 'login']) |
|
57 | + $this->router->generateUri('auth', [ 'action' => 'login' ]) |
|
58 | 58 | ); |
59 | 59 | } |
60 | 60 |