diff --git a/app/Extensions/Illuminate/Auth/Passwords/PasswordBroker.php b/app/Extensions/Illuminate/Auth/Passwords/PasswordBroker.php index 64572cfaa..777e941e8 100644 --- a/app/Extensions/Illuminate/Auth/Passwords/PasswordBroker.php +++ b/app/Extensions/Illuminate/Auth/Passwords/PasswordBroker.php @@ -40,7 +40,7 @@ class PasswordBroker extends IlluminatePasswordBroker $token = $this->tokens->create($user); - if ($callback !== null) { + if ($callback instanceof Closure) { return JsonValueGuard::nullableString($callback($user, $token)) ?? static::RESET_LINK_SENT; } diff --git a/app/Extensions/Illuminate/Auth/Passwords/PasswordBrokerManager.php b/app/Extensions/Illuminate/Auth/Passwords/PasswordBrokerManager.php index 35e4a58e9..6af7bf102 100644 --- a/app/Extensions/Illuminate/Auth/Passwords/PasswordBrokerManager.php +++ b/app/Extensions/Illuminate/Auth/Passwords/PasswordBrokerManager.php @@ -23,17 +23,13 @@ class PasswordBrokerManager extends IlluminatePasswordBrokerManager $config = $this->app->make(ConfigRepository::class); $prefix = "auth.passwords.{$name}"; - if (! $config->has($prefix)) { - throw new InvalidArgumentException("Password resetter [{$name}] is not defined."); - } + throw_unless($config->has($prefix), InvalidArgumentException::class, "Password resetter [{$name}] is not defined."); $users = $this->app->make(AuthManager::class)->createUserProvider( JsonValueGuard::nullableString($config->get("{$prefix}.provider")) ); - if ($users === null) { - throw new InvalidArgumentException("Password resetter [{$name}] has no user provider."); - } + throw_if($users === null, InvalidArgumentException::class, "Password resetter [{$name}] has no user provider."); $key = JsonValueGuard::string($config->get('app.key')); diff --git a/app/Http/Controllers/Api/Client/Servers/FileController.php b/app/Http/Controllers/Api/Client/Servers/FileController.php index ead2e613c..954d24888 100644 --- a/app/Http/Controllers/Api/Client/Servers/FileController.php +++ b/app/Http/Controllers/Api/Client/Servers/FileController.php @@ -417,12 +417,12 @@ class FileController extends ClientApiController try { $contents = $lister->list($server, '/'.implode('/', $segments)); - } catch (DaemonConnectionException $exception) { - if ($exception->getStatusCode() === Response::HTTP_NOT_FOUND) { + } catch (DaemonConnectionException $daemonConnectionException) { + if ($daemonConnectionException->getStatusCode() === Response::HTTP_NOT_FOUND) { return false; } - throw $exception; + throw $daemonConnectionException; } foreach ($contents as $entry) {