@@ -4,8 +4,8 @@ discard block |
||
| 4 | 4 | class CreateAccessTokensTable |
| 5 | 5 | { |
| 6 | 6 | /** |
| 7 | - * Do the migration |
|
| 8 | - */ |
|
| 7 | + * Do the migration |
|
| 8 | + */ |
|
| 9 | 9 | public function up() |
| 10 | 10 | { |
| 11 | 11 | Capsule::schema()->create('access_tokens', function($table) |
@@ -19,8 +19,8 @@ discard block |
||
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | /** |
| 22 | - * Undo the migration |
|
| 23 | - */ |
|
| 22 | + * Undo the migration |
|
| 23 | + */ |
|
| 24 | 24 | public function down() |
| 25 | 25 | { |
| 26 | 26 | Capsule::schema()->drop('access_tokens'); |
@@ -8,8 +8,7 @@ |
||
| 8 | 8 | */ |
| 9 | 9 | public function up() |
| 10 | 10 | { |
| 11 | - Capsule::schema()->create('access_tokens', function($table) |
|
| 12 | - { |
|
| 11 | + Capsule::schema()->create('access_tokens', function($table) { |
|
| 13 | 12 | $table->increments('id'); |
| 14 | 13 | $table->integer('user_id')->unsigned()->index(); |
| 15 | 14 | $table->string('access_token')->unique()->nullable(); |
@@ -4,8 +4,8 @@ discard block |
||
| 4 | 4 | class CreateRefreshTokensTable |
| 5 | 5 | { |
| 6 | 6 | /** |
| 7 | - * Do the migration |
|
| 8 | - */ |
|
| 7 | + * Do the migration |
|
| 8 | + */ |
|
| 9 | 9 | public function up() |
| 10 | 10 | { |
| 11 | 11 | Capsule::schema()->create('refresh_tokens', function($table) |
@@ -19,8 +19,8 @@ discard block |
||
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | /** |
| 22 | - * Undo the migration |
|
| 23 | - */ |
|
| 22 | + * Undo the migration |
|
| 23 | + */ |
|
| 24 | 24 | public function down() |
| 25 | 25 | { |
| 26 | 26 | Capsule::schema()->drop('refresh_tokens'); |
@@ -8,8 +8,7 @@ |
||
| 8 | 8 | */ |
| 9 | 9 | public function up() |
| 10 | 10 | { |
| 11 | - Capsule::schema()->create('refresh_tokens', function($table) |
|
| 12 | - { |
|
| 11 | + Capsule::schema()->create('refresh_tokens', function($table) { |
|
| 13 | 12 | $table->increments('id'); |
| 14 | 13 | $table->integer('user_id')->unsigned()->index(); |
| 15 | 14 | $table->string('refresh_token')->unique()->nullable(); |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | return false; |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | - $timestamp = (int) substr($token, strrpos($token, '_') + 1); |
|
| 141 | + $timestamp = (int)substr($token, strrpos($token, '_') + 1); |
|
| 142 | 142 | $expire = 3600; |
| 143 | 143 | return $timestamp + $expire >= time(); |
| 144 | 144 | } |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | */ |
| 149 | 149 | public function generatePasswordResetToken() |
| 150 | 150 | { |
| 151 | - $this->password_reset_token = Helper::generateRandomString() . '_' . time(); |
|
| 151 | + $this->password_reset_token = Helper::generateRandomString().'_'.time(); |
|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | /** |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | { |
| 16 | 16 | $config = $container['settings']; |
| 17 | 17 | |
| 18 | - $container['mailer'] = function () use ($config) { |
|
| 18 | + $container['mailer'] = function() use ($config) { |
|
| 19 | 19 | $transport = \Swift_MailTransport::newInstance(); |
| 20 | 20 | $mailer = \Swift_Mailer::newInstance($transport); |
| 21 | 21 | |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | */ |
| 15 | 15 | public function register(Container $container) |
| 16 | 16 | { |
| 17 | - $container['errorHandler'] = function (Container $container) { |
|
| 17 | + $container['errorHandler'] = function(Container $container) { |
|
| 18 | 18 | return function($request, $response, $exception) use ($container) { |
| 19 | 19 | $details = (defined('DEBUG_MODE') && DEBUG_MODE == 1) ? $exception->getMessage() : 'Internal server error'; |
| 20 | 20 | $error = new JsonException(null, 500, 'Internal server error', $details); |
@@ -23,13 +23,13 @@ discard block |
||
| 23 | 23 | }; |
| 24 | 24 | }; |
| 25 | 25 | |
| 26 | - $container['notAllowedHandler'] = function () { |
|
| 26 | + $container['notAllowedHandler'] = function() { |
|
| 27 | 27 | return function($request, $response, $methods) { |
| 28 | 28 | throw new JsonException(null, 405, 'Method Not Allowed', 'Method must be one of: '.implode(', ', $methods)); |
| 29 | 29 | }; |
| 30 | 30 | }; |
| 31 | 31 | |
| 32 | - $container['notFoundHandler'] = function () { |
|
| 32 | + $container['notFoundHandler'] = function() { |
|
| 33 | 33 | return function() { |
| 34 | 34 | throw new JsonException(null, 404, 'Not found', 'Entity not found'); |
| 35 | 35 | }; |
@@ -17,13 +17,13 @@ |
||
| 17 | 17 | { |
| 18 | 18 | $config = $container['settings']; |
| 19 | 19 | |
| 20 | - $container['renderer'] = function () use ($config) { |
|
| 20 | + $container['renderer'] = function() use ($config) { |
|
| 21 | 21 | $renderer = new Renderer($config); |
| 22 | 22 | |
| 23 | 23 | return $renderer; |
| 24 | 24 | }; |
| 25 | 25 | |
| 26 | - $container['mailRenderer'] = function () use ($config) { |
|
| 26 | + $container['mailRenderer'] = function() use ($config) { |
|
| 27 | 27 | $renderer = new MailRenderer($config['mailTemplate']); |
| 28 | 28 | |
| 29 | 29 | return $renderer; |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | { |
| 19 | 19 | $config = $container['settings']['logger']; |
| 20 | 20 | |
| 21 | - $container['logger'] = function () use ($config) { |
|
| 21 | + $container['logger'] = function() use ($config) { |
|
| 22 | 22 | $logger = new Logger($config['name']); |
| 23 | 23 | $logger->pushProcessor(new UidProcessor()); |
| 24 | 24 | $logger->pushHandler(new StreamHandler($config['path'], $config['level'])); |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | $config = $container['settings']; |
| 22 | 22 | |
| 23 | 23 | // translation |
| 24 | - $container['translator'] = function () use ($config) { |
|
| 24 | + $container['translator'] = function() use ($config) { |
|
| 25 | 25 | $translateFileLoader = new FileLoader(new Filesystem, $config['translate']['path']); |
| 26 | 26 | $translator = new Translator($translateFileLoader, $config['translate']['locale']); |
| 27 | 27 | |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | }; |
| 30 | 30 | |
| 31 | 31 | // validation |
| 32 | - $container['validation'] = function (Container $c) use ($config) { |
|
| 32 | + $container['validation'] = function(Container $c) use ($config) { |
|
| 33 | 33 | $validation = new Factory($c->get('translator')); |
| 34 | 34 | $presence = new DatabasePresenceVerifier($c->get('databaseManager')); |
| 35 | 35 | $validation->setPresenceVerifier($presence); |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | { |
| 17 | 17 | $config = $container['settings']['acl']; |
| 18 | 18 | |
| 19 | - $container['acl'] = function () use ($config) { |
|
| 19 | + $container['acl'] = function() use ($config) { |
|
| 20 | 20 | $acl = new Acl($config); |
| 21 | 21 | |
| 22 | 22 | return $acl; |