@@ -10,7 +10,6 @@ |
||
| 10 | 10 | use Respect\Validation\Validator as V; |
| 11 | 11 | use Slim\Http\Request; |
| 12 | 12 | use Slim\Http\Response; |
| 13 | -use App\Model\Translation; |
|
| 14 | 13 | |
| 15 | 14 | /** |
| 16 | 15 | * @property Validator validator |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | 'username' => $request->getParam('username'), |
| 27 | 27 | 'password' => $request->getParam('password') |
| 28 | 28 | ]; |
| 29 | - $remember = (bool)$request->getParam('remember'); |
|
| 29 | + $remember = (bool) $request->getParam('remember'); |
|
| 30 | 30 | |
| 31 | 31 | try { |
| 32 | 32 | if ($this->auth->authenticate($credentials, $remember)) { |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | |
| 35 | 35 | return $this->redirect($response, 'home'); |
| 36 | 36 | } else { |
| 37 | - $this->validator->addError('auth',$this->translate('auth.error.login')); |
|
| 37 | + $this->validator->addError('auth', $this->translate('auth.error.login')); |
|
| 38 | 38 | } |
| 39 | 39 | } catch (ThrottlingException $e) { |
| 40 | 40 | $this->validator->addError('auth', $this->translate('auth.error.too_many_attempts')); |
@@ -1,13 +1,13 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | return [ |
| 4 | - 'name' => 'Slim skeleton', |
|
| 5 | - 'homepage' => 'Home Page', |
|
| 6 | - 'error' => [ |
|
| 4 | + 'name' => 'Slim skeleton', |
|
| 5 | + 'homepage' => 'Home Page', |
|
| 6 | + 'error' => [ |
|
| 7 | 7 | 'error' => 'Error', |
| 8 | 8 | 'client' => 'An error occurred on the client', |
| 9 | 9 | 'internal' => 'Internal Server Error', |
| 10 | 10 | 'not_found' => 'Page not found', |
| 11 | 11 | 'denied' => 'Access denied' |
| 12 | - ] |
|
| 12 | + ] |
|
| 13 | 13 | ]; |
@@ -1,26 +1,26 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | return [ |
| 4 | - 'login' => 'Login', |
|
| 5 | - 'logout' => 'Logout', |
|
| 6 | - 'register' => 'Register', |
|
| 7 | - 'signin' => 'Sign In', |
|
| 8 | - 'signup' => 'Sign Up', |
|
| 9 | - 'username' => 'Username', |
|
| 10 | - 'password' => 'Password', |
|
| 11 | - 'remember' => 'Remeber', |
|
| 12 | - 'email_address' => 'Email Address', |
|
| 13 | - 'confirm' => 'Confirm', |
|
| 14 | - 'login_success' => 'You are now logged in.', |
|
| 15 | - 'register_success' => 'Your account has been created.', |
|
| 16 | - 'error' => [ |
|
| 4 | + 'login' => 'Login', |
|
| 5 | + 'logout' => 'Logout', |
|
| 6 | + 'register' => 'Register', |
|
| 7 | + 'signin' => 'Sign In', |
|
| 8 | + 'signup' => 'Sign Up', |
|
| 9 | + 'username' => 'Username', |
|
| 10 | + 'password' => 'Password', |
|
| 11 | + 'remember' => 'Remeber', |
|
| 12 | + 'email_address' => 'Email Address', |
|
| 13 | + 'confirm' => 'Confirm', |
|
| 14 | + 'login_success' => 'You are now logged in.', |
|
| 15 | + 'register_success' => 'Your account has been created.', |
|
| 16 | + 'error' => [ |
|
| 17 | 17 | 'password' => [ |
| 18 | - 'length' => 'The password length must be between 6 and 25 characters', |
|
| 19 | - 'match' => 'Passwords don\'t match' |
|
| 18 | + 'length' => 'The password length must be between 6 and 25 characters', |
|
| 19 | + 'match' => 'Passwords don\'t match' |
|
| 20 | 20 | ], |
| 21 | 21 | 'login' => 'Bad username or password.', |
| 22 | 22 | 'too_many_attempts' => 'Too many attempts!', |
| 23 | 23 | 'username' => 'This username is already used.', |
| 24 | 24 | 'email' => 'This email is already used.' |
| 25 | - ] |
|
| 25 | + ] |
|
| 26 | 26 | ]; |
@@ -67,8 +67,8 @@ |
||
| 67 | 67 | }; |
| 68 | 68 | |
| 69 | 69 | $container['translator'] = function ($container) { |
| 70 | - $loader = new FileLoader(new Filesystem(), __DIR__ . '/../lang'); |
|
| 71 | - return new Translator($loader, $container['settings']['locale']); |
|
| 70 | + $loader = new FileLoader(new Filesystem(), __DIR__ . '/../lang'); |
|
| 71 | + return new Translator($loader, $container['settings']['locale']); |
|
| 72 | 72 | }; |
| 73 | 73 | |
| 74 | 74 | $container['monolog'] = function ($container) { |
@@ -26,16 +26,16 @@ discard block |
||
| 26 | 26 | $capsule->setAsGlobal(); |
| 27 | 27 | $capsule->bootEloquent(); |
| 28 | 28 | |
| 29 | -$container['auth'] = function ($container) { |
|
| 29 | +$container['auth'] = function($container) { |
|
| 30 | 30 | $sentinel = new Sentinel(new SentinelBootstrapper($container['settings']['sentinel'])); |
| 31 | 31 | return $sentinel->getSentinel(); |
| 32 | 32 | }; |
| 33 | 33 | |
| 34 | -$container['flash'] = function () { |
|
| 34 | +$container['flash'] = function() { |
|
| 35 | 35 | return new Messages(); |
| 36 | 36 | }; |
| 37 | 37 | |
| 38 | -$container['csrf'] = function ($container) { |
|
| 38 | +$container['csrf'] = function($container) { |
|
| 39 | 39 | $guard = new Guard(); |
| 40 | 40 | $guard->setFailureCallable($container['csrfFailureHandler']); |
| 41 | 41 | |
@@ -43,11 +43,11 @@ discard block |
||
| 43 | 43 | }; |
| 44 | 44 | |
| 45 | 45 | // https://github.com/awurth/SlimValidation |
| 46 | -$container['validator'] = function () { |
|
| 46 | +$container['validator'] = function() { |
|
| 47 | 47 | return new Validator(); |
| 48 | 48 | }; |
| 49 | 49 | |
| 50 | -$container['twig'] = function ($container) { |
|
| 50 | +$container['twig'] = function($container) { |
|
| 51 | 51 | $config = $container['settings']['twig']; |
| 52 | 52 | |
| 53 | 53 | $twig = new Twig($config['path'], $config['options']); |
@@ -66,12 +66,12 @@ discard block |
||
| 66 | 66 | return $twig; |
| 67 | 67 | }; |
| 68 | 68 | |
| 69 | -$container['translator'] = function ($container) { |
|
| 69 | +$container['translator'] = function($container) { |
|
| 70 | 70 | $loader = new FileLoader(new Filesystem(), __DIR__ . '/../lang'); |
| 71 | 71 | return new Translator($loader, $container['settings']['locale']); |
| 72 | 72 | }; |
| 73 | 73 | |
| 74 | -$container['monolog'] = function ($container) { |
|
| 74 | +$container['monolog'] = function($container) { |
|
| 75 | 75 | $config = $container['settings']['monolog']; |
| 76 | 76 | |
| 77 | 77 | $logger = new Logger($config['name']); |
@@ -2,7 +2,7 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | return [ |
| 4 | 4 | |
| 5 | - 'sentinel' => require $app->getConfigurationDir().'/sentinel.php', |
|
| 5 | + 'sentinel' => require $app->getConfigurationDir() . '/sentinel.php', |
|
| 6 | 6 | |
| 7 | 7 | 'locale' => $_SERVER['APP_LOCALE'], |
| 8 | 8 | |
@@ -19,16 +19,16 @@ discard block |
||
| 19 | 19 | |
| 20 | 20 | 'twig' => [ |
| 21 | 21 | 'path' => [ |
| 22 | - $app->getRootDir().'/templates' |
|
| 22 | + $app->getRootDir() . '/templates' |
|
| 23 | 23 | ], |
| 24 | 24 | 'options' => [ |
| 25 | - 'cache' => $app->getCacheDir().'/twig', |
|
| 25 | + 'cache' => $app->getCacheDir() . '/twig', |
|
| 26 | 26 | ] |
| 27 | 27 | ], |
| 28 | 28 | |
| 29 | 29 | 'monolog' => [ |
| 30 | 30 | 'name' => 'app', |
| 31 | - 'path' => $app->getLogDir().'/'.$app->getEnvironment().'.log', |
|
| 31 | + 'path' => $app->getLogDir() . '/' . $app->getEnvironment() . '.log', |
|
| 32 | 32 | 'level' => Monolog\Logger::ERROR |
| 33 | 33 | ] |
| 34 | 34 | |