@@ -3,15 +3,15 @@ |
||
3 | 3 | $capsule = new \Illuminate\Database\Capsule\Manager; |
4 | 4 | |
5 | 5 | $capsule->addConnection([ |
6 | - 'driver' => getenv('DB_DRIVER'), |
|
7 | - 'host' => getenv('DB_HOST'), |
|
8 | - 'database' => getenv('DB_DATABASE'), |
|
9 | - 'username' => getenv('DB_USERNAME'), |
|
10 | - 'password' => getenv('DB_PASSWORD'), |
|
11 | - 'charset' => 'utf8', |
|
12 | - 'port' => getenv('DB_PORT'), |
|
13 | - 'collation' => 'utf8_unicode_ci', |
|
14 | - 'prefix' => '' |
|
6 | + 'driver' => getenv('DB_DRIVER'), |
|
7 | + 'host' => getenv('DB_HOST'), |
|
8 | + 'database' => getenv('DB_DATABASE'), |
|
9 | + 'username' => getenv('DB_USERNAME'), |
|
10 | + 'password' => getenv('DB_PASSWORD'), |
|
11 | + 'charset' => 'utf8', |
|
12 | + 'port' => getenv('DB_PORT'), |
|
13 | + 'collation' => 'utf8_unicode_ci', |
|
14 | + 'prefix' => '' |
|
15 | 15 | ]); |
16 | 16 | |
17 | 17 | $capsule->setAsGlobal(); |
@@ -11,11 +11,11 @@ |
||
11 | 11 | { |
12 | 12 | |
13 | 13 | public static $defaultTemplates = [ |
14 | - self::MODE_DEFAULT => [ |
|
15 | - self::STANDARD => '{{name}} is already taken', |
|
16 | - ], |
|
17 | - self::MODE_NEGATIVE => [ |
|
18 | - self::STANDARD => '{{name}} is not already taken', |
|
19 | - ] |
|
20 | - ]; |
|
14 | + self::MODE_DEFAULT => [ |
|
15 | + self::STANDARD => '{{name}} is already taken', |
|
16 | + ], |
|
17 | + self::MODE_NEGATIVE => [ |
|
18 | + self::STANDARD => '{{name}} is not already taken', |
|
19 | + ] |
|
20 | + ]; |
|
21 | 21 | } |
22 | 22 | \ No newline at end of file |
@@ -14,6 +14,6 @@ |
||
14 | 14 | { |
15 | 15 | public function index($request, $response) |
16 | 16 | { |
17 | - return $this->view->render($response,'home.twig'); |
|
17 | + return $this->view->render($response, 'home.twig'); |
|
18 | 18 | } |
19 | 19 | } |
20 | 20 | \ No newline at end of file |
@@ -13,11 +13,11 @@ |
||
13 | 13 | class MatchesPasswordException extends ValidationException |
14 | 14 | { |
15 | 15 | public static $defaultTemplates = [ |
16 | - self::MODE_DEFAULT => [ |
|
17 | - self::STANDARD => '{{name}} does not macth', |
|
18 | - ], |
|
19 | - self::MODE_NEGATIVE => [ |
|
20 | - self::STANDARD => '{{name}} does not macth negative', |
|
21 | - ] |
|
22 | - ]; |
|
16 | + self::MODE_DEFAULT => [ |
|
17 | + self::STANDARD => '{{name}} does not macth', |
|
18 | + ], |
|
19 | + self::MODE_NEGATIVE => [ |
|
20 | + self::STANDARD => '{{name}} does not macth negative', |
|
21 | + ] |
|
22 | + ]; |
|
23 | 23 | } |
24 | 24 | \ No newline at end of file |
@@ -16,6 +16,6 @@ |
||
16 | 16 | |
17 | 17 | public function validate($input) |
18 | 18 | { |
19 | - return User::where('email',$input)->count() === 0; |
|
19 | + return User::where('email', $input)->count() === 0; |
|
20 | 20 | } |
21 | 21 | } |
22 | 22 | \ No newline at end of file |
@@ -26,7 +26,7 @@ |
||
26 | 26 | { |
27 | 27 | $user = User::where('email', $email)->first(); |
28 | 28 | |
29 | - if (! $user) { |
|
29 | + if (!$user) { |
|
30 | 30 | return false; |
31 | 31 | } |
32 | 32 |
@@ -32,18 +32,18 @@ discard block |
||
32 | 32 | $routeParser = $app->getRouteCollector()->getRouteParser(); |
33 | 33 | |
34 | 34 | $container->set('settings', function () { |
35 | - return [ |
|
36 | - 'displayErrorDetails' => true, |
|
37 | - 'app' => [ |
|
38 | - 'name' => getenv('APP_NAME') |
|
39 | - ] |
|
40 | - ]; |
|
35 | + return [ |
|
36 | + 'displayErrorDetails' => true, |
|
37 | + 'app' => [ |
|
38 | + 'name' => getenv('APP_NAME') |
|
39 | + ] |
|
40 | + ]; |
|
41 | 41 | }); |
42 | 42 | |
43 | 43 | require_once __DIR__ . '/database.php'; |
44 | 44 | |
45 | 45 | $container->set('router', function () use ($routeParser) { |
46 | - return $routeParser; |
|
46 | + return $routeParser; |
|
47 | 47 | }); |
48 | 48 | |
49 | 49 | $container->set('db', function () use ($capsule) { |
@@ -64,16 +64,16 @@ discard block |
||
64 | 64 | ]); |
65 | 65 | |
66 | 66 | $runtimeLoader = new TwigRuntimeLoader( |
67 | - $app->getRouteCollector()->getRouteParser(), |
|
68 | - (new UriFactory)->createFromGlobals($_SERVER), |
|
69 | - '/' |
|
70 | - ); |
|
67 | + $app->getRouteCollector()->getRouteParser(), |
|
68 | + (new UriFactory)->createFromGlobals($_SERVER), |
|
69 | + '/' |
|
70 | + ); |
|
71 | 71 | |
72 | - $view->addRuntimeLoader($runtimeLoader); |
|
72 | + $view->addRuntimeLoader($runtimeLoader); |
|
73 | 73 | |
74 | 74 | $view->addExtension(new TwigExtension( |
75 | 75 | $app->getRouteCollector()->getRouteParser(), |
76 | - $app->getBasePath() |
|
76 | + $app->getBasePath() |
|
77 | 77 | )); |
78 | 78 | |
79 | 79 | $view->getEnvironment()->addGlobal('auth', [ |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | $routeCollector->setDefaultInvocationStrategy(new RequestResponseArgs()); |
32 | 32 | $routeParser = $app->getRouteCollector()->getRouteParser(); |
33 | 33 | |
34 | -$container->set('settings', function () { |
|
34 | +$container->set('settings', function() { |
|
35 | 35 | return [ |
36 | 36 | 'displayErrorDetails' => true, |
37 | 37 | 'app' => [ |
@@ -42,11 +42,11 @@ discard block |
||
42 | 42 | |
43 | 43 | require_once __DIR__ . '/database.php'; |
44 | 44 | |
45 | -$container->set('router', function () use ($routeParser) { |
|
45 | +$container->set('router', function() use ($routeParser) { |
|
46 | 46 | return $routeParser; |
47 | 47 | }); |
48 | 48 | |
49 | -$container->set('db', function () use ($capsule) { |
|
49 | +$container->set('db', function() use ($capsule) { |
|
50 | 50 | return $capsule; |
51 | 51 | }); |
52 | 52 | |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | return new \Slim\Flash\Messages; |
59 | 59 | }); |
60 | 60 | |
61 | -$container->set('view', function ($container) use ($app) { |
|
61 | +$container->set('view', function($container) use ($app) { |
|
62 | 62 | $view = Twig::create(__DIR__ . '/../resources/views', [ |
63 | 63 | 'cache' => false, |
64 | 64 | ]); |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | return $view; |
87 | 87 | }); |
88 | 88 | |
89 | -$container->set('validator', function ($container) { |
|
89 | +$container->set('validator', function($container) { |
|
90 | 90 | return new App\Validation\Validator; |
91 | 91 | }); |
92 | 92 |
@@ -33,7 +33,7 @@ |
||
33 | 33 | $data['password'] |
34 | 34 | ); |
35 | 35 | |
36 | - if (! $auth) { |
|
36 | + if (!$auth) { |
|
37 | 37 | $this->flash->addMessage('error', 'Could not sign you in with those details'); |
38 | 38 | return $response->withHeader('Location', $this->router->urlFor('auth.signin')); |
39 | 39 | } |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | |
8 | 8 | $app->get('/', HomeController::class . ':index')->setName('home'); |
9 | 9 | |
10 | -$app->group('', function ($group) { |
|
10 | +$app->group('', function($group) { |
|
11 | 11 | $group->get('/auth/signup', AuthController::class . ':getSignUp')->setName('auth.signup'); |
12 | 12 | $group->post('/auth/signup', AuthController::class . ':postSignUp'); |
13 | 13 | $group->get('/auth/signin', AuthController::class . ':getSignIn')->setName('auth.signin'); |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | |
17 | 17 | |
18 | 18 | |
19 | -$app->group('', function ($group) { |
|
19 | +$app->group('', function($group) { |
|
20 | 20 | $group->get('/auth/signout', AuthController::class . ':getSignOut')->setName('auth.signout'); |
21 | 21 | $group->get('/auth/password/change', PasswordController::class . ':getChangePassword')->setName('auth.password.change'); |
22 | 22 | $group->post('/auth/password/change', PasswordController::class . ':postChangePassword'); |