From 4eecc04a00000160ab199b179b832bea54019e08 Mon Sep 17 00:00:00 2001 From: HDVinnie Date: Sun, 5 May 2019 20:40:37 +0000 Subject: [PATCH] Apply fixes from StyleCI [ci skip] [skip ci] --- app/Helpers/Markdown.php | 2 +- .../Auth/ApplicationController.php | 11 ++++------ .../Auth/ForgotPasswordController.php | 22 +++++++++---------- .../Auth/ForgotUsernameController.php | 3 +-- .../Controllers/NotificationController.php | 2 +- 5 files changed, 17 insertions(+), 23 deletions(-) diff --git a/app/Helpers/Markdown.php b/app/Helpers/Markdown.php index 30fa183ad7..5e161407cf 100644 --- a/app/Helpers/Markdown.php +++ b/app/Helpers/Markdown.php @@ -479,7 +479,7 @@ protected function blockHeader($Line) protected function blockList($Line) { - list($name, $pattern) = $Line['text'][0] <= '-' ? ['ul', '[*+-]'] : ['ol', '[0-9]+[.]']; + [$name, $pattern] = $Line['text'][0] <= '-' ? ['ul', '[*+-]'] : ['ol', '[0-9]+[.]']; if (preg_match('/^('.$pattern.'[ ]+)(.*)/', $Line['text'], $matches)) { $Block = [ diff --git a/app/Http/Controllers/Auth/ApplicationController.php b/app/Http/Controllers/Auth/ApplicationController.php index 6e1151907c..ff907addba 100644 --- a/app/Http/Controllers/Auth/ApplicationController.php +++ b/app/Http/Controllers/Auth/ApplicationController.php @@ -54,8 +54,7 @@ public function store(Request $request) 'links.*' => 'filled', 'links' => 'min:2', ]); - } - else { + } else { $v = validator($request->all(), [ 'type' => 'required', 'email' => 'required|email|unique:invites|unique:users|unique:applications|email_list:allow', @@ -65,7 +64,7 @@ public function store(Request $request) 'links.*' => 'filled', 'links' => 'min:2', 'g-recaptcha-response' => 'required|recaptcha', - ]); + ]); } } elseif (config('email-white-blacklist.enabled') === 'block') { if (config('captcha.enabled') == false) { @@ -78,8 +77,7 @@ public function store(Request $request) 'links.*' => 'filled', 'links' => 'min:2', ]); - } - else { + } else { $v = validator($request->all(), [ 'type' => 'required', 'email' => 'required|email|unique:invites|unique:users|unique:applications|email_list:block', @@ -102,8 +100,7 @@ public function store(Request $request) 'links.*' => 'filled', 'links' => 'min:2', ]); - } - else { + } else { $v = validator($request->all(), [ 'type' => 'required', 'email' => 'required|email|unique:invites|unique:users|unique:applications', diff --git a/app/Http/Controllers/Auth/ForgotPasswordController.php b/app/Http/Controllers/Auth/ForgotPasswordController.php index 25c1307a69..dcf7421828 100755 --- a/app/Http/Controllers/Auth/ForgotPasswordController.php +++ b/app/Http/Controllers/Auth/ForgotPasswordController.php @@ -14,10 +14,9 @@ namespace App\Http\Controllers\Auth; +use Illuminate\Http\Request; use App\Http\Controllers\Controller; use Illuminate\Foundation\Auth\SendsPasswordResetEmails; -use Illuminate\Http\Request; -use Illuminate\Support\Facades\Password; class ForgotPasswordController extends Controller { @@ -27,17 +26,16 @@ public function __construct() { $this->middleware('guest'); } - + protected function validateEmail(Request $request) { if (config('captcha.enabled') == false) { - $request->validate(['email' => 'required|email']); - } - else{ - $request->validate([ - 'email' => 'required|email', - 'g-recaptcha-response' => 'required|recaptcha', - ]); - } - } + $request->validate(['email' => 'required|email']); + } else { + $request->validate([ + 'email' => 'required|email', + 'g-recaptcha-response' => 'required|recaptcha', + ]); + } + } } diff --git a/app/Http/Controllers/Auth/ForgotUsernameController.php b/app/Http/Controllers/Auth/ForgotUsernameController.php index f0c747744c..83ebb28a29 100644 --- a/app/Http/Controllers/Auth/ForgotUsernameController.php +++ b/app/Http/Controllers/Auth/ForgotUsernameController.php @@ -44,8 +44,7 @@ public function sendUsernameReminder(Request $request) $v = validator($request->all(), [ 'email' => 'required', ]); - } - else { + } else { $v = validator($request->all(), [ 'email' => 'required', 'g-recaptcha-response' => 'required|recaptcha', diff --git a/app/Http/Controllers/NotificationController.php b/app/Http/Controllers/NotificationController.php index 6913486031..4e0a08698e 100644 --- a/app/Http/Controllers/NotificationController.php +++ b/app/Http/Controllers/NotificationController.php @@ -15,8 +15,8 @@ namespace App\Http\Controllers; use Carbon\Carbon; -use Illuminate\Http\Request; use App\Models\Notification; +use Illuminate\Http\Request; class NotificationController extends Controller {