Code cleanup that (hopefully) matches style CI

This commit is contained in:
James Cole
2020-03-17 15:02:57 +01:00
parent 2b6c3fd743
commit 24129ab69c
21 changed files with 266 additions and 257 deletions

View File

@@ -29,6 +29,7 @@ use FireflyIII\Exceptions\FireflyException;
use Illuminate\Auth\AuthenticationException;
use Illuminate\Contracts\Auth\Factory as Auth;
use Illuminate\Database\QueryException;
use Illuminate\Http\Request;
/**
* Class Authenticate
@@ -38,14 +39,14 @@ class Authenticate
/**
* The authentication factory instance.
*
* @var \Illuminate\Contracts\Auth\Factory
* @var Auth
*/
protected $auth;
/**
* Create a new middleware instance.
*
* @param \Illuminate\Contracts\Auth\Factory $auth
* @param Auth $auth
*
* @return void
*/
@@ -57,14 +58,14 @@ class Authenticate
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @param string[] ...$guards
*
* @return mixed
* @param Request $request
* @param Closure $next
* @param string[] ...$guards
*
* @throws AuthenticationException
* @throws FireflyException
* @return mixed
*
*/
public function handle($request, Closure $next, ...$guards)
{
@@ -78,11 +79,11 @@ class Authenticate
* Determine if the user is logged in to any of the given guards.
*
* @param $request
* @param array $guards
* @param array $guards
*
* @return mixed
* @throws AuthenticationException
* @throws FireflyException
* @return mixed
*/
protected function authenticate($request, array $guards)
{
@@ -96,10 +97,10 @@ class Authenticate
// do an extra check on user object.
/** @noinspection PhpUndefinedMethodInspection */
$user = $this->auth->authenticate();
if (1 === (int)$user->blocked) {
$message = (string)trans('firefly.block_account_logout');
if (1 === (int) $user->blocked) {
$message = (string) trans('firefly.block_account_logout');
if ('email_changed' === $user->blocked_code) {
$message = (string)trans('firefly.email_changed_logout');
$message = (string) trans('firefly.email_changed_logout');
}
app('session')->flash('logoutMessage', $message);
/** @noinspection PhpUndefinedMethodInspection */