mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-05-04 21:23:36 +00:00
Code cleanup.
This commit is contained in:
@@ -29,7 +29,6 @@ use FireflyIII\Models\Recurrence;
|
||||
use FireflyIII\Models\RecurrenceMeta;
|
||||
use FireflyIII\Models\RecurrenceTransactionMeta;
|
||||
use Illuminate\Console\Command;
|
||||
use JsonException;
|
||||
use Psr\Container\ContainerExceptionInterface;
|
||||
use Psr\Container\NotFoundExceptionInterface;
|
||||
|
||||
@@ -49,9 +48,8 @@ class MigrateRecurrenceMeta extends Command
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return int
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws JsonException
|
||||
* @throws \JsonException
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function handle(): int
|
||||
@@ -76,7 +74,6 @@ class MigrateRecurrenceMeta extends Command
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
@@ -91,14 +88,14 @@ class MigrateRecurrenceMeta extends Command
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
* @throws JsonException
|
||||
* @throws \JsonException
|
||||
*/
|
||||
private function migrateMetaData(): int
|
||||
{
|
||||
$count = 0;
|
||||
// get all recurrence meta data:
|
||||
$collection = RecurrenceMeta::with('recurrence')->get();
|
||||
|
||||
/** @var RecurrenceMeta $meta */
|
||||
foreach ($collection as $meta) {
|
||||
$count += $this->migrateEntry($meta);
|
||||
@@ -108,14 +105,11 @@ class MigrateRecurrenceMeta extends Command
|
||||
}
|
||||
|
||||
/**
|
||||
* @param RecurrenceMeta $meta
|
||||
*
|
||||
* @return int
|
||||
* @throws JsonException
|
||||
* @throws \JsonException
|
||||
*/
|
||||
private function migrateEntry(RecurrenceMeta $meta): int
|
||||
{
|
||||
/** @var Recurrence|null $recurrence */
|
||||
/** @var null|Recurrence $recurrence */
|
||||
$recurrence = $meta->recurrence;
|
||||
if (null === $recurrence) {
|
||||
return 0;
|
||||
@@ -143,9 +137,6 @@ class MigrateRecurrenceMeta extends Command
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private function markAsExecuted(): void
|
||||
{
|
||||
app('fireflyconfig')->set(self::CONFIG_NAME, true);
|
||||
|
||||
Reference in New Issue
Block a user