mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Chore: Add phpdocs
This commit is contained in:
parent
7840e37e1a
commit
775504acb6
@ -279,6 +279,9 @@ class DestroyController extends Controller
|
||||
$tagRepository->destroyAll();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
private function destroyObjectGroups(): void
|
||||
{
|
||||
/** @var ObjectGroupRepositoryInterface $repository */
|
||||
|
@ -29,6 +29,8 @@ use FireflyIII\Api\V1\Requests\Data\Export\ExportRequest;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Support\Export\ExportDataGenerator;
|
||||
use Illuminate\Http\Response as LaravelResponse;
|
||||
use Psr\Container\ContainerExceptionInterface;
|
||||
use Psr\Container\NotFoundExceptionInterface;
|
||||
|
||||
/**
|
||||
* Class ExportController
|
||||
@ -74,6 +76,8 @@ class ExportController extends Controller
|
||||
*
|
||||
* @return LaravelResponse
|
||||
* @throws FireflyException
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
private function returnExport(string $key): LaravelResponse
|
||||
{
|
||||
|
@ -37,6 +37,9 @@ use FireflyIII\Models\TransactionGroup;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
|
||||
/**
|
||||
* Class PurgeController
|
||||
*/
|
||||
class PurgeController extends Controller
|
||||
{
|
||||
/**
|
||||
|
@ -30,6 +30,9 @@ use FireflyIII\Repositories\LinkType\LinkTypeRepositoryInterface;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
|
||||
/**
|
||||
* Class DestroyController
|
||||
*/
|
||||
class DestroyController extends Controller
|
||||
{
|
||||
private LinkTypeRepositoryInterface $repository;
|
||||
|
@ -37,6 +37,9 @@ use League\Fractal\Pagination\IlluminatePaginatorAdapter;
|
||||
use League\Fractal\Resource\Collection as FractalCollection;
|
||||
use League\Fractal\Resource\Item;
|
||||
|
||||
/**
|
||||
* Class ShowController
|
||||
*/
|
||||
class ShowController extends Controller
|
||||
{
|
||||
private LinkTypeRepositoryInterface $repository;
|
||||
|
@ -35,6 +35,9 @@ use FireflyIII\User;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use League\Fractal\Resource\Item;
|
||||
|
||||
/**
|
||||
* Class StoreController
|
||||
*/
|
||||
class StoreController extends Controller
|
||||
{
|
||||
use TransactionFilter;
|
||||
|
@ -34,6 +34,9 @@ use FireflyIII\User;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use League\Fractal\Resource\Item;
|
||||
|
||||
/**
|
||||
* Class UpdateController
|
||||
*/
|
||||
class UpdateController extends Controller
|
||||
{
|
||||
private JournalRepositoryInterface $journalRepository;
|
||||
|
@ -138,7 +138,6 @@ class ConfigurationController extends Controller
|
||||
*
|
||||
* @return JsonResponse
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws FireflyException
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function show(string $configKey): JsonResponse
|
||||
|
@ -28,6 +28,8 @@ use FireflyIII\Api\V1\Requests\System\CronRequest;
|
||||
use FireflyIII\Support\Http\Controllers\CronRunner;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Psr\Container\ContainerExceptionInterface;
|
||||
use Psr\Container\NotFoundExceptionInterface;
|
||||
|
||||
/**
|
||||
* Class CronController
|
||||
@ -44,6 +46,8 @@ class CronController extends Controller
|
||||
* @param string $token
|
||||
*
|
||||
* @return JsonResponse
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function cron(CronRequest $request, string $token): JsonResponse
|
||||
{
|
||||
|
@ -35,6 +35,9 @@ use League\Fractal\Pagination\IlluminatePaginatorAdapter;
|
||||
use League\Fractal\Resource\Collection as FractalCollection;
|
||||
use League\Fractal\Resource\Item;
|
||||
|
||||
/**
|
||||
* Class MessageController
|
||||
*/
|
||||
class MessageController extends Controller
|
||||
{
|
||||
public const RESOURCE_KEY = 'webhook_messages';
|
||||
|
@ -38,6 +38,9 @@ class ExportRequest extends FormRequest
|
||||
use ChecksLogin;
|
||||
use ConvertsDataTypes;
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getAll(): array
|
||||
{
|
||||
$result = [
|
||||
|
@ -59,6 +59,7 @@ class UpdateRequest extends FormRequest
|
||||
* Get all data. Is pretty complex because of all the ??-statements.
|
||||
*
|
||||
* @return array
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function getAll(): array
|
||||
{
|
||||
@ -152,6 +153,7 @@ class UpdateRequest extends FormRequest
|
||||
* Get transaction data.
|
||||
*
|
||||
* @return array
|
||||
* @throws FireflyException
|
||||
*/
|
||||
private function getTransactionData(): array
|
||||
{
|
||||
|
@ -27,6 +27,9 @@ use FireflyIII\Support\Request\ChecksLogin;
|
||||
use FireflyIII\Support\Request\ConvertsDataTypes;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
/**
|
||||
* Class PreferenceStoreRequest
|
||||
*/
|
||||
class PreferenceStoreRequest extends FormRequest
|
||||
{
|
||||
use ChecksLogin;
|
||||
|
@ -28,6 +28,9 @@ use FireflyIII\Support\Request\ChecksLogin;
|
||||
use FireflyIII\Support\Request\ConvertsDataTypes;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
/**
|
||||
* Class PreferenceUpdateRequest
|
||||
*/
|
||||
class PreferenceUpdateRequest extends FormRequest
|
||||
{
|
||||
use ChecksLogin;
|
||||
|
@ -31,6 +31,9 @@ use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Pagination\LengthAwarePaginator;
|
||||
|
||||
/**
|
||||
* Class ListController
|
||||
*/
|
||||
class ListController extends Controller
|
||||
{
|
||||
private BudgetRepositoryInterface $repository;
|
||||
|
@ -32,6 +32,9 @@ use FireflyIII\Transformers\V2\BudgetLimitTransformer;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Pagination\LengthAwarePaginator;
|
||||
|
||||
/**
|
||||
* Class ListController
|
||||
*/
|
||||
class ListController extends Controller
|
||||
{
|
||||
private BudgetLimitRepositoryInterface $repository;
|
||||
|
@ -24,6 +24,9 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Api\V2\Controllers\System;
|
||||
|
||||
/**
|
||||
* Class ConfigurationController
|
||||
*/
|
||||
class ConfigurationController
|
||||
{
|
||||
}
|
||||
|
@ -26,6 +26,9 @@ namespace FireflyIII\Api\V2\Controllers\System;
|
||||
|
||||
use FireflyIII\Api\V2\Controllers\Controller;
|
||||
|
||||
/**
|
||||
* Class DebugController
|
||||
*/
|
||||
class DebugController extends Controller
|
||||
{
|
||||
}
|
||||
|
@ -97,6 +97,9 @@ class DeleteEmptyJournals extends Command
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
private function deleteEmptyJournals(): void
|
||||
{
|
||||
$count = 0;
|
||||
|
@ -65,6 +65,9 @@ class DeleteOrphanedTransactions extends Command
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
private function deleteOrphanedJournals(): void
|
||||
{
|
||||
$set = TransactionJournal::leftJoin('transaction_groups', 'transaction_journals.transaction_group_id', 'transaction_groups.id')
|
||||
|
@ -89,6 +89,7 @@ class FixAccountTypes extends Command
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
* @throws FireflyException
|
||||
* @throws JsonException
|
||||
*/
|
||||
private function inspectJournal(TransactionJournal $journal): void
|
||||
{
|
||||
|
@ -29,6 +29,9 @@ class TriggerCreditCalculation extends Command
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
private function processAccounts(): void
|
||||
{
|
||||
$accounts = Account::leftJoin('account_types', 'accounts.account_type_id', 'account_types.id')
|
||||
|
@ -38,6 +38,8 @@ use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use InvalidArgumentException;
|
||||
use Psr\Container\ContainerExceptionInterface;
|
||||
use Psr\Container\NotFoundExceptionInterface;
|
||||
|
||||
/**
|
||||
* Class ExportData
|
||||
@ -83,6 +85,8 @@ class ExportData extends Command
|
||||
*
|
||||
* @return int
|
||||
* @throws FireflyException
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function handle(): int
|
||||
{
|
||||
|
@ -73,6 +73,10 @@ class UpdateGroupInformation extends Command
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param User $user
|
||||
* @return void
|
||||
*/
|
||||
private function updateGroupInfo(User $user): void
|
||||
{
|
||||
$group = $user->userGroup;
|
||||
|
@ -92,7 +92,6 @@ class ForceDecimalSize extends Command
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function handle(): int
|
||||
{
|
||||
@ -110,6 +109,9 @@ class ForceDecimalSize extends Command
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
private function determineDatabaseType(): void
|
||||
{
|
||||
// switch stuff based on database connection:
|
||||
@ -155,6 +157,7 @@ class ForceDecimalSize extends Command
|
||||
* This method loops all enabled currencies and then calls the method that will fix all objects in this currency.
|
||||
*
|
||||
* @return void
|
||||
* @throws FireflyException
|
||||
*/
|
||||
private function correctAmountsByCurrency(): void
|
||||
{
|
||||
|
@ -32,6 +32,9 @@ use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
/**
|
||||
* Class ForceMigration
|
||||
*/
|
||||
class ForceMigration extends Command
|
||||
{
|
||||
use ShowsFriendlyMessages;
|
||||
@ -79,6 +82,9 @@ class ForceMigration extends Command
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
private function forceMigration(): void
|
||||
{
|
||||
DB::commit();
|
||||
|
@ -64,6 +64,8 @@ class Cron extends Command
|
||||
|
||||
/**
|
||||
* @return int
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function handle(): int
|
||||
{
|
||||
|
@ -35,6 +35,8 @@ use FireflyIII\Repositories\User\UserRepositoryInterface;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Psr\Container\ContainerExceptionInterface;
|
||||
use Psr\Container\NotFoundExceptionInterface;
|
||||
|
||||
/**
|
||||
* Class AccountCurrencies
|
||||
@ -94,6 +96,8 @@ class AccountCurrencies extends Command
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
private function isExecuted(): bool
|
||||
{
|
||||
|
@ -31,6 +31,9 @@ use Illuminate\Support\Facades\Log;
|
||||
use Psr\Container\ContainerExceptionInterface;
|
||||
use Psr\Container\NotFoundExceptionInterface;
|
||||
|
||||
/**
|
||||
* Class AppendBudgetLimitPeriods
|
||||
*/
|
||||
class AppendBudgetLimitPeriods extends Command
|
||||
{
|
||||
use ShowsFriendlyMessages;
|
||||
@ -54,7 +57,6 @@ class AppendBudgetLimitPeriods extends Command
|
||||
*
|
||||
* @return int
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws FireflyException
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function handle(): int
|
||||
|
@ -61,7 +61,6 @@ class BackToJournals extends Command
|
||||
*
|
||||
* @return int
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws FireflyException
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function handle(): int
|
||||
|
@ -51,6 +51,8 @@ class DecryptDatabase extends Command
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return int
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function handle(): int
|
||||
{
|
||||
|
@ -58,7 +58,6 @@ class MigrateJournalNotes extends Command
|
||||
*
|
||||
* @return int
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws FireflyException
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function handle(): int
|
||||
|
@ -60,7 +60,6 @@ class MigrateRecurrenceMeta extends Command
|
||||
*
|
||||
* @return int
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws FireflyException
|
||||
* @throws JsonException
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
|
@ -59,7 +59,6 @@ class MigrateRecurrenceType extends Command
|
||||
*
|
||||
* @return int
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws FireflyException
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function handle(): int
|
||||
|
@ -58,7 +58,6 @@ class MigrateTagLocations extends Command
|
||||
*
|
||||
* @return int
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws FireflyException
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function handle(): int
|
||||
@ -89,6 +88,9 @@ class MigrateTagLocations extends Command
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
private function migrateTagLocations(): void
|
||||
{
|
||||
$tags = Tag::get();
|
||||
|
@ -64,6 +64,8 @@ class MigrateToGroups extends Command
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return int
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function handle(): int
|
||||
{
|
||||
|
@ -61,7 +61,6 @@ class OtherCurrenciesCorrections extends Command
|
||||
*
|
||||
* @return int
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws FireflyException
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function handle(): int
|
||||
|
@ -62,6 +62,8 @@ class TransferCurrenciesCorrections extends Command
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return int
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function handle(): int
|
||||
{
|
||||
|
@ -53,7 +53,6 @@ class UpgradeLiabilities extends Command
|
||||
*
|
||||
* @return int
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws FireflyException
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function handle(): int
|
||||
|
@ -56,7 +56,6 @@ class UpgradeLiabilitiesEight extends Command
|
||||
*
|
||||
* @return int
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws FireflyException
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function handle(): int
|
||||
|
@ -24,6 +24,9 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Enums;
|
||||
|
||||
/**
|
||||
* Class RecurrenceRepetitionWeekend
|
||||
*/
|
||||
enum RecurrenceRepetitionWeekend: int
|
||||
{
|
||||
case WEEKEND_DO_NOTHING = 1;
|
||||
|
@ -24,6 +24,9 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Enums;
|
||||
|
||||
/**
|
||||
* Class UserRoleEnum
|
||||
*/
|
||||
enum UserRoleEnum: string
|
||||
{
|
||||
case CHANGE_PIGGY_BANKS = 'change_piggies';
|
||||
|
@ -24,6 +24,9 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Enums;
|
||||
|
||||
/**
|
||||
* Class WebhookDelivery
|
||||
*/
|
||||
enum WebhookDelivery: int
|
||||
{
|
||||
//case XML = 200;
|
||||
|
@ -24,6 +24,9 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Enums;
|
||||
|
||||
/**
|
||||
* Class WebhookResponse
|
||||
*/
|
||||
enum WebhookResponse: int
|
||||
{
|
||||
case TRANSACTIONS = 200;
|
||||
|
@ -26,6 +26,9 @@ namespace FireflyIII\Events;
|
||||
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
/**
|
||||
* Class NewVersionAvailable
|
||||
*/
|
||||
class NewVersionAvailable extends Event
|
||||
{
|
||||
use SerializesModels;
|
||||
|
@ -25,6 +25,9 @@ namespace FireflyIII\Events;
|
||||
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
/**
|
||||
* Class RequestedSendWebhookMessages
|
||||
*/
|
||||
class RequestedSendWebhookMessages extends Event
|
||||
{
|
||||
use SerializesModels;
|
||||
|
@ -41,7 +41,6 @@ class APIEventHandler
|
||||
*
|
||||
* @param AccessTokenCreated $event
|
||||
*
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function accessTokenCreated(AccessTokenCreated $event): void
|
||||
{
|
||||
|
@ -480,6 +480,7 @@ class GroupCollector implements GroupCollectorInterface
|
||||
* Return the groups.
|
||||
*
|
||||
* @return Collection
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function getGroups(): Collection
|
||||
{
|
||||
|
@ -48,7 +48,6 @@ class FiscalHelper implements FiscalHelperInterface
|
||||
* @param Carbon $date
|
||||
*
|
||||
* @return Carbon date object
|
||||
* @throws FireflyException
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
|
@ -161,6 +161,7 @@ class ReconcileController extends Controller
|
||||
*
|
||||
* @return RedirectResponse|Redirector
|
||||
* @throws DuplicateTransactionException
|
||||
* @throws JsonException
|
||||
*/
|
||||
public function submit(ReconciliationStoreRequest $request, Account $account, Carbon $start, Carbon $end)
|
||||
{
|
||||
|
@ -63,7 +63,6 @@ class ConfigurationController extends Controller
|
||||
* Show configuration index.
|
||||
*
|
||||
* @return Factory|View
|
||||
* @throws FireflyException
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
|
@ -58,7 +58,6 @@ class HomeController extends Controller
|
||||
* Index of the admin.
|
||||
*
|
||||
* @return Factory|View
|
||||
* @throws FireflyException
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
@ -83,6 +82,10 @@ class HomeController extends Controller
|
||||
return view('admin.index', compact('title', 'mainTitleIcon', 'email', 'notifications', 'slackUrl'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
* @return RedirectResponse
|
||||
*/
|
||||
public function notifications(Request $request): RedirectResponse
|
||||
{
|
||||
foreach (config('firefly.admin_notifications') as $item) {
|
||||
|
@ -89,7 +89,7 @@ class UserController extends Controller
|
||||
|
||||
/**
|
||||
* @param InvitedUser $invitedUser
|
||||
* @return RedirectResponse
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function deleteInvite(InvitedUser $invitedUser): JsonResponse
|
||||
{
|
||||
|
@ -79,7 +79,6 @@ class NoCategoryController extends Controller
|
||||
*
|
||||
* @return Factory|View
|
||||
* @throws FireflyException
|
||||
* @throws JsonException
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
@ -119,7 +118,6 @@ class NoCategoryController extends Controller
|
||||
* @param Request $request
|
||||
*
|
||||
* @return Factory|View
|
||||
* @throws FireflyException
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
|
@ -72,7 +72,6 @@ class ReportController extends Controller
|
||||
* @param Carbon $end
|
||||
*
|
||||
* @return JsonResponse
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function netWorth(Collection $accounts, Carbon $start, Carbon $end): JsonResponse
|
||||
{
|
||||
|
@ -32,6 +32,8 @@ use FireflyIII\Support\Export\ExportDataGenerator;
|
||||
use Illuminate\Contracts\View\Factory;
|
||||
use Illuminate\Http\Response as LaravelResponse;
|
||||
use Illuminate\View\View;
|
||||
use Psr\Container\ContainerExceptionInterface;
|
||||
use Psr\Container\NotFoundExceptionInterface;
|
||||
|
||||
/**
|
||||
* Class IndexController
|
||||
@ -65,6 +67,8 @@ class IndexController extends Controller
|
||||
/**
|
||||
* @return LaravelResponse
|
||||
* @throws FireflyException
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function export(): LaravelResponse
|
||||
{
|
||||
|
@ -145,9 +145,6 @@ class RecurrenceController extends Controller
|
||||
* @param Request $request
|
||||
*
|
||||
* @return JsonResponse
|
||||
* @throws FireflyException
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function suggest(Request $request): JsonResponse
|
||||
{
|
||||
|
@ -28,6 +28,9 @@ use FireflyIII\Support\Request\ChecksLogin;
|
||||
use FireflyIII\Support\Request\ConvertsDataTypes;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
/**
|
||||
* Class InviteUserFormRequest
|
||||
*/
|
||||
class InviteUserFormRequest extends FormRequest
|
||||
{
|
||||
use ConvertsDataTypes;
|
||||
|
@ -27,6 +27,9 @@ use FireflyIII\Support\Request\ChecksLogin;
|
||||
use FireflyIII\Support\Request\ConvertsDataTypes;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
/**
|
||||
* Class TriggerRecurrenceRequest
|
||||
*/
|
||||
class TriggerRecurrenceRequest extends FormRequest
|
||||
{
|
||||
use ConvertsDataTypes;
|
||||
|
@ -124,6 +124,12 @@ class DownloadExchangeRates implements ShouldQueue
|
||||
$this->saveRates($currency, $date, $json['rates']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param TransactionCurrency $currency
|
||||
* @param Carbon $date
|
||||
* @param array $rates
|
||||
* @return void
|
||||
*/
|
||||
private function saveRates(TransactionCurrency $currency, Carbon $date, array $rates): void
|
||||
{
|
||||
foreach ($rates as $code => $rate) {
|
||||
@ -166,6 +172,13 @@ class DownloadExchangeRates implements ShouldQueue
|
||||
return $currency;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param TransactionCurrency $from
|
||||
* @param TransactionCurrency $to
|
||||
* @param Carbon $date
|
||||
* @param float $rate
|
||||
* @return void
|
||||
*/
|
||||
private function saveRate(TransactionCurrency $from, TransactionCurrency $to, Carbon $date, float $rate): void
|
||||
{
|
||||
foreach ($this->users as $user) {
|
||||
|
@ -29,6 +29,9 @@ use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
/**
|
||||
* Class BillWarningMail
|
||||
*/
|
||||
class BillWarningMail extends Mailable
|
||||
{
|
||||
use Queueable;
|
||||
|
@ -28,6 +28,9 @@ use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
/**
|
||||
* Class InvitationMail
|
||||
*/
|
||||
class InvitationMail extends Mailable
|
||||
{
|
||||
use Queueable;
|
||||
|
@ -23,6 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Mail;
|
||||
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Models\TransactionGroup;
|
||||
use FireflyIII\Transformers\TransactionGroupTransformer;
|
||||
use Illuminate\Bus\Queueable;
|
||||
@ -69,6 +70,10 @@ class ReportNewJournalsMail extends Mailable
|
||||
->subject((string)trans_choice('email.new_journals_subject', $this->groups->count()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
* @throws FireflyException
|
||||
*/
|
||||
private function transform(): void
|
||||
{
|
||||
/** @var TransactionGroupTransformer $transformer */
|
||||
|
@ -126,6 +126,9 @@ class AvailableBudget extends Model
|
||||
return $this->belongsTo(TransactionCurrency::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Attribute
|
||||
*/
|
||||
protected function amount(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
|
@ -71,8 +71,7 @@ class InvitedUser extends Model
|
||||
*
|
||||
* @param string $value
|
||||
*
|
||||
* @return WebhookAttempt
|
||||
* @throws NotFoundHttpException
|
||||
* @return InvitedUser
|
||||
*/
|
||||
public static function routeBinder(string $value): InvitedUser
|
||||
{
|
||||
|
@ -51,10 +51,6 @@ use Illuminate\Support\Carbon;
|
||||
* @method static Builder|UserGroup whereUpdatedAt($value)
|
||||
* @property-read Collection<int, Account> $accounts
|
||||
* @property-read int|null $accounts_count
|
||||
* @property-read Collection<int, Account> $accounts
|
||||
* @property-read Collection<int, Account> $accounts
|
||||
* @property-read Collection<int, Account> $accounts
|
||||
* @property-read Collection<int, \FireflyIII\Models\Account> $accounts
|
||||
* @mixin Eloquent
|
||||
*/
|
||||
class UserGroup extends Model
|
||||
|
@ -29,6 +29,9 @@ use Illuminate\Notifications\Messages\MailMessage;
|
||||
use Illuminate\Notifications\Messages\SlackMessage;
|
||||
use Illuminate\Notifications\Notification;
|
||||
|
||||
/**
|
||||
* Class NewAccessToken
|
||||
*/
|
||||
class NewAccessToken extends Notification
|
||||
{
|
||||
use Queueable;
|
||||
|
@ -28,6 +28,9 @@ use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Notifications\Messages\MailMessage;
|
||||
use Illuminate\Notifications\Notification;
|
||||
|
||||
/**
|
||||
* Class TransactionCreation
|
||||
*/
|
||||
class TransactionCreation extends Notification
|
||||
{
|
||||
use Queueable;
|
||||
|
@ -31,6 +31,9 @@ use Illuminate\Notifications\Messages\SlackMessage;
|
||||
use Illuminate\Notifications\Notification;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
/**
|
||||
* Class UserLogin
|
||||
*/
|
||||
class UserLogin extends Notification
|
||||
{
|
||||
use Queueable;
|
||||
|
@ -28,6 +28,9 @@ use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Notifications\Messages\MailMessage;
|
||||
use Illuminate\Notifications\Notification;
|
||||
|
||||
/**
|
||||
* Class UserNewPassword
|
||||
*/
|
||||
class UserNewPassword extends Notification
|
||||
{
|
||||
use Queueable;
|
||||
|
@ -28,6 +28,9 @@ use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Notifications\Messages\MailMessage;
|
||||
use Illuminate\Notifications\Notification;
|
||||
|
||||
/**
|
||||
* Class UserRegistration
|
||||
*/
|
||||
class UserRegistration extends Notification
|
||||
{
|
||||
use Queueable;
|
||||
|
@ -770,6 +770,7 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
*
|
||||
* @return Account
|
||||
* @throws FireflyException
|
||||
* @throws JsonException
|
||||
*/
|
||||
public function update(Account $account, array $data): Account
|
||||
{
|
||||
|
@ -873,6 +873,9 @@ class BudgetRepository implements BudgetRepositoryInterface
|
||||
return $newBudget;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getMaxOrder(): int
|
||||
{
|
||||
return (int)$this->user->budgets()->max('order');
|
||||
|
@ -169,6 +169,11 @@ class LinkTypeRepository implements LinkTypeRepositoryInterface
|
||||
return $query->get(['journal_links.*']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param TransactionJournal $one
|
||||
* @param TransactionJournal $two
|
||||
* @return TransactionJournalLink|null
|
||||
*/
|
||||
public function getLink(TransactionJournal $one, TransactionJournal $two): ?TransactionJournalLink
|
||||
{
|
||||
$left = TransactionJournalLink::whereDestinationId($one->id)->whereSourceId($two->id)->first();
|
||||
|
@ -43,6 +43,12 @@ trait ModifiesPiggyBanks
|
||||
{
|
||||
use CreatesObjectGroups;
|
||||
|
||||
/**
|
||||
* @param PiggyBankRepetition $repetition
|
||||
* @param string $amount
|
||||
* @param TransactionJournal $journal
|
||||
* @return void
|
||||
*/
|
||||
public function addAmountToRepetition(PiggyBankRepetition $repetition, string $amount, TransactionJournal $journal): void
|
||||
{
|
||||
Log::debug(sprintf('addAmountToRepetition: %s', $amount));
|
||||
@ -56,6 +62,12 @@ trait ModifiesPiggyBanks
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param PiggyBank $piggyBank
|
||||
* @param string $amount
|
||||
* @param TransactionJournal|null $journal
|
||||
* @return bool
|
||||
*/
|
||||
public function removeAmount(PiggyBank $piggyBank, string $amount, ?TransactionJournal $journal = null): bool
|
||||
{
|
||||
$repetition = $this->getRepetition($piggyBank);
|
||||
|
@ -45,6 +45,12 @@ interface PiggyBankRepositoryInterface
|
||||
*/
|
||||
public function addAmount(PiggyBank $piggyBank, string $amount, ?TransactionJournal $journal = null): bool;
|
||||
|
||||
/**
|
||||
* @param PiggyBankRepetition $repetition
|
||||
* @param string $amount
|
||||
* @param TransactionJournal $journal
|
||||
* @return void
|
||||
*/
|
||||
public function addAmountToRepetition(PiggyBankRepetition $repetition, string $amount, TransactionJournal $journal): void;
|
||||
|
||||
/**
|
||||
|
@ -567,6 +567,7 @@ class RecurringRepository implements RecurringRepositoryInterface
|
||||
*
|
||||
* @return Recurrence
|
||||
* @throws FireflyException
|
||||
* @throws JsonException
|
||||
*/
|
||||
public function store(array $data): Recurrence
|
||||
{
|
||||
|
@ -399,7 +399,13 @@ trait AccountServiceTrait
|
||||
* Create the opposing "credit liability" transaction for credit liabilities.
|
||||
*
|
||||
*
|
||||
* @param Account $account
|
||||
* @param string $direction
|
||||
* @param string $openingBalance
|
||||
* @param Carbon $openingBalanceDate
|
||||
* @return TransactionGroup
|
||||
* @throws FireflyException
|
||||
* @throws JsonException
|
||||
*/
|
||||
protected function updateCreditTransaction(Account $account, string $direction, string $openingBalance, Carbon $openingBalanceDate): TransactionGroup
|
||||
{
|
||||
@ -611,6 +617,7 @@ trait AccountServiceTrait
|
||||
*
|
||||
* @return TransactionGroup
|
||||
* @throws FireflyException
|
||||
* @throws JsonException
|
||||
*/
|
||||
protected function updateOBGroupV2(Account $account, string $openingBalance, Carbon $openingBalanceDate): TransactionGroup
|
||||
{
|
||||
|
@ -34,6 +34,9 @@ use FireflyIII\Models\TransactionType;
|
||||
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
/**
|
||||
* Class CreditRecalculateService
|
||||
*/
|
||||
class CreditRecalculateService
|
||||
{
|
||||
private ?Account $account;
|
||||
@ -206,8 +209,7 @@ class CreditRecalculateService
|
||||
* @param Account $account
|
||||
* @param string $direction
|
||||
* @param Transaction $transaction
|
||||
* @param string $amount
|
||||
*
|
||||
* @param string $leftOfDebt
|
||||
* @return string
|
||||
*/
|
||||
private function processTransaction(Account $account, string $direction, Transaction $transaction, string $leftOfDebt): string
|
||||
|
@ -241,6 +241,10 @@ class AccountUpdateService
|
||||
return $account;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $array
|
||||
* @return array
|
||||
*/
|
||||
private function getTypeIds(array $array): array
|
||||
{
|
||||
$return = [];
|
||||
|
@ -47,6 +47,7 @@ class GroupUpdateService
|
||||
* @return TransactionGroup
|
||||
* @throws DuplicateTransactionException
|
||||
* @throws FireflyException
|
||||
* @throws JsonException
|
||||
*/
|
||||
public function update(TransactionGroup $transactionGroup, array $data): TransactionGroup
|
||||
{
|
||||
|
@ -212,6 +212,8 @@ class RecurrenceUpdateService
|
||||
*
|
||||
* @param Recurrence $recurrence
|
||||
* @param array $transactions
|
||||
* @throws FireflyException
|
||||
* @throws \JsonException
|
||||
*/
|
||||
private function updateTransactions(Recurrence $recurrence, array $transactions): void
|
||||
{
|
||||
|
@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* Copyright (c) 2023 Antonio Spinelli https://github.com/tonicospinelli
|
||||
*
|
||||
@ -24,12 +26,18 @@ namespace FireflyIII\Support\Calendar;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Support\Calendar\Exceptions\IntervalException;
|
||||
|
||||
/**
|
||||
* Class Calculator
|
||||
*/
|
||||
class Calculator
|
||||
{
|
||||
const DEFAULT_INTERVAL = 1;
|
||||
public const DEFAULT_INTERVAL = 1;
|
||||
private static array $intervals = [];
|
||||
private static ?\SplObjectStorage $intervalMap = null;
|
||||
|
||||
/**
|
||||
* @return \SplObjectStorage
|
||||
*/
|
||||
private static function loadIntervalMap(): \SplObjectStorage
|
||||
{
|
||||
if (self::$intervalMap != null) {
|
||||
@ -44,16 +52,28 @@ class Calculator
|
||||
return self::$intervalMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Periodicity $periodicity
|
||||
* @return bool
|
||||
*/
|
||||
private static function containsInterval(Periodicity $periodicity): bool
|
||||
{
|
||||
return self::loadIntervalMap()->contains($periodicity);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Periodicity $periodicity
|
||||
* @return bool
|
||||
*/
|
||||
public function isAvailablePeriodicity(Periodicity $periodicity): bool
|
||||
{
|
||||
return self::containsInterval($periodicity);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $skip
|
||||
* @return int
|
||||
*/
|
||||
private function skipInterval(int $skip): int
|
||||
{
|
||||
return self::DEFAULT_INTERVAL + $skip;
|
||||
|
@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* Copyright (c) 2023 Antonio Spinelli https://github.com/tonicospinelli
|
||||
*
|
||||
@ -23,6 +25,9 @@ namespace FireflyIII\Support\Calendar\Exceptions;
|
||||
|
||||
use FireflyIII\Support\Calendar\Periodicity;
|
||||
|
||||
/**
|
||||
* Class IntervalException
|
||||
*/
|
||||
final class IntervalException extends \Exception
|
||||
{
|
||||
protected $message = 'The periodicity %s is unknown. Choose one of available periodicity: %s';
|
||||
@ -30,13 +35,19 @@ final class IntervalException extends \Exception
|
||||
public readonly Periodicity $periodicity;
|
||||
public readonly array $availableIntervals;
|
||||
|
||||
/**
|
||||
* @param Periodicity $periodicity
|
||||
* @param array $intervals
|
||||
* @param int $code
|
||||
* @param \Throwable|null $previous
|
||||
* @return IntervalException
|
||||
*/
|
||||
public static function unavailable(
|
||||
Periodicity $periodicity,
|
||||
array $intervals,
|
||||
int $code = 0,
|
||||
?\Throwable $previous = null
|
||||
): IntervalException
|
||||
{
|
||||
): IntervalException {
|
||||
$message = sprintf(
|
||||
'The periodicity %s is unknown. Choose one of available periodicity: %s',
|
||||
$periodicity->name,
|
||||
|
@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* Copyright (c) 2023 Antonio Spinelli <https://github.com/tonicospinelli>
|
||||
*
|
||||
@ -21,6 +23,9 @@
|
||||
|
||||
namespace FireflyIII\Support\Calendar;
|
||||
|
||||
/**
|
||||
* Class Periodicity
|
||||
*/
|
||||
enum Periodicity
|
||||
{
|
||||
case Daily;
|
||||
|
@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* Copyright (c) 2023 Antonio Spinelli <https://github.com/tonicospinelli>
|
||||
*
|
||||
@ -21,7 +23,10 @@
|
||||
|
||||
namespace FireflyIII\Support\Calendar\Periodicity;
|
||||
|
||||
/**
|
||||
* Class Bimonthly
|
||||
*/
|
||||
final class Bimonthly extends Monthly
|
||||
{
|
||||
const INTERVAL = 2;
|
||||
public const INTERVAL = 2;
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* Copyright (c) 2023 Antonio Spinelli <https://github.com/tonicospinelli>
|
||||
*
|
||||
@ -23,8 +25,16 @@ namespace FireflyIII\Support\Calendar\Periodicity;
|
||||
|
||||
use Carbon\Carbon;
|
||||
|
||||
/**
|
||||
* Class Daily
|
||||
*/
|
||||
final class Daily extends Interval
|
||||
{
|
||||
/**
|
||||
* @param Carbon $date
|
||||
* @param int $interval
|
||||
* @return Carbon
|
||||
*/
|
||||
public function nextDate(Carbon $date, int $interval = 1): Carbon
|
||||
{
|
||||
return ($date->clone())->addDays($this->skip($interval));
|
||||
|
@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* Copyright (c) 2023 Antonio Spinelli <https://github.com/tonicospinelli>
|
||||
*
|
||||
@ -21,7 +23,10 @@
|
||||
|
||||
namespace FireflyIII\Support\Calendar\Periodicity;
|
||||
|
||||
/**
|
||||
* Class Fortnightly
|
||||
*/
|
||||
final class Fortnightly extends Weekly
|
||||
{
|
||||
const INTERVAL = 2;
|
||||
public const INTERVAL = 2;
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* Copyright (c) 2023 Antonio Spinelli <https://github.com/tonicospinelli>
|
||||
*
|
||||
@ -21,7 +23,10 @@
|
||||
|
||||
namespace FireflyIII\Support\Calendar\Periodicity;
|
||||
|
||||
/**
|
||||
* Class HalfYearly
|
||||
*/
|
||||
final class HalfYearly extends Monthly
|
||||
{
|
||||
const INTERVAL = 6;
|
||||
public const INTERVAL = 6;
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* Copyright (c) 2023 Antonio Spinelli <https://github.com/tonicospinelli>
|
||||
*
|
||||
@ -23,7 +25,15 @@ namespace FireflyIII\Support\Calendar\Periodicity;
|
||||
|
||||
use Carbon\Carbon;
|
||||
|
||||
/**
|
||||
* Interface Interspacable
|
||||
*/
|
||||
interface Interspacable
|
||||
{
|
||||
/**
|
||||
* @param Carbon $date
|
||||
* @param int $interval
|
||||
* @return Carbon
|
||||
*/
|
||||
public function nextDate(Carbon $date, int $interval = 1): Carbon;
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* Copyright (c) 2023 Antonio Spinelli <https://github.com/tonicospinelli>
|
||||
*
|
||||
@ -21,10 +23,17 @@
|
||||
|
||||
namespace FireflyIII\Support\Calendar\Periodicity;
|
||||
|
||||
/**
|
||||
* Class Interval
|
||||
*/
|
||||
abstract class Interval implements Interspacable
|
||||
{
|
||||
const INTERVAL = 1;
|
||||
public const INTERVAL = 1;
|
||||
|
||||
/**
|
||||
* @param int $skip
|
||||
* @return int
|
||||
*/
|
||||
public function skip(int $skip): int
|
||||
{
|
||||
return static::INTERVAL * $skip;
|
||||
|
@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* Copyright (c) 2023 Antonio Spinelli <https://github.com/tonicospinelli>
|
||||
*
|
||||
@ -23,8 +25,16 @@ namespace FireflyIII\Support\Calendar\Periodicity;
|
||||
|
||||
use Carbon\Carbon;
|
||||
|
||||
/**
|
||||
* Class Monthly
|
||||
*/
|
||||
class Monthly extends Interval
|
||||
{
|
||||
/**
|
||||
* @param Carbon $date
|
||||
* @param int $interval
|
||||
* @return Carbon
|
||||
*/
|
||||
public function nextDate(Carbon $date, int $interval = 1): Carbon
|
||||
{
|
||||
return ($date->clone())->addMonthsNoOverflow($this->skip($interval));
|
||||
|
@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* Copyright (c) 2023 Antonio Spinelli <https://github.com/tonicospinelli>
|
||||
*
|
||||
@ -21,7 +23,10 @@
|
||||
|
||||
namespace FireflyIII\Support\Calendar\Periodicity;
|
||||
|
||||
/**
|
||||
* Class Quarterly
|
||||
*/
|
||||
final class Quarterly extends Monthly
|
||||
{
|
||||
const INTERVAL = 3;
|
||||
public const INTERVAL = 3;
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* Copyright (c) 2023 Antonio Spinelli <https://github.com/tonicospinelli>
|
||||
*
|
||||
@ -23,8 +25,16 @@ namespace FireflyIII\Support\Calendar\Periodicity;
|
||||
|
||||
use Carbon\Carbon;
|
||||
|
||||
/**
|
||||
* Class Weekly
|
||||
*/
|
||||
class Weekly extends Interval
|
||||
{
|
||||
/**
|
||||
* @param Carbon $date
|
||||
* @param int $interval
|
||||
* @return Carbon
|
||||
*/
|
||||
public function nextDate(Carbon $date, int $interval = 1): Carbon
|
||||
{
|
||||
return ($date->clone())->addWeeks($this->skip($interval));
|
||||
|
@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* Copyright (c) 2023 Antonio Spinelli <https://github.com/tonicospinelli>
|
||||
*
|
||||
@ -23,8 +25,16 @@ namespace FireflyIII\Support\Calendar\Periodicity;
|
||||
|
||||
use Carbon\Carbon;
|
||||
|
||||
/**
|
||||
* Class Yearly
|
||||
*/
|
||||
final class Yearly extends Interval
|
||||
{
|
||||
/**
|
||||
* @param Carbon $date
|
||||
* @param int $interval
|
||||
* @return Carbon
|
||||
*/
|
||||
public function nextDate(Carbon $date, int $interval = 1): Carbon
|
||||
{
|
||||
return ($date->clone())->addYearsNoOverflow($this->skip($interval));
|
||||
|
@ -142,6 +142,8 @@ class ExportDataGenerator
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @throws CannotInsertRecord
|
||||
* @throws Exception
|
||||
* @throws FireflyException
|
||||
*/
|
||||
private function exportAccounts(): string
|
||||
@ -227,6 +229,8 @@ class ExportDataGenerator
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @throws CannotInsertRecord
|
||||
* @throws Exception
|
||||
* @throws FireflyException
|
||||
*/
|
||||
private function exportBills(): string
|
||||
@ -294,6 +298,8 @@ class ExportDataGenerator
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @throws CannotInsertRecord
|
||||
* @throws Exception
|
||||
* @throws FireflyException
|
||||
*/
|
||||
private function exportBudgets(): string
|
||||
@ -359,6 +365,8 @@ class ExportDataGenerator
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @throws CannotInsertRecord
|
||||
* @throws Exception
|
||||
* @throws FireflyException
|
||||
*/
|
||||
private function exportCategories(): string
|
||||
@ -408,6 +416,8 @@ class ExportDataGenerator
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @throws CannotInsertRecord
|
||||
* @throws Exception
|
||||
* @throws FireflyException
|
||||
*/
|
||||
private function exportPiggies(): string
|
||||
@ -486,6 +496,8 @@ class ExportDataGenerator
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @throws CannotInsertRecord
|
||||
* @throws Exception
|
||||
* @throws FireflyException
|
||||
*/
|
||||
private function exportRecurring(): string
|
||||
@ -648,6 +660,8 @@ class ExportDataGenerator
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @throws CannotInsertRecord
|
||||
* @throws Exception
|
||||
* @throws FireflyException
|
||||
*/
|
||||
private function exportRules(): string
|
||||
@ -777,8 +791,10 @@ class ExportDataGenerator
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @throws FireflyException
|
||||
* @throws CannotInsertRecord
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws Exception
|
||||
* @throws FireflyException
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
private function exportTags(): string
|
||||
@ -838,6 +854,8 @@ class ExportDataGenerator
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @throws CannotInsertRecord
|
||||
* @throws Exception
|
||||
* @throws FireflyException
|
||||
*/
|
||||
private function exportTransactions(): string
|
||||
|
@ -253,6 +253,13 @@ trait ConvertsExchangeRates
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $amount
|
||||
* @param TransactionCurrency $from
|
||||
* @param TransactionCurrency $to
|
||||
* @param Carbon|null $date
|
||||
* @return string
|
||||
*/
|
||||
private function convertAmount(string $amount, TransactionCurrency $from, TransactionCurrency $to, ?Carbon $date = null): string
|
||||
{
|
||||
Log::debug(sprintf('Converting %s from %s to %s', $amount, $from->code, $to->code));
|
||||
|
@ -40,6 +40,9 @@ class Navigation
|
||||
{
|
||||
private Calculator $calculator;
|
||||
|
||||
/**
|
||||
* @param Calculator|null $calculator
|
||||
*/
|
||||
public function __construct(Calculator $calculator = null)
|
||||
{
|
||||
$this->calculator = ($calculator instanceof Calculator) ?: new Calculator();
|
||||
|
@ -58,6 +58,7 @@ trait AdministrationTrait
|
||||
|
||||
/**
|
||||
* @return void
|
||||
* @throws FireflyException
|
||||
*/
|
||||
private function refreshAdministration(): void
|
||||
{
|
||||
@ -74,6 +75,10 @@ trait AdministrationTrait
|
||||
throw new FireflyException(sprintf('Cannot validate administration for user #%d', $this->user->id));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Authenticatable|User|null $user
|
||||
* @return void
|
||||
*/
|
||||
public function setUser(Authenticatable | User | null $user): void
|
||||
{
|
||||
if (null !== $user) {
|
||||
|
@ -210,6 +210,10 @@ trait ConvertsDataTypes
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|null $string
|
||||
* @return Carbon|null
|
||||
*/
|
||||
protected function convertDateTime(?string $string): ?Carbon
|
||||
{
|
||||
$value = $this->get($string);
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user