From e324d04ed09e8ab5918c9273212242deb9b0892b Mon Sep 17 00:00:00 2001 From: Jeremy Kenedy Date: Sat, 28 Mar 2020 09:29:33 +0000 Subject: [PATCH] Apply fixes from StyleCI --- app/Exceptions/Handler.php | 13 ++- .../Controllers/Auth/ActivateController.php | 4 +- .../Controllers/Auth/RegisterController.php | 4 +- .../Controllers/Auth/SocialController.php | 16 ++-- app/Http/Controllers/ProfilesController.php | 10 +-- .../Controllers/RestoreUserController.php | 2 +- .../Controllers/SoftDeletesController.php | 2 +- .../ThemesManagementController.php | 2 +- .../Controllers/UsersManagementController.php | 8 +- app/Http/Middleware/Authenticate.php | 2 +- app/Http/Middleware/CheckCurrentUser.php | 2 +- app/Http/Middleware/CheckIsUserActivated.php | 10 +-- app/Http/ViewComposers/ThemeComposer.php | 2 +- app/Logic/Macros/HtmlMacros.php | 14 +-- app/Mail/ExceptionOccured.php | 10 +-- app/Models/User.php | 8 +- app/Traits/ActivationTrait.php | 2 +- config/cache.php | 12 +-- config/database.php | 90 +++++++++---------- config/filesystems.php | 18 ++-- config/hashing.php | 4 +- config/logging.php | 40 ++++----- config/mail.php | 18 ++-- config/queue.php | 30 +++---- config/services.php | 4 +- .../2016_01_15_105324_create_roles_table.php | 2 +- ...16_01_15_114412_create_role_user_table.php | 2 +- ..._01_26_115212_create_permissions_table.php | 2 +- ...26_115523_create_permission_role_table.php | 2 +- ...09_132439_create_permission_user_table.php | 2 +- ...2_09_070937_create_two_step_auth_table.php | 2 +- ...636_create_laravel_blocker_types_table.php | 2 +- ...19_045158_create_laravel_blocker_table.php | 2 +- resources/lang/en/terms.php | 2 - 34 files changed, 171 insertions(+), 174 deletions(-) diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 0b8ec996b..b4b71d33e 100755 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -8,8 +8,8 @@ use Illuminate\Support\Facades\Log; use Mail; use Response; -use Symfony\Component\Debug\ExceptionHandler as SymfonyExceptionHandler; use Symfony\Component\Debug\Exception\FlattenException; +use Symfony\Component\Debug\ExceptionHandler as SymfonyExceptionHandler; use Throwable; class Handler extends ExceptionHandler @@ -44,10 +44,9 @@ class Handler extends ExceptionHandler */ public function report(Throwable $exception) { - $enableEmailExceptions = config('exceptions.emailExceptionEnabled'); - if ($enableEmailExceptions === "") { + if ($enableEmailExceptions === '') { $enableEmailExceptions = config('exceptions.emailExceptionEnabledDefault'); } @@ -75,10 +74,10 @@ public function render($request, Throwable $exception) if ($userLevelCheck) { if ($request->expectsJson()) { - return Response::json(array( - 'error' => 403, - 'message' => 'Unauthorized.' - ), 403); + return Response::json([ + 'error' => 403, + 'message' => 'Unauthorized.', + ], 403); } abort(403); diff --git a/app/Http/Controllers/Auth/ActivateController.php b/app/Http/Controllers/Auth/ActivateController.php index 522bf4050..d58cdf8dc 100755 --- a/app/Http/Controllers/Auth/ActivateController.php +++ b/app/Http/Controllers/Auth/ActivateController.php @@ -140,7 +140,7 @@ public function activationRequired() return $rCheck; } - if ($user->activated == false) { + if ($user->activated === false) { $activationsCount = Activation::where('user_id', $user->id) ->where('created_at', '>=', Carbon::now()->subHours(config('settings.timePeriod'))) ->count(); @@ -235,7 +235,7 @@ public function resend() $lastActivation = Activation::where('user_id', $user->id)->get()->last(); $currentRoute = Route::currentRouteName(); - if ($user->activated == false) { + if ($user->activated === false) { $activationsCount = Activation::where('user_id', $user->id) ->where('created_at', '>=', Carbon::now()->subHours(config('settings.timePeriod'))) ->count(); diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index 6bd21c726..893a87664 100755 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -59,7 +59,7 @@ protected function validator(array $data) { $data['captcha'] = $this->captchaCheck(); - if (!config('settings.reCaptchStatus')) { + if (! config('settings.reCaptchStatus')) { $data['captcha'] = true; } @@ -111,7 +111,7 @@ protected function create(array $data) 'password' => Hash::make($data['password']), 'token' => str_random(64), 'signup_ip_address' => $ipAddress->getClientIp(), - 'activated' => !config('settings.activation'), + 'activated' => ! config('settings.activation'), ]); $user->attachRole($role); diff --git a/app/Http/Controllers/Auth/SocialController.php b/app/Http/Controllers/Auth/SocialController.php index 354747390..a08378540 100755 --- a/app/Http/Controllers/Auth/SocialController.php +++ b/app/Http/Controllers/Auth/SocialController.php @@ -45,7 +45,7 @@ public function getSocialRedirect($provider) */ public function getSocialHandle($provider, Request $request) { - if ($request->get('denied') != '') { + if ($request->get('denied') !== '') { return redirect()->to('login') ->with('status', 'danger') ->with('message', trans('socials.denied')); @@ -60,7 +60,7 @@ public function getSocialHandle($provider, Request $request) $email = $socialUserObject->email; - if (!$socialUserObject->email) { + if (! $socialUserObject->email) { $email = 'missing'.str_random(10).'@'.str_random(10).'.example.org'; } @@ -75,12 +75,12 @@ public function getSocialHandle($provider, Request $request) $profile = new Profile(); $role = Role::where('slug', '=', 'user')->first(); $fullname = explode(' ', $socialUserObject->name); - if (count($fullname) == 1) { + if (count($fullname) === 1) { $fullname[1] = ''; } $username = $socialUserObject->nickname; - if ($username == null) { + if ($username === null) { foreach ($fullname as $name) { $username .= $name; } @@ -110,12 +110,12 @@ public function getSocialHandle($provider, Request $request) $user->profile()->save($profile); $user->save(); - if ($socialData->provider == 'github') { + if ($socialData->provider === 'github') { $user->profile->github_username = $socialUserObject->nickname; } // Twitter User Object details: https://developer.twitter.com/en/docs/tweets/data-dictionary/overview/user-object - if ($socialData->provider == 'twitter') { + if ($socialData->provider === 'twitter') { //$user->profile()->twitter_username = $socialUserObject->screen_name; //If the above fails try (The documentation shows screen_name however so Twitters docs may be out of date.): $user->profile()->twitter_username = $socialUserObject->nickname; @@ -159,12 +159,12 @@ public function checkUserName($username, $email) $username = $this->generateUserName($username); $newCheck = User::where('name', '=', $username)->first(); - if ($newCheck == null) { + if ($newCheck === null) { $newCheck = 0; } else { $newCheck = count($newCheck); } - } while ($newCheck != 0); + } while ($newCheck !== 0); } return $username; diff --git a/app/Http/Controllers/ProfilesController.php b/app/Http/Controllers/ProfilesController.php index e58711b81..a08eb2475 100755 --- a/app/Http/Controllers/ProfilesController.php +++ b/app/Http/Controllers/ProfilesController.php @@ -123,7 +123,7 @@ public function update(UpdateUserProfile $request, $username) $ipAddress = new CaptureIpTrait(); - if ($user->profile == null) { + if ($user->profile === null) { $profile = new Profile(); $profile->fill($input); $user->profile()->save($profile); @@ -149,11 +149,11 @@ public function updateUserAccount(Request $request, $id) { $currentUser = \Auth::user(); $user = User::findOrFail($id); - $emailCheck = ($request->input('email') != '') && ($request->input('email') != $user->email); + $emailCheck = ($request->input('email') !== '') && ($request->input('email') !== $user->email); $ipAddress = new CaptureIpTrait(); $rules = []; - if ($user->name != $request->input('name')) { + if ($user->name !== $request->input('name')) { $usernameRules = [ 'name' => 'required|max:255|unique:users', ]; @@ -212,7 +212,7 @@ public function updateUserPassword(UpdateUserPasswordRequest $request, $id) $user = User::findOrFail($id); $ipAddress = new CaptureIpTrait(); - if ($request->input('password') != null) { + if ($request->input('password') !== null) { $user->password = bcrypt($request->input('password')); } @@ -282,7 +282,7 @@ public function deleteUserAccount(DeleteUserAccount $request, $id) $user = User::findOrFail($id); $ipAddress = new CaptureIpTrait(); - if ($user->id != $currentUser->id) { + if ($user->id !== $currentUser->id) { return redirect('profile/'.$user->name.'/edit')->with('error', trans('profile.errorDeleteNotYour')); } diff --git a/app/Http/Controllers/RestoreUserController.php b/app/Http/Controllers/RestoreUserController.php index e08257d05..e68cda3f0 100755 --- a/app/Http/Controllers/RestoreUserController.php +++ b/app/Http/Controllers/RestoreUserController.php @@ -42,7 +42,7 @@ public function userReActivate(Request $request, $token) $userId = $level1[0][1] / $userIdKey; $user = SoftDeletesController::getDeletedUser($userId); - if (!is_object($user)) { + if (! is_object($user)) { abort(500); } diff --git a/app/Http/Controllers/SoftDeletesController.php b/app/Http/Controllers/SoftDeletesController.php index 7d91ad9df..e3452acfc 100755 --- a/app/Http/Controllers/SoftDeletesController.php +++ b/app/Http/Controllers/SoftDeletesController.php @@ -28,7 +28,7 @@ public function __construct() public static function getDeletedUser($id) { $user = User::onlyTrashed()->where('id', $id)->get(); - if (count($user) != 1) { + if (count($user) !== 1) { return redirect('/users/deleted/')->with('error', trans('usersmanagement.errorUserNotFound')); } diff --git a/app/Http/Controllers/ThemesManagementController.php b/app/Http/Controllers/ThemesManagementController.php index 91b30a8db..7586a85ef 100755 --- a/app/Http/Controllers/ThemesManagementController.php +++ b/app/Http/Controllers/ThemesManagementController.php @@ -133,7 +133,7 @@ public function destroy(Theme $theme) { $default = Theme::findOrFail(Theme::default); - if ($theme->id != $default->id) { + if ($theme->id !== $default->id) { $theme->delete(); return redirect('themes')->with('success', trans('themes.deleteSuccess')); diff --git a/app/Http/Controllers/UsersManagementController.php b/app/Http/Controllers/UsersManagementController.php index 97e225656..4897a4338 100755 --- a/app/Http/Controllers/UsersManagementController.php +++ b/app/Http/Controllers/UsersManagementController.php @@ -158,7 +158,7 @@ public function edit(User $user) */ public function update(Request $request, User $user) { - $emailCheck = ($request->input('email') != '') && ($request->input('email') != $user->email); + $emailCheck = ($request->input('email') !== '') && ($request->input('email') !== $user->email); $ipAddress = new CaptureIpTrait(); if ($emailCheck) { @@ -186,12 +186,12 @@ public function update(Request $request, User $user) $user->email = $request->input('email'); } - if ($request->input('password') != null) { + if ($request->input('password') !== null) { $user->password = bcrypt($request->input('password')); } $userRole = $request->input('role'); - if ($userRole != null) { + if ($userRole !== null) { $user->detachAllRoles(); $user->attachRole($userRole); } @@ -225,7 +225,7 @@ public function destroy(User $user) $currentUser = Auth::user(); $ipAddress = new CaptureIpTrait(); - if ($user->id != $currentUser->id) { + if ($user->id !== $currentUser->id) { $user->deleted_ip_address = $ipAddress->getClientIp(); $user->save(); $user->delete(); diff --git a/app/Http/Middleware/Authenticate.php b/app/Http/Middleware/Authenticate.php index ecbc34245..e21ddf705 100755 --- a/app/Http/Middleware/Authenticate.php +++ b/app/Http/Middleware/Authenticate.php @@ -4,11 +4,11 @@ use Auth; use Closure; +use Illuminate\Auth\Middleware\Authenticate as Middleware; use Illuminate\Contracts\Auth\Guard; use Illuminate\Http\Request; use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Route; -use Illuminate\Auth\Middleware\Authenticate as Middleware; class Authenticate extends Middleware { diff --git a/app/Http/Middleware/CheckCurrentUser.php b/app/Http/Middleware/CheckCurrentUser.php index c270b81d7..4b219a460 100755 --- a/app/Http/Middleware/CheckCurrentUser.php +++ b/app/Http/Middleware/CheckCurrentUser.php @@ -20,7 +20,7 @@ class CheckCurrentUser */ public function handle($request, Closure $next) { - if (!$request->user()) { + if (! $request->user()) { abort(403, 'Unauthorized action.'); } diff --git a/app/Http/Middleware/CheckIsUserActivated.php b/app/Http/Middleware/CheckIsUserActivated.php index 5f4aeb1d9..f45d7194b 100755 --- a/app/Http/Middleware/CheckIsUserActivated.php +++ b/app/Http/Middleware/CheckIsUserActivated.php @@ -39,8 +39,8 @@ public function handle($request, Closure $next) 'welcome', ]; - if (!in_array($currentRoute, $routesAllowed)) { - if ($user && $user->activated != 1) { + if (! in_array($currentRoute, $routesAllowed)) { + if ($user && $user->activated !== 1) { Log::info('Non-activated user attempted to visit '.$currentRoute.'. ', [$user]); return redirect()->route('activation-required') @@ -51,7 +51,7 @@ public function handle($request, Closure $next) } } - if ($user && $user->activated != 1) { + if ($user && $user->activated !== 1) { $activationsCount = Activation::where('user_id', $user->id) ->where('created_at', '>=', Carbon::now()->subHours(config('settings.timePeriod'))) ->count(); @@ -62,7 +62,7 @@ public function handle($request, Closure $next) } if (in_array($currentRoute, $routesAllowed)) { - if ($user && $user->activated == 1) { + if ($user && $user->activated === 1) { Log::info('Activated user attempted to visit '.$currentRoute.'. ', [$user]); if ($user->isAdmin()) { @@ -72,7 +72,7 @@ public function handle($request, Closure $next) return redirect('home'); } - if (!$user) { + if (! $user) { Log::info('Non registered visit to '.$currentRoute.'. '); return redirect()->route('welcome'); diff --git a/app/Http/ViewComposers/ThemeComposer.php b/app/Http/ViewComposers/ThemeComposer.php index ed2b6f8a8..cd351e958 100755 --- a/app/Http/ViewComposers/ThemeComposer.php +++ b/app/Http/ViewComposers/ThemeComposer.php @@ -38,7 +38,7 @@ public function compose(View $view) if ($user->profile) { $theme = Theme::find($user->profile->theme_id); - if ($theme->status == 0) { + if ($theme->status === 0) { $theme = Theme::find(Theme::default); } } diff --git a/app/Logic/Macros/HtmlMacros.php b/app/Logic/Macros/HtmlMacros.php index 25d8d7deb..0529bfb1a 100755 --- a/app/Logic/Macros/HtmlMacros.php +++ b/app/Logic/Macros/HtmlMacros.php @@ -14,10 +14,10 @@ * @return string */ HTML::macro('image_link', function ($url = '', $img = '', $alt = '', $link_name = '', $param = '', $active = true, $ssl = false) { - $url = $ssl == true ? URL::to_secure($url) : URL::to($url); + $url = $ssl === true ? URL::to_secure($url) : URL::to($url); $img = HTML::image($img, $alt); $img .= $link_name; - $link = $active == true ? HTML::link($url, '#', $param) : $img; + $link = $active === true ? HTML::link($url, '#', $param) : $img; $link = str_replace('#', $img, $link); return $link; @@ -36,9 +36,9 @@ * @return string */ HTML::macro('icon_link', function ($url = '', $icon = '', $link_name = '', $param = '', $active = true, $ssl = false) { - $url = $ssl == true ? URL::to_secure($url) : URL::to($url); + $url = $ssl === true ? URL::to_secure($url) : URL::to($url); $icon = ''.$link_name; - $link = $active == true ? HTML::link($url, '#', $param) : $icon; + $link = $active === true ? HTML::link($url, '#', $param) : $icon; $link = str_replace('#', $icon, $link); return $link; @@ -57,16 +57,16 @@ * @return string */ HTML::macro('icon_btn', function ($url = '', $icon = '', $link_name = '', $param = '', $active = true, $ssl = false) { - $url = $ssl == true ? URL::to_secure($url) : URL::to($url); + $url = $ssl === true ? URL::to_secure($url) : URL::to($url); $icon = $link_name.' '; - $link = $active == true ? HTML::link($url, '#', $param) : $icon; + $link = $active === true ? HTML::link($url, '#', $param) : $icon; $link = str_replace('#', $icon, $link); return $link; }); /** - * Show Username + * Show Username. * * @return string */ diff --git a/app/Mail/ExceptionOccured.php b/app/Mail/ExceptionOccured.php index 4a656ea9e..3a6da25b1 100755 --- a/app/Mail/ExceptionOccured.php +++ b/app/Mail/ExceptionOccured.php @@ -35,23 +35,23 @@ public function build() $fromSender = config('exceptions.emailExceptionFrom'); $subject = config('exceptions.emailExceptionSubject'); - if ($emailsTo[0] == null) { + if ($emailsTo[0] === null) { $emailsTo = config('exceptions.emailExceptionsToDefault'); } - if ($ccEmails[0] == null) { + if ($ccEmails[0] === null) { $ccEmails = config('exceptions.emailExceptionCCtoDefault'); } - if ($bccEmails[0] == null) { + if ($bccEmails[0] === null) { $bccEmails = config('exceptions.emailExceptionBCCtoDefault'); } - if (!$fromSender) { + if (! $fromSender) { $fromSender = config('exceptions.emailExceptionFromDefault'); } - if (!$subject) { + if (! $subject) { $subject = config('exceptions.emailExceptionSubjectDefault'); } diff --git a/app/Models/User.php b/app/Models/User.php index 4e07c5c63..b20bce03d 100755 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -131,12 +131,12 @@ public function profiles() * * @param string $name * - * @return boolean + * @return bool */ public function hasProfile($name) { foreach ($this->profiles as $profile) { - if ($profile->name == $name) { + if ($profile->name === $name) { return true; } } @@ -145,7 +145,7 @@ public function hasProfile($name) } /** - * Add/Attach a profile to a user + * Add/Attach a profile to a user. * * @param Profile $profile */ @@ -155,7 +155,7 @@ public function assignProfile(Profile $profile) } /** - * Remove/Detach a profile to a user + * Remove/Detach a profile to a user. * * @param Profile $profile */ diff --git a/app/Traits/ActivationTrait.php b/app/Traits/ActivationTrait.php index 7aa43b847..819c1c1bb 100755 --- a/app/Traits/ActivationTrait.php +++ b/app/Traits/ActivationTrait.php @@ -10,7 +10,7 @@ trait ActivationTrait { public function initiateEmailActivation(User $user) { - if (!config('settings.activation') || !$this->validateEmail($user)) { + if (! config('settings.activation') || ! $this->validateEmail($user)) { return true; } diff --git a/config/cache.php b/config/cache.php index fcca98bab..3d94b82b6 100755 --- a/config/cache.php +++ b/config/cache.php @@ -38,7 +38,7 @@ ], 'array' => [ - 'driver' => 'array', + 'driver' => 'array', 'serialize' => false, ], @@ -78,11 +78,11 @@ ], 'dynamodb' => [ - 'driver' => 'dynamodb', - 'key' => env('AWS_ACCESS_KEY_ID'), - 'secret' => env('AWS_SECRET_ACCESS_KEY'), - 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), - 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'), + 'driver' => 'dynamodb', + 'key' => env('AWS_ACCESS_KEY_ID'), + 'secret' => env('AWS_SECRET_ACCESS_KEY'), + 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), + 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'), 'endpoint' => env('DYNAMODB_ENDPOINT'), ], diff --git a/config/database.php b/config/database.php index 08ddeb42d..0a220afd0 100755 --- a/config/database.php +++ b/config/database.php @@ -36,58 +36,58 @@ 'connections' => [ 'sqlite' => [ - 'driver' => 'sqlite', - 'url' => env('DATABASE_URL'), - 'database' => env('DB_DATABASE', database_path('database.sqlite')), - 'prefix' => '', + 'driver' => 'sqlite', + 'url' => env('DATABASE_URL'), + 'database' => env('DB_DATABASE', database_path('database.sqlite')), + 'prefix' => '', 'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true), ], 'mysql' => [ - 'driver' => 'mysql', - 'url' => env('DATABASE_URL'), - 'host' => env('DB_HOST', '127.0.0.1'), - 'port' => env('DB_PORT', '3306'), - 'database' => env('DB_DATABASE', 'forge'), - 'username' => env('DB_USERNAME', 'forge'), - 'password' => env('DB_PASSWORD', ''), - 'unix_socket' => env('DB_SOCKET', ''), - 'charset' => 'utf8mb4', - 'collation' => 'utf8mb4_unicode_ci', - 'prefix' => '', + 'driver' => 'mysql', + 'url' => env('DATABASE_URL'), + 'host' => env('DB_HOST', '127.0.0.1'), + 'port' => env('DB_PORT', '3306'), + 'database' => env('DB_DATABASE', 'forge'), + 'username' => env('DB_USERNAME', 'forge'), + 'password' => env('DB_PASSWORD', ''), + 'unix_socket' => env('DB_SOCKET', ''), + 'charset' => 'utf8mb4', + 'collation' => 'utf8mb4_unicode_ci', + 'prefix' => '', 'prefix_indexes' => true, - 'strict' => true, - 'engine' => null, - 'options' => extension_loaded('pdo_mysql') ? array_filter([ + 'strict' => true, + 'engine' => null, + 'options' => extension_loaded('pdo_mysql') ? array_filter([ PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), ]) : [], ], 'pgsql' => [ - 'driver' => 'pgsql', - 'url' => env('DATABASE_URL'), - 'host' => env('DB_HOST', '127.0.0.1'), - 'port' => env('DB_PORT', '5432'), - 'database' => env('DB_DATABASE', 'forge'), - 'username' => env('DB_USERNAME', 'forge'), - 'password' => env('DB_PASSWORD', ''), - 'charset' => 'utf8', - 'prefix' => '', + 'driver' => 'pgsql', + 'url' => env('DATABASE_URL'), + 'host' => env('DB_HOST', '127.0.0.1'), + 'port' => env('DB_PORT', '5432'), + 'database' => env('DB_DATABASE', 'forge'), + 'username' => env('DB_USERNAME', 'forge'), + 'password' => env('DB_PASSWORD', ''), + 'charset' => 'utf8', + 'prefix' => '', 'prefix_indexes' => true, - 'schema' => 'public', - 'sslmode' => 'prefer', + 'schema' => 'public', + 'sslmode' => 'prefer', ], 'sqlsrv' => [ - 'driver' => 'sqlsrv', - 'url' => env('DATABASE_URL'), - 'host' => env('DB_HOST', 'localhost'), - 'port' => env('DB_PORT', '1433'), - 'database' => env('DB_DATABASE', 'forge'), - 'username' => env('DB_USERNAME', 'forge'), - 'password' => env('DB_PASSWORD', ''), - 'charset' => 'utf8', - 'prefix' => '', + 'driver' => 'sqlsrv', + 'url' => env('DATABASE_URL'), + 'host' => env('DB_HOST', 'localhost'), + 'port' => env('DB_PORT', '1433'), + 'database' => env('DB_DATABASE', 'forge'), + 'username' => env('DB_USERNAME', 'forge'), + 'password' => env('DB_PASSWORD', ''), + 'charset' => 'utf8', + 'prefix' => '', 'prefix_indexes' => true, ], @@ -123,22 +123,22 @@ 'options' => [ 'cluster' => env('REDIS_CLUSTER', 'redis'), - 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'), + 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'), ], 'default' => [ - 'url' => env('REDIS_URL'), - 'host' => env('REDIS_HOST', '127.0.0.1'), + 'url' => env('REDIS_URL'), + 'host' => env('REDIS_HOST', '127.0.0.1'), 'password' => env('REDIS_PASSWORD', null), - 'port' => env('REDIS_PORT', '6379'), + 'port' => env('REDIS_PORT', '6379'), 'database' => env('REDIS_DB', '0'), ], 'cache' => [ - 'url' => env('REDIS_URL'), - 'host' => env('REDIS_HOST', '127.0.0.1'), + 'url' => env('REDIS_URL'), + 'host' => env('REDIS_HOST', '127.0.0.1'), 'password' => env('REDIS_PASSWORD', null), - 'port' => env('REDIS_PORT', '6379'), + 'port' => env('REDIS_PORT', '6379'), 'database' => env('REDIS_CACHE_DB', '1'), ], diff --git a/config/filesystems.php b/config/filesystems.php index 3dc4d431f..210193ec3 100755 --- a/config/filesystems.php +++ b/config/filesystems.php @@ -45,7 +45,7 @@ 'local' => [ 'driver' => 'local', - 'root' => storage_path('app'), + 'root' => storage_path('app'), ], 'ftp' => [ @@ -62,18 +62,18 @@ ], 'public' => [ - 'driver' => 'local', - 'root' => storage_path('app/public'), - 'url' => env('APP_URL').'/storage', + 'driver' => 'local', + 'root' => storage_path('app/public'), + 'url' => env('APP_URL').'/storage', 'visibility' => 'public', ], 's3' => [ - 'driver' => 's3', - 'key' => env('AWS_ACCESS_KEY_ID'), - 'secret' => env('AWS_SECRET_ACCESS_KEY'), - 'region' => env('AWS_DEFAULT_REGION'), - 'bucket' => env('AWS_BUCKET'), + 'driver' => 's3', + 'key' => env('AWS_ACCESS_KEY_ID'), + 'secret' => env('AWS_SECRET_ACCESS_KEY'), + 'region' => env('AWS_DEFAULT_REGION'), + 'bucket' => env('AWS_BUCKET'), 'endpoint' => env('AWS_URL'), ], diff --git a/config/hashing.php b/config/hashing.php index 842577087..5b10c09d3 100755 --- a/config/hashing.php +++ b/config/hashing.php @@ -44,9 +44,9 @@ */ 'argon' => [ - 'memory' => 1024, + 'memory' => 1024, 'threads' => 2, - 'time' => 2, + 'time' => 2, ], ]; diff --git a/config/logging.php b/config/logging.php index 088c204e2..8874396da 100755 --- a/config/logging.php +++ b/config/logging.php @@ -36,36 +36,36 @@ 'channels' => [ 'stack' => [ - 'driver' => 'stack', - 'channels' => ['single'], + 'driver' => 'stack', + 'channels' => ['single'], 'ignore_exceptions' => false, ], 'single' => [ 'driver' => 'single', - 'path' => storage_path('logs/laravel.log'), - 'level' => 'debug', + 'path' => storage_path('logs/laravel.log'), + 'level' => 'debug', ], 'daily' => [ 'driver' => 'daily', - 'path' => storage_path('logs/laravel.log'), - 'level' => 'debug', - 'days' => 14, + 'path' => storage_path('logs/laravel.log'), + 'level' => 'debug', + 'days' => 14, ], 'slack' => [ - 'driver' => 'slack', - 'url' => env('LOG_SLACK_WEBHOOK_URL'), + 'driver' => 'slack', + 'url' => env('LOG_SLACK_WEBHOOK_URL'), 'username' => 'Laravel Log', - 'emoji' => ':boom:', - 'level' => 'critical', + 'emoji' => ':boom:', + 'level' => 'critical', ], 'papertrail' => [ - 'driver' => 'monolog', - 'level' => 'debug', - 'handler' => SyslogUdpHandler::class, + 'driver' => 'monolog', + 'level' => 'debug', + 'handler' => SyslogUdpHandler::class, 'handler_with' => [ 'host' => env('PAPERTRAIL_URL'), 'port' => env('PAPERTRAIL_PORT'), @@ -73,26 +73,26 @@ ], 'stderr' => [ - 'driver' => 'monolog', - 'handler' => StreamHandler::class, + 'driver' => 'monolog', + 'handler' => StreamHandler::class, 'formatter' => env('LOG_STDERR_FORMATTER'), - 'with' => [ + 'with' => [ 'stream' => 'php://stderr', ], ], 'syslog' => [ 'driver' => 'syslog', - 'level' => 'debug', + 'level' => 'debug', ], 'errorlog' => [ 'driver' => 'errorlog', - 'level' => 'debug', + 'level' => 'debug', ], 'null' => [ - 'driver' => 'monolog', + 'driver' => 'monolog', 'handler' => NullHandler::class, ], diff --git a/config/mail.php b/config/mail.php index 5201bb76f..8d9a0c771 100755 --- a/config/mail.php +++ b/config/mail.php @@ -35,13 +35,13 @@ 'mailers' => [ 'smtp' => [ - 'transport' => 'smtp', - 'host' => env('MAIL_HOST', 'smtp.mailgun.org'), - 'port' => env('MAIL_PORT', 587), + 'transport' => 'smtp', + 'host' => env('MAIL_HOST', 'smtp.mailgun.org'), + 'port' => env('MAIL_PORT', 587), 'encryption' => env('MAIL_ENCRYPTION', 'tls'), - 'username' => env('MAIL_USERNAME'), - 'password' => env('MAIL_PASSWORD'), - 'timeout' => null, + 'username' => env('MAIL_USERNAME'), + 'password' => env('MAIL_PASSWORD'), + 'timeout' => null, ], 'ses' => [ @@ -58,12 +58,12 @@ 'sendmail' => [ 'transport' => 'sendmail', - 'path' => '/usr/sbin/sendmail -bs', + 'path' => '/usr/sbin/sendmail -bs', ], 'log' => [ 'transport' => 'log', - 'channel' => env('MAIL_LOG_CHANNEL'), + 'channel' => env('MAIL_LOG_CHANNEL'), ], 'array' => [ @@ -84,7 +84,7 @@ 'from' => [ 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'), - 'name' => env('MAIL_FROM_NAME', 'Example'), + 'name' => env('MAIL_FROM_NAME', 'Example'), ], /* diff --git a/config/queue.php b/config/queue.php index c6db81391..f627f303c 100755 --- a/config/queue.php +++ b/config/queue.php @@ -35,36 +35,36 @@ ], 'database' => [ - 'driver' => 'database', - 'table' => 'jobs', - 'queue' => 'default', + 'driver' => 'database', + 'table' => 'jobs', + 'queue' => 'default', 'retry_after' => 90, ], 'beanstalkd' => [ - 'driver' => 'beanstalkd', - 'host' => 'localhost', - 'queue' => 'default', + 'driver' => 'beanstalkd', + 'host' => 'localhost', + 'queue' => 'default', 'retry_after' => 90, - 'block_for' => 0, + 'block_for' => 0, ], 'sqs' => [ 'driver' => 'sqs', - 'key' => env('AWS_ACCESS_KEY_ID'), + 'key' => env('AWS_ACCESS_KEY_ID'), 'secret' => env('AWS_SECRET_ACCESS_KEY'), 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'), - 'queue' => env('SQS_QUEUE', 'your-queue-name'), + 'queue' => env('SQS_QUEUE', 'your-queue-name'), 'suffix' => env('SQS_SUFFIX'), 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), ], 'redis' => [ - 'driver' => 'redis', - 'connection' => 'default', - 'queue' => env('REDIS_QUEUE', 'default'), + 'driver' => 'redis', + 'connection' => 'default', + 'queue' => env('REDIS_QUEUE', 'default'), 'retry_after' => 90, - 'block_for' => null, + 'block_for' => null, ], 'social' => [ @@ -88,9 +88,9 @@ */ 'failed' => [ - 'driver' => env('QUEUE_FAILED_DRIVER', 'database'), + 'driver' => env('QUEUE_FAILED_DRIVER', 'database'), 'database' => env('DB_CONNECTION', 'mysql'), - 'table' => 'failed_jobs', + 'table' => 'failed_jobs', ], ]; diff --git a/config/services.php b/config/services.php index 1a0926b75..214d7fb64 100755 --- a/config/services.php +++ b/config/services.php @@ -84,9 +84,9 @@ ], 'linkedin' => [ - 'client_id' => env('LINKEDIN_KEY'), + 'client_id' => env('LINKEDIN_KEY'), 'client_secret' => env('LINKEDIN_SECRET'), - 'redirect' => env('LINKEDIN_REDIRECT_URI') + 'redirect' => env('LINKEDIN_REDIRECT_URI'), ], ]; diff --git a/database/migrations/2016_01_15_105324_create_roles_table.php b/database/migrations/2016_01_15_105324_create_roles_table.php index 91a4269af..1cc999e5e 100644 --- a/database/migrations/2016_01_15_105324_create_roles_table.php +++ b/database/migrations/2016_01_15_105324_create_roles_table.php @@ -17,7 +17,7 @@ public function up() $table = config('roles.rolesTable'); $tableCheck = Schema::connection($connection)->hasTable($table); - if (!$tableCheck) { + if (! $tableCheck) { Schema::connection($connection)->create($table, function (Blueprint $table) { $table->increments('id')->unsigned(); $table->string('name'); diff --git a/database/migrations/2016_01_15_114412_create_role_user_table.php b/database/migrations/2016_01_15_114412_create_role_user_table.php index b3d160a8f..6ce9272cb 100644 --- a/database/migrations/2016_01_15_114412_create_role_user_table.php +++ b/database/migrations/2016_01_15_114412_create_role_user_table.php @@ -18,7 +18,7 @@ public function up() $rolesTable = config('roles.rolesTable'); $tableCheck = Schema::connection($connection)->hasTable($table); - if (!$tableCheck) { + if (! $tableCheck) { Schema::connection($connection)->create($table, function (Blueprint $table) use ($rolesTable) { $table->increments('id')->unsigned(); $table->integer('role_id')->unsigned()->index(); diff --git a/database/migrations/2016_01_26_115212_create_permissions_table.php b/database/migrations/2016_01_26_115212_create_permissions_table.php index 6598a7966..f2fc5f43e 100644 --- a/database/migrations/2016_01_26_115212_create_permissions_table.php +++ b/database/migrations/2016_01_26_115212_create_permissions_table.php @@ -17,7 +17,7 @@ public function up() $table = config('roles.permissionsTable'); $tableCheck = Schema::connection($connection)->hasTable($table); - if (!$tableCheck) { + if (! $tableCheck) { Schema::connection($connection)->create($table, function (Blueprint $table) { $table->increments('id')->unsigned(); $table->string('name'); diff --git a/database/migrations/2016_01_26_115523_create_permission_role_table.php b/database/migrations/2016_01_26_115523_create_permission_role_table.php index 57446f8d8..7c0bed049 100644 --- a/database/migrations/2016_01_26_115523_create_permission_role_table.php +++ b/database/migrations/2016_01_26_115523_create_permission_role_table.php @@ -19,7 +19,7 @@ public function up() $rolesTable = config('roles.rolesTable'); $tableCheck = Schema::connection($connection)->hasTable($table); - if (!$tableCheck) { + if (! $tableCheck) { Schema::connection($connection)->create($table, function (Blueprint $table) use ($permissionsTable, $rolesTable) { $table->increments('id')->unsigned(); $table->integer('permission_id')->unsigned()->index(); diff --git a/database/migrations/2016_02_09_132439_create_permission_user_table.php b/database/migrations/2016_02_09_132439_create_permission_user_table.php index ef93db76e..7ec1c00a3 100644 --- a/database/migrations/2016_02_09_132439_create_permission_user_table.php +++ b/database/migrations/2016_02_09_132439_create_permission_user_table.php @@ -18,7 +18,7 @@ public function up() $permissionsTable = config('roles.permissionsTable'); $tableCheck = Schema::connection($connection)->hasTable($table); - if (!$tableCheck) { + if (! $tableCheck) { Schema::connection($connection)->create($table, function (Blueprint $table) use ($permissionsTable) { $table->increments('id')->unsigned(); $table->integer('permission_id')->unsigned()->index(); diff --git a/database/migrations/2017_12_09_070937_create_two_step_auth_table.php b/database/migrations/2017_12_09_070937_create_two_step_auth_table.php index 63576a0fd..2fc7ac154 100644 --- a/database/migrations/2017_12_09_070937_create_two_step_auth_table.php +++ b/database/migrations/2017_12_09_070937_create_two_step_auth_table.php @@ -19,7 +19,7 @@ public function up() $table = $twoStepAuth->getTableName(); $tableCheck = Schema::connection($connection)->hasTable($table); - if (!$tableCheck) { + if (! $tableCheck) { Schema::connection($connection)->create($table, function (Blueprint $table) { $table->increments('id'); $table->unsignedBigInteger('userId')->unsigned()->index(); diff --git a/database/migrations/2019_02_19_032636_create_laravel_blocker_types_table.php b/database/migrations/2019_02_19_032636_create_laravel_blocker_types_table.php index 061f61ee6..ecd731213 100644 --- a/database/migrations/2019_02_19_032636_create_laravel_blocker_types_table.php +++ b/database/migrations/2019_02_19_032636_create_laravel_blocker_types_table.php @@ -19,7 +19,7 @@ public function up() $table = $blocked->getTableName(); $tableCheck = Schema::connection($connection)->hasTable($table); - if (!$tableCheck) { + if (! $tableCheck) { Schema::connection($connection)->create($table, function (Blueprint $table) { $table->increments('id'); $table->string('slug')->unique(); diff --git a/database/migrations/2019_02_19_045158_create_laravel_blocker_table.php b/database/migrations/2019_02_19_045158_create_laravel_blocker_table.php index d9841f8f8..c8b025ad9 100644 --- a/database/migrations/2019_02_19_045158_create_laravel_blocker_table.php +++ b/database/migrations/2019_02_19_045158_create_laravel_blocker_table.php @@ -20,7 +20,7 @@ public function up() $table = $blocked->getTableName(); $tableCheck = Schema::connection($connection)->hasTable($table); - if (!$tableCheck) { + if (! $tableCheck) { Schema::connection($connection)->create($table, function (Blueprint $table) { $blockedType = new BlockedType(); $connectionType = $blockedType->getConnectionName(); diff --git a/resources/lang/en/terms.php b/resources/lang/en/terms.php index 3c87b5e3d..40aa65d8c 100644 --- a/resources/lang/en/terms.php +++ b/resources/lang/en/terms.php @@ -21,5 +21,3 @@ 'term8' => '', ], ]; - -