mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-15 08:35:00 +00:00
Import statements and update configuration.
This commit is contained in:
@@ -31,6 +31,8 @@ use Illuminate\Console\Command;
|
||||
use Illuminate\Contracts\Encryption\DecryptException;
|
||||
use Illuminate\Support\Facades\Crypt;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use JsonException;
|
||||
use stdClass;
|
||||
|
||||
class RemovesDatabaseDecryption extends Command
|
||||
{
|
||||
@@ -105,13 +107,13 @@ class RemovesDatabaseDecryption extends Command
|
||||
{
|
||||
$rows = DB::table($table)->get(['id', $field]);
|
||||
|
||||
/** @var \stdClass $row */
|
||||
/** @var stdClass $row */
|
||||
foreach ($rows as $row) {
|
||||
$this->decryptRow($table, $field, $row);
|
||||
}
|
||||
}
|
||||
|
||||
private function decryptRow(string $table, string $field, \stdClass $row): void
|
||||
private function decryptRow(string $table, string $field, stdClass $row): void
|
||||
{
|
||||
$original = $row->{$field};
|
||||
if (null === $original) {
|
||||
@@ -168,7 +170,7 @@ class RemovesDatabaseDecryption extends Command
|
||||
// try to json_decrypt the value.
|
||||
try {
|
||||
$newValue = \Safe\json_decode($value, true, 512, JSON_THROW_ON_ERROR) ?? $value;
|
||||
} catch (\JsonException $e) {
|
||||
} catch (JsonException $e) {
|
||||
$message = sprintf('Could not JSON decode preference row #%d: %s. This does not have to be a problem.', $id, $e->getMessage());
|
||||
$this->friendlyError($message);
|
||||
app('log')->warning($message);
|
||||
|
@@ -36,6 +36,7 @@ use FireflyIII\Services\Internal\Destroy\JournalDestroyService;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Exception;
|
||||
|
||||
class UpgradesToGroups extends Command
|
||||
{
|
||||
@@ -103,7 +104,7 @@ class UpgradesToGroups extends Command
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws \Exception
|
||||
* @throws Exception
|
||||
*/
|
||||
private function makeGroupsFromSplitJournals(): void
|
||||
{
|
||||
@@ -119,7 +120,7 @@ class UpgradesToGroups extends Command
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws \Exception
|
||||
* @throws Exception
|
||||
*/
|
||||
private function makeMultiGroup(TransactionJournal $journal): void
|
||||
{
|
||||
|
Reference in New Issue
Block a user