Code cleanup.

This commit is contained in:
James Cole
2023-12-20 19:35:52 +01:00
parent c4f6366642
commit 64ec0cf62e
997 changed files with 12908 additions and 28136 deletions

View File

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