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