Fix code quality with rector [skip ci]

This commit is contained in:
James Cole
2025-11-09 09:08:03 +01:00
parent d2610be790
commit 68183a0a0e
209 changed files with 1021 additions and 1248 deletions

View File

@@ -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);
}
}

View File

@@ -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);