@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | * @param callable $next |
24 | 24 | * @return Response |
25 | 25 | */ |
26 | - function (Request $request, Response $response, callable $next) { |
|
26 | + function(Request $request, Response $response, callable $next) { |
|
27 | 27 | $uri = $request->getUri(); |
28 | 28 | $path = $uri->getPath(); |
29 | 29 | if ($path != '/' && substr($path, -1) == '/') { |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | * @param $next |
43 | 43 | * @return mixed |
44 | 44 | */ |
45 | - function ($req, $res, $next) { |
|
45 | + function($req, $res, $next) { |
|
46 | 46 | $response = $next($req, $res); |
47 | 47 | return $response |
48 | 48 | ->withHeader('Access-Control-Allow-Origin', $this->get('settings')['cors']) |
@@ -48,6 +48,6 @@ |
||
48 | 48 | */ |
49 | 49 | public function validate($input) |
50 | 50 | { |
51 | - return ! $this->table->where($this->columns, $input)->exists(); |
|
51 | + return !$this->table->where($this->columns, $input)->exists(); |
|
52 | 52 | } |
53 | 53 | } |
54 | 54 | \ No newline at end of file |
@@ -72,7 +72,7 @@ |
||
72 | 72 | */ |
73 | 73 | public function failed() |
74 | 74 | { |
75 | - return ! empty($this->errors); |
|
75 | + return !empty($this->errors); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | /** |
@@ -46,7 +46,7 @@ |
||
46 | 46 | |
47 | 47 | $capsule->setAsGlobal(); |
48 | 48 | $capsule->bootEloquent(); |
49 | - $pimple['db'] = function ($c) use ($capsule) { |
|
49 | + $pimple['db'] = function($c) use ($capsule) { |
|
50 | 50 | return $capsule; |
51 | 51 | }; |
52 | 52 | } |
@@ -29,7 +29,7 @@ |
||
29 | 29 | */ |
30 | 30 | public function register(Container $pimple) |
31 | 31 | { |
32 | - $pimple['auth'] = function (ContainerInterface $c) { |
|
32 | + $pimple['auth'] = function(ContainerInterface $c) { |
|
33 | 33 | return new Auth($c->get('db'), $c->get('settings')); |
34 | 34 | }; |
35 | 35 | } |
@@ -84,7 +84,7 @@ |
||
84 | 84 | */ |
85 | 85 | public function attemptLogin($username, $password) |
86 | 86 | { |
87 | - if ( !$user = User::where('username', $username)->first()) { |
|
87 | + if (!$user = User::where('username', $username)->first()) { |
|
88 | 88 | return false; |
89 | 89 | } |
90 | 90 |
@@ -19,9 +19,9 @@ discard block |
||
19 | 19 | /** |
20 | 20 | * |
21 | 21 | */ |
22 | -defined('ROOT') ?: define('ROOT', dirname(__DIR__) . DS); |
|
22 | +defined('ROOT') ?: define('ROOT', dirname(__DIR__).DS); |
|
23 | 23 | |
24 | -if (file_exists(ROOT . '.env')) { |
|
24 | +if (file_exists(ROOT.'.env')) { |
|
25 | 25 | $dotenv = new Dotenv\Dotenv(ROOT); |
26 | 26 | $dotenv->load(); |
27 | 27 | } |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | ], |
43 | 43 | |
44 | 44 | 'renderer' => [ |
45 | - 'template_path' => __DIR__ . '/../templates/', |
|
45 | + 'template_path' => __DIR__.'/../templates/', |
|
46 | 46 | ], |
47 | 47 | |
48 | 48 | 'database' => [ |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | * @param $c |
24 | 24 | * @return \Slim\Views\PhpRenderer |
25 | 25 | */ |
26 | -$container['renderer'] = function ($c) { |
|
26 | +$container['renderer'] = function($c) { |
|
27 | 27 | $settings = $c->get('settings')['renderer']; |
28 | 28 | return new Slim\Views\PhpRenderer($settings['template_path']); |
29 | 29 | }; |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | * @param $c |
33 | 33 | * @return \Slim\Middleware\JwtAuthentication |
34 | 34 | */ |
35 | -$container['jwt'] = function ($c) { |
|
35 | +$container['jwt'] = function($c) { |
|
36 | 36 | $jws_settings = $c->get('settings')['jwt']; |
37 | 37 | return new \Slim\Middleware\JwtAuthentication($jws_settings); |
38 | 38 | }; |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | * @param $c |
41 | 41 | * @return \UserManagement\Validation\Validator |
42 | 42 | */ |
43 | -$container['validator'] = function ($c) { |
|
43 | +$container['validator'] = function($c) { |
|
44 | 44 | \Respect\Validation\Validator::with('\\UserManagement\\Validation\\Rules'); |
45 | 45 | return new \UserManagement\Validation\Validator(); |
46 | 46 | }; |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | * @param $c |
49 | 49 | * @return Manager |
50 | 50 | */ |
51 | -$container['fractal'] = function ($c) { |
|
51 | +$container['fractal'] = function($c) { |
|
52 | 52 | $manager = new Manager(); |
53 | 53 | $manager->setSerializer(new ArraySerializer()); |
54 | 54 | return $manager; |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | * @param $c |
58 | 58 | * @return mixed |
59 | 59 | */ |
60 | -$container['appSettings'] = function ($c) { |
|
60 | +$container['appSettings'] = function($c) { |
|
61 | 61 | return $c->get('settings')['app']; |
62 | 62 | }; |
63 | 63 |
@@ -21,7 +21,7 @@ |
||
21 | 21 | * |
22 | 22 | */ |
23 | 23 | '/user', |
24 | - function () { |
|
24 | + function() { |
|
25 | 25 | $jwtMiddleware = $this->getContainer()->get('jwt'); |
26 | 26 | $this->post('/login', LoginController::class.':login')->setName('auth.login'); |
27 | 27 | $this->get('/get', LoginController::class.':getUser')->setName('auth.get'); |