mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-17 20:08:52 +00:00
Fix code quality with rector [skip ci]
This commit is contained in:
@@ -23,6 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Services\Password;
|
||||
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use GuzzleHttp\Client;
|
||||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use GuzzleHttp\Exception\RequestException;
|
||||
@@ -50,28 +51,28 @@ class PwndVerifierV2 implements Verifier
|
||||
'timeout' => 3.1415,
|
||||
];
|
||||
|
||||
app('log')->debug(sprintf('hash prefix is %s', $prefix));
|
||||
app('log')->debug(sprintf('rest is %s', $rest));
|
||||
Log::debug(sprintf('hash prefix is %s', $prefix));
|
||||
Log::debug(sprintf('rest is %s', $rest));
|
||||
|
||||
try {
|
||||
$client = new Client();
|
||||
$res = $client->request('GET', $url, $opt);
|
||||
} catch (GuzzleException|RequestException $e) {
|
||||
app('log')->error(sprintf('Could not verify password security: %s', $e->getMessage()));
|
||||
Log::error(sprintf('Could not verify password security: %s', $e->getMessage()));
|
||||
|
||||
return true;
|
||||
}
|
||||
app('log')->debug(sprintf('Status code returned is %d', $res->getStatusCode()));
|
||||
Log::debug(sprintf('Status code returned is %d', $res->getStatusCode()));
|
||||
if (404 === $res->getStatusCode()) {
|
||||
return true;
|
||||
}
|
||||
$strpos = stripos($res->getBody()->getContents(), $rest);
|
||||
if (false === $strpos) {
|
||||
app('log')->debug(sprintf('%s was not found in result body. Return true.', $rest));
|
||||
Log::debug(sprintf('%s was not found in result body. Return true.', $rest));
|
||||
|
||||
return true;
|
||||
}
|
||||
app('log')->debug(sprintf('Found %s, return FALSE.', $rest));
|
||||
Log::debug(sprintf('Found %s, return FALSE.', $rest));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user