mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-12 01:42:32 +00:00
Fix code quality with rector [skip ci]
This commit is contained in:
@@ -24,6 +24,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Support\System;
|
||||
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use Ramsey\Uuid\Uuid;
|
||||
|
||||
@@ -37,7 +38,7 @@ trait GeneratesInstallationId
|
||||
try {
|
||||
$config = app('fireflyconfig')->get('installation_id');
|
||||
} catch (FireflyException) {
|
||||
app('log')->info('Could not create or generate installation ID. Do not continue.');
|
||||
Log::info('Could not create or generate installation ID. Do not continue.');
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -50,7 +51,7 @@ trait GeneratesInstallationId
|
||||
if (null === $config) {
|
||||
$uuid4 = Uuid::uuid4();
|
||||
$uniqueId = (string)$uuid4;
|
||||
app('log')->info(sprintf('Created Firefly III installation ID %s', $uniqueId));
|
||||
Log::info(sprintf('Created Firefly III installation ID %s', $uniqueId));
|
||||
app('fireflyconfig')->set('installation_id', $uniqueId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Support\System;
|
||||
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Support\Facades\FireflyConfig;
|
||||
use Illuminate\Contracts\Encryption\DecryptException;
|
||||
@@ -69,15 +70,11 @@ class OAuthKeys
|
||||
$privateKey = (string)FireflyConfig::get(self::PRIVATE_KEY)?->data;
|
||||
$publicKey = (string)FireflyConfig::get(self::PUBLIC_KEY)?->data;
|
||||
} catch (ContainerExceptionInterface|FireflyException|NotFoundExceptionInterface $e) {
|
||||
app('log')->error(sprintf('Could not validate keysInDatabase(): %s', $e->getMessage()));
|
||||
app('log')->error($e->getTraceAsString());
|
||||
Log::error(sprintf('Could not validate keysInDatabase(): %s', $e->getMessage()));
|
||||
Log::error($e->getTraceAsString());
|
||||
}
|
||||
}
|
||||
if ('' !== $privateKey && '' !== $publicKey) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
return '' !== $privateKey && '' !== $publicKey;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -95,8 +92,8 @@ class OAuthKeys
|
||||
$privateContent = Crypt::decrypt($privateKey);
|
||||
$publicContent = Crypt::decrypt($publicKey);
|
||||
} catch (DecryptException $e) {
|
||||
app('log')->error('Could not decrypt pub/private keypair.');
|
||||
app('log')->error($e->getMessage());
|
||||
Log::error('Could not decrypt pub/private keypair.');
|
||||
Log::error($e->getMessage());
|
||||
|
||||
// delete config vars from DB:
|
||||
FireflyConfig::delete(self::PRIVATE_KEY);
|
||||
|
||||
Reference in New Issue
Block a user