From ae9f2eeee254d2453fb491d1701deabd8ee4aa7e Mon Sep 17 00:00:00 2001 From: Sergio Brighenti Date: Tue, 28 Jul 2020 06:51:56 +0000 Subject: [PATCH] Apply fixes from StyleCI [ci skip] [skip ci] --- app/Controllers/ClientController.php | 3 ++- app/Controllers/UserController.php | 3 ++- app/Middleware/RememberMiddleware.php | 3 ++- app/helpers.php | 3 +++ bootstrap/container.php | 3 ++- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/app/Controllers/ClientController.php b/app/Controllers/ClientController.php index 0cec422..3707e42 100644 --- a/app/Controllers/ClientController.php +++ b/app/Controllers/ClientController.php @@ -63,7 +63,8 @@ class ClientController extends Controller return redirect($response, $request->getHeaderLine('Referer')); } - return view()->render($response->withHeader('Content-Disposition', 'attachment;filename="xbackbone_uploader_'.$user->username.'.sh"'), + return view()->render( + $response->withHeader('Content-Disposition', 'attachment;filename="xbackbone_uploader_'.$user->username.'.sh"'), 'scripts/xbackbone_uploader.sh.twig', [ 'username' => $user->username, diff --git a/app/Controllers/UserController.php b/app/Controllers/UserController.php index 2a10c61..dabab34 100644 --- a/app/Controllers/UserController.php +++ b/app/Controllers/UserController.php @@ -31,7 +31,8 @@ class UserController extends Controller $pages = $this->database->query('SELECT COUNT(*) AS `count` FROM `users`')->fetch()->count / self::PER_PAGE; - return view()->render($response, + return view()->render( + $response, 'user/index.twig', [ 'users' => $users, diff --git a/app/Middleware/RememberMiddleware.php b/app/Middleware/RememberMiddleware.php index 638ab0a..dc0804a 100644 --- a/app/Middleware/RememberMiddleware.php +++ b/app/Middleware/RememberMiddleware.php @@ -20,7 +20,8 @@ class RememberMiddleware extends Middleware if (!$this->session->get('logged', false) && !empty($request->getCookieParams()['remember'])) { [$selector, $token] = explode(':', $request->getCookieParams()['remember']); - $user = $this->database->query('SELECT `id`, `username`,`is_admin`, `active`, `remember_token`, `current_disk_quota`, `max_disk_quota`, `copy_raw` FROM `users` WHERE `remember_selector` = ? AND `remember_expire` > ? LIMIT 1', + $user = $this->database->query( + 'SELECT `id`, `username`,`is_admin`, `active`, `remember_token`, `current_disk_quota`, `max_disk_quota`, `copy_raw` FROM `users` WHERE `remember_selector` = ? AND `remember_expire` > ? LIMIT 1', [$selector, date('Y-m-d\TH:i:s', time())] )->fetch(); diff --git a/app/helpers.php b/app/helpers.php index 4f1f2ce..398d97e 100644 --- a/app/helpers.php +++ b/app/helpers.php @@ -95,10 +95,13 @@ if (!function_exists('stringToBytes')) { switch ($last) { case 't': $val *= 1024; + // no break case 'g': $val *= 1024; + // no break case 'm': $val *= 1024; + // no break case 'k': $val *= 1024; } diff --git a/bootstrap/container.php b/bootstrap/container.php index 06f75a2..daf684b 100644 --- a/bootstrap/container.php +++ b/bootstrap/container.php @@ -89,7 +89,8 @@ return [ sprintf( 'DefaultEndpointsProtocol=https;AccountName=%s;AccountKey=%s;', $config['storage']['account_name'], - $config['storage']['account_key']) + $config['storage']['account_key'] + ) ); return new Filesystem(new AzureBlobStorageAdapter($client, $config['storage']['container_name']));