mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Code for new release
This commit is contained in:
parent
f43b539470
commit
b557805eeb
@ -1,13 +1,33 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ruleset name="pcsg-generated-ruleset"
|
||||
xmlns="http://pmd.sf.net/ruleset/1.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
<!--
|
||||
~ phpmd.xml
|
||||
~ Copyright (c) 2023 james@firefly-iii.org
|
||||
~
|
||||
~ This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
~
|
||||
~ This program is free software: you can redistribute it and/or modify
|
||||
~ it under the terms of the GNU Affero General Public License as
|
||||
~ published by the Free Software Foundation, either version 3 of the
|
||||
~ License, or (at your option) any later version.
|
||||
~
|
||||
~ This program is distributed in the hope that it will be useful,
|
||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
~ GNU Affero General Public License for more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU Affero General Public License
|
||||
~ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<ruleset name="pcsg-generated-ruleset"
|
||||
xmlns="http://pmd.sf.net/ruleset/1.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
|
||||
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
|
||||
<description>Bla bla</description>
|
||||
|
||||
<!--
|
||||
Commando vanuit firefly directory:
|
||||
<!--
|
||||
Commando vanuit firefly directory:
|
||||
phpmd database,app,tests html /gdrive-all/development/phpmd/phpmd.xml > public/report.html
|
||||
-->
|
||||
|
||||
@ -15,7 +35,7 @@ phpmd database,app,tests html /gdrive-all/development/phpmd/phpmd.xml > public/r
|
||||
<rule ref="rulesets/controversial.xml">
|
||||
<exclude name="CamelCasePropertyName" />
|
||||
</rule>
|
||||
|
||||
|
||||
<!-- clean code -->
|
||||
<rule ref="rulesets/codesize.xml" />
|
||||
<rule ref="rulesets/design.xml" />
|
||||
@ -49,4 +69,4 @@ phpmd database,app,tests html /gdrive-all/development/phpmd/phpmd.xml > public/r
|
||||
|
||||
<!-- no this one -->
|
||||
<!--<rule ref="rulesets/cleancode.xml/StaticAccess" />-->
|
||||
</ruleset>
|
||||
</ruleset>
|
||||
|
@ -63,7 +63,7 @@ class PurgeController extends Controller
|
||||
|
||||
// piggies
|
||||
$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 */
|
||||
foreach ($set as $piggy) {
|
||||
$piggy->forceDelete();
|
||||
|
@ -43,7 +43,7 @@ class CronController extends Controller
|
||||
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/about/getCron
|
||||
*
|
||||
* @param CronRequest $request
|
||||
* @param string $token
|
||||
* @param string $token
|
||||
*
|
||||
* @return JsonResponse
|
||||
* @throws ContainerExceptionInterface
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* ShowController.php
|
||||
* Copyright (c) 2023 james@firefly-iii.org
|
||||
@ -21,6 +21,8 @@ declare(strict_types=1);
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Api\V2\Controllers\Model\Budget;
|
||||
|
||||
use FireflyIII\Api\V2\Controllers\Controller;
|
||||
@ -42,8 +44,7 @@ class ShowController extends Controller
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
public function __construct() {
|
||||
parent::__construct();
|
||||
$this->middleware(
|
||||
function ($request, $next) {
|
||||
@ -59,8 +60,7 @@ class ShowController extends Controller
|
||||
* TODO add URL
|
||||
*
|
||||
*/
|
||||
public function budgeted(DateRequest $request, Budget $budget): JsonResponse
|
||||
{
|
||||
public function budgeted(DateRequest $request, Budget $budget): JsonResponse {
|
||||
$data = $request->getAll();
|
||||
$result = $this->repository->budgetedInPeriodForBudget($budget, $data['start'], $data['end']);
|
||||
$converted = $this->cerSum(array_values($result));
|
||||
@ -73,8 +73,7 @@ class ShowController extends Controller
|
||||
* TODO add URL
|
||||
*
|
||||
*/
|
||||
public function spent(DateRequest $request, Budget $budget): JsonResponse
|
||||
{
|
||||
public function spent(DateRequest $request, Budget $budget): JsonResponse {
|
||||
$data = $request->getAll();
|
||||
$result = $this->repository->spentInPeriodForBudget($budget, $data['start'], $data['end']);
|
||||
$converted = $this->cerSum(array_values($result));
|
||||
|
@ -126,6 +126,7 @@ class CorrectOpeningBalanceCurrencies extends Command
|
||||
/**
|
||||
* @param Account $account
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
private function setCorrectCurrency(Account $account, TransactionJournal $journal): int
|
||||
|
@ -1,5 +1,26 @@
|
||||
<?php
|
||||
|
||||
|
||||
/*
|
||||
* TriggerCreditCalculation.php
|
||||
* Copyright (c) 2023 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Console\Commands\Correction;
|
||||
|
@ -75,6 +75,7 @@ class UpdateGroupInformation extends Command
|
||||
|
||||
/**
|
||||
* @param User $user
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function updateGroupInfo(User $user): void
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* ShowsFriendlyMessages.php
|
||||
* Copyright (c) 2023 james@firefly-iii.org
|
||||
@ -21,6 +21,8 @@ declare(strict_types=1);
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Console\Commands;
|
||||
|
||||
/**
|
||||
@ -30,55 +32,55 @@ trait ShowsFriendlyMessages
|
||||
{
|
||||
/**
|
||||
* @param string $message
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function friendlyError(string $message): void
|
||||
{
|
||||
public function friendlyError(string $message): void {
|
||||
$this->error(sprintf(' [x] %s', trim($message)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $message
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function friendlyInfo(string $message): void
|
||||
{
|
||||
public function friendlyInfo(string $message): void {
|
||||
$this->friendlyNeutral($message);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $message
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function friendlyNeutral(string $message): void
|
||||
{
|
||||
public function friendlyNeutral(string $message): void {
|
||||
$this->line(sprintf(' [i] %s', trim($message)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $message
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function friendlyLine(string $message): void
|
||||
{
|
||||
public function friendlyLine(string $message): void {
|
||||
$this->line(sprintf(' %s', trim($message)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $message
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function friendlyPositive(string $message): void
|
||||
{
|
||||
public function friendlyPositive(string $message): void {
|
||||
$this->info(sprintf(' [✓] %s', trim($message)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $message
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function friendlyWarning(string $message): void
|
||||
{
|
||||
public function friendlyWarning(string $message): void {
|
||||
$this->warn(sprintf(' [!] %s', trim($message)));
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,6 @@ declare(strict_types=1);
|
||||
namespace FireflyIII\Console\Commands\Upgrade;
|
||||
|
||||
use FireflyIII\Console\Commands\ShowsFriendlyMessages;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Models\BudgetLimit;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
@ -25,7 +25,6 @@ namespace FireflyIII\Console\Commands\Upgrade;
|
||||
|
||||
use DB;
|
||||
use FireflyIII\Console\Commands\ShowsFriendlyMessages;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Models\Budget;
|
||||
use FireflyIII\Models\Category;
|
||||
use FireflyIII\Models\Transaction;
|
||||
|
@ -24,7 +24,6 @@ declare(strict_types=1);
|
||||
namespace FireflyIII\Console\Commands\Upgrade;
|
||||
|
||||
use FireflyIII\Console\Commands\ShowsFriendlyMessages;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Models\Note;
|
||||
use FireflyIII\Models\TransactionJournalMeta;
|
||||
use Illuminate\Console\Command;
|
||||
|
@ -25,7 +25,6 @@ declare(strict_types=1);
|
||||
namespace FireflyIII\Console\Commands\Upgrade;
|
||||
|
||||
use FireflyIII\Console\Commands\ShowsFriendlyMessages;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Models\Recurrence;
|
||||
use FireflyIII\Models\RecurrenceMeta;
|
||||
use FireflyIII\Models\RecurrenceTransactionMeta;
|
||||
|
@ -25,7 +25,6 @@ declare(strict_types=1);
|
||||
namespace FireflyIII\Console\Commands\Upgrade;
|
||||
|
||||
use FireflyIII\Console\Commands\ShowsFriendlyMessages;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Models\Recurrence;
|
||||
use FireflyIII\Models\RecurrenceTransaction;
|
||||
use FireflyIII\Models\TransactionType;
|
||||
@ -103,6 +102,7 @@ class MigrateRecurrenceType extends Command
|
||||
|
||||
/**
|
||||
* @param Recurrence $recurrence
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function migrateRecurrence(Recurrence $recurrence): void
|
||||
|
@ -25,7 +25,6 @@ declare(strict_types=1);
|
||||
namespace FireflyIII\Console\Commands\Upgrade;
|
||||
|
||||
use FireflyIII\Console\Commands\ShowsFriendlyMessages;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Models\Location;
|
||||
use FireflyIII\Models\Tag;
|
||||
use Illuminate\Console\Command;
|
||||
|
@ -24,7 +24,6 @@ declare(strict_types=1);
|
||||
namespace FireflyIII\Console\Commands\Upgrade;
|
||||
|
||||
use FireflyIII\Console\Commands\ShowsFriendlyMessages;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Models\Account;
|
||||
use FireflyIII\Models\AccountType;
|
||||
use FireflyIII\Models\Transaction;
|
||||
|
@ -25,7 +25,6 @@ declare(strict_types=1);
|
||||
namespace FireflyIII\Console\Commands\Upgrade;
|
||||
|
||||
use FireflyIII\Console\Commands\ShowsFriendlyMessages;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Factory\AccountMetaFactory;
|
||||
use FireflyIII\Models\Account;
|
||||
use FireflyIII\Models\Transaction;
|
||||
|
@ -25,7 +25,6 @@ declare(strict_types=1);
|
||||
namespace FireflyIII\Console\Commands\Upgrade;
|
||||
|
||||
use FireflyIII\Console\Commands\ShowsFriendlyMessages;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Models\Account;
|
||||
use FireflyIII\Models\AccountType;
|
||||
use FireflyIII\Models\Transaction;
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* Created.php
|
||||
* Copyright (c) 2023 james@firefly-iii.org
|
||||
@ -21,6 +21,8 @@ declare(strict_types=1);
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Events\Model\BudgetLimit;
|
||||
|
||||
use FireflyIII\Events\Event;
|
||||
@ -39,8 +41,7 @@ class Created extends Event
|
||||
/**
|
||||
* @param BudgetLimit $budgetLimit
|
||||
*/
|
||||
public function __construct(BudgetLimit $budgetLimit)
|
||||
{
|
||||
public function __construct(BudgetLimit $budgetLimit) {
|
||||
$this->budgetLimit = $budgetLimit;
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* Created.php
|
||||
* Deleted.php
|
||||
* Copyright (c) 2023 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
@ -21,6 +21,8 @@ declare(strict_types=1);
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Events\Model\BudgetLimit;
|
||||
|
||||
use FireflyIII\Events\Event;
|
||||
@ -39,8 +41,7 @@ class Deleted extends Event
|
||||
/**
|
||||
* @param BudgetLimit $budgetLimit
|
||||
*/
|
||||
public function __construct(BudgetLimit $budgetLimit)
|
||||
{
|
||||
public function __construct(BudgetLimit $budgetLimit) {
|
||||
$this->budgetLimit = $budgetLimit;
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* Created.php
|
||||
* Updated.php
|
||||
* Copyright (c) 2023 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
@ -21,6 +21,8 @@ declare(strict_types=1);
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Events\Model\BudgetLimit;
|
||||
|
||||
use FireflyIII\Events\Event;
|
||||
@ -39,8 +41,7 @@ class Updated extends Event
|
||||
/**
|
||||
* @param BudgetLimit $budgetLimit
|
||||
*/
|
||||
public function __construct(BudgetLimit $budgetLimit)
|
||||
{
|
||||
public function __construct(BudgetLimit $budgetLimit) {
|
||||
$this->budgetLimit = $budgetLimit;
|
||||
}
|
||||
}
|
||||
|
@ -416,6 +416,7 @@ class TransactionJournalFactory
|
||||
/**
|
||||
* @param Account|null $sourceAccount
|
||||
* @param Account|null $destinationAccount
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
private function reconciliationSanityCheck(?Account $sourceAccount, ?Account $destinationAccount): array
|
||||
@ -457,7 +458,7 @@ class TransactionJournalFactory
|
||||
Log::debug('Now in getCurrencyByAccount()');
|
||||
|
||||
return match ($type) {
|
||||
default => $this->getCurrency($currency, $source),
|
||||
default => $this->getCurrency($currency, $source),
|
||||
TransactionType::DEPOSIT => $this->getCurrency($currency, $destination),
|
||||
};
|
||||
}
|
||||
|
@ -58,6 +58,7 @@ interface MessageGeneratorInterface
|
||||
|
||||
/**
|
||||
* @param Collection $webhooks
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setWebhooks(Collection $webhooks): void;
|
||||
|
@ -103,6 +103,7 @@ class StandardMessageGenerator implements MessageGeneratorInterface
|
||||
|
||||
/**
|
||||
* @param Webhook $webhook
|
||||
*
|
||||
* @throws FireflyException
|
||||
* @throws JsonException
|
||||
*/
|
||||
@ -118,6 +119,7 @@ class StandardMessageGenerator implements MessageGeneratorInterface
|
||||
/**
|
||||
* @param Webhook $webhook
|
||||
* @param Model $model
|
||||
*
|
||||
* @throws FireflyException
|
||||
* @throws JsonException
|
||||
*/
|
||||
|
@ -24,7 +24,6 @@ declare(strict_types=1);
|
||||
namespace FireflyIII\Handlers\Events;
|
||||
|
||||
use Exception;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Notifications\User\NewAccessToken;
|
||||
use FireflyIII\Repositories\User\UserRepositoryInterface;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
@ -42,6 +42,7 @@ class AdminEventHandler
|
||||
{
|
||||
/**
|
||||
* @param InvitationCreated $event
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function sendInvitationNotification(InvitationCreated $event): void
|
||||
@ -79,6 +80,7 @@ class AdminEventHandler
|
||||
* Send new version message to admin.
|
||||
*
|
||||
* @param NewVersionAvailable $event
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function sendNewVersion(NewVersionAvailable $event): void
|
||||
|
@ -42,6 +42,7 @@ class AutomationHandler
|
||||
* Respond to the creation of X journals.
|
||||
*
|
||||
* @param RequestedReportOnJournals $event
|
||||
*
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function reportJournals(RequestedReportOnJournals $event): void
|
||||
|
@ -38,6 +38,7 @@ class BillEventHandler
|
||||
{
|
||||
/**
|
||||
* @param WarnUserAboutBill $event
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function warnAboutBill(WarnUserAboutBill $event): void
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* BudgetLimitHandler.php
|
||||
* Copyright (c) 2023 james@firefly-iii.org
|
||||
@ -21,6 +21,8 @@ declare(strict_types=1);
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Handlers\Events\Model;
|
||||
|
||||
use FireflyIII\Events\Model\BudgetLimit\Created;
|
||||
@ -44,20 +46,20 @@ class BudgetLimitHandler
|
||||
{
|
||||
/**
|
||||
* @param Created $event
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function created(Created $event): void
|
||||
{
|
||||
public function created(Created $event): void {
|
||||
Log::debug(sprintf('BudgetLimitHandler::created(#%s)', $event->budgetLimit->id));
|
||||
$this->updateAvailableBudget($event->budgetLimit);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param BudgetLimit $budgetLimit
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function updateAvailableBudget(BudgetLimit $budgetLimit): void
|
||||
{
|
||||
private function updateAvailableBudget(BudgetLimit $budgetLimit): void {
|
||||
Log::debug(sprintf('Now in updateAvailableBudget(#%d)', $budgetLimit->id));
|
||||
|
||||
// based on the view range of the user (month week quarter etc) the budget limit could
|
||||
@ -140,10 +142,10 @@ class BudgetLimitHandler
|
||||
|
||||
/**
|
||||
* @param AvailableBudget $availableBudget
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function calculateAmount(AvailableBudget $availableBudget): void
|
||||
{
|
||||
private function calculateAmount(AvailableBudget $availableBudget): void {
|
||||
$repository = app(BudgetLimitRepositoryInterface::class);
|
||||
$repository->setUser($availableBudget->user);
|
||||
$newAmount = '0';
|
||||
@ -171,8 +173,8 @@ class BudgetLimitHandler
|
||||
);
|
||||
// overlap in days:
|
||||
$limitPeriod = Period::make(
|
||||
$budgetLimit->start_date,
|
||||
$budgetLimit->end_date,
|
||||
$budgetLimit->start_date,
|
||||
$budgetLimit->end_date,
|
||||
precision : Precision::DAY(),
|
||||
boundaries: Boundaries::EXCLUDE_NONE()
|
||||
);
|
||||
@ -205,16 +207,16 @@ class BudgetLimitHandler
|
||||
|
||||
/**
|
||||
* @param BudgetLimit $budgetLimit
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function getDailyAmount(BudgetLimit $budgetLimit): string
|
||||
{
|
||||
private function getDailyAmount(BudgetLimit $budgetLimit): string {
|
||||
if (0 === (int)$budgetLimit->id) {
|
||||
return '0';
|
||||
}
|
||||
$limitPeriod = Period::make(
|
||||
$budgetLimit->start_date,
|
||||
$budgetLimit->end_date,
|
||||
$budgetLimit->start_date,
|
||||
$budgetLimit->end_date,
|
||||
precision : Precision::DAY(),
|
||||
boundaries: Boundaries::EXCLUDE_NONE()
|
||||
);
|
||||
@ -228,10 +230,10 @@ class BudgetLimitHandler
|
||||
|
||||
/**
|
||||
* @param Deleted $event
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function deleted(Deleted $event): void
|
||||
{
|
||||
public function deleted(Deleted $event): void {
|
||||
Log::debug(sprintf('BudgetLimitHandler::deleted(#%s)', $event->budgetLimit->id));
|
||||
$budgetLimit = $event->budgetLimit;
|
||||
$budgetLimit->id = null;
|
||||
@ -240,10 +242,10 @@ class BudgetLimitHandler
|
||||
|
||||
/**
|
||||
* @param Updated $event
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function updated(Updated $event): void
|
||||
{
|
||||
public function updated(Updated $event): void {
|
||||
Log::debug(sprintf('BudgetLimitHandler::updated(#%s)', $event->budgetLimit->id));
|
||||
$this->updateAvailableBudget($event->budgetLimit);
|
||||
}
|
||||
|
@ -329,6 +329,7 @@ class UserEventHandler
|
||||
|
||||
/**
|
||||
* @param InvitationCreated $event
|
||||
*
|
||||
* @return void
|
||||
* @throws FireflyException
|
||||
*/
|
||||
@ -376,6 +377,7 @@ class UserEventHandler
|
||||
|
||||
/**
|
||||
* @param ActuallyLoggedIn $event
|
||||
*
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function storeUserIPAddress(ActuallyLoggedIn $event): void
|
||||
|
@ -38,6 +38,7 @@ trait AttachmentCollection
|
||||
{
|
||||
/**
|
||||
* @param string $name
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function attachmentNameContains(string $name): GroupCollectorInterface
|
||||
@ -116,6 +117,7 @@ trait AttachmentCollection
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function attachmentNameDoesNotContain(string $name): GroupCollectorInterface
|
||||
@ -145,6 +147,7 @@ trait AttachmentCollection
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function attachmentNameDoesNotEnd(string $name): GroupCollectorInterface
|
||||
@ -174,6 +177,7 @@ trait AttachmentCollection
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function attachmentNameDoesNotStart(string $name): GroupCollectorInterface
|
||||
@ -203,6 +207,7 @@ trait AttachmentCollection
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function attachmentNameEnds(string $name): GroupCollectorInterface
|
||||
@ -232,6 +237,7 @@ trait AttachmentCollection
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function attachmentNameIs(string $name): GroupCollectorInterface
|
||||
@ -258,6 +264,7 @@ trait AttachmentCollection
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function attachmentNameIsNot(string $name): GroupCollectorInterface
|
||||
@ -284,6 +291,7 @@ trait AttachmentCollection
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function attachmentNameStarts(string $name): GroupCollectorInterface
|
||||
@ -313,6 +321,7 @@ trait AttachmentCollection
|
||||
|
||||
/**
|
||||
* @param string $value
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function attachmentNotesAre(string $value): GroupCollectorInterface
|
||||
@ -339,6 +348,7 @@ trait AttachmentCollection
|
||||
|
||||
/**
|
||||
* @param string $value
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function attachmentNotesAreNot(string $value): GroupCollectorInterface
|
||||
@ -365,6 +375,7 @@ trait AttachmentCollection
|
||||
|
||||
/**
|
||||
* @param string $value
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function attachmentNotesContains(string $value): GroupCollectorInterface
|
||||
@ -391,6 +402,7 @@ trait AttachmentCollection
|
||||
|
||||
/**
|
||||
* @param string $value
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function attachmentNotesDoNotContain(string $value): GroupCollectorInterface
|
||||
@ -417,6 +429,7 @@ trait AttachmentCollection
|
||||
|
||||
/**
|
||||
* @param string $value
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function attachmentNotesDoNotEnd(string $value): GroupCollectorInterface
|
||||
@ -443,6 +456,7 @@ trait AttachmentCollection
|
||||
|
||||
/**
|
||||
* @param string $value
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function attachmentNotesDoNotStart(string $value): GroupCollectorInterface
|
||||
@ -469,6 +483,7 @@ trait AttachmentCollection
|
||||
|
||||
/**
|
||||
* @param string $value
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function attachmentNotesEnds(string $value): GroupCollectorInterface
|
||||
@ -495,6 +510,7 @@ trait AttachmentCollection
|
||||
|
||||
/**
|
||||
* @param string $value
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function attachmentNotesStarts(string $value): GroupCollectorInterface
|
||||
|
@ -320,6 +320,7 @@ trait MetaCollection
|
||||
|
||||
/**
|
||||
* @param string $url
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function externalUrlContains(string $url): GroupCollectorInterface
|
||||
@ -335,6 +336,7 @@ trait MetaCollection
|
||||
|
||||
/**
|
||||
* @param string $url
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function externalUrlDoesNotContain(string $url): GroupCollectorInterface
|
||||
@ -350,6 +352,7 @@ trait MetaCollection
|
||||
|
||||
/**
|
||||
* @param string $url
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function externalUrlDoesNotEnd(string $url): GroupCollectorInterface
|
||||
@ -365,6 +368,7 @@ trait MetaCollection
|
||||
|
||||
/**
|
||||
* @param string $url
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function externalUrlDoesNotStart(string $url): GroupCollectorInterface
|
||||
@ -382,6 +386,7 @@ trait MetaCollection
|
||||
|
||||
/**
|
||||
* @param string $url
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function externalUrlEnds(string $url): GroupCollectorInterface
|
||||
@ -397,6 +402,7 @@ trait MetaCollection
|
||||
|
||||
/**
|
||||
* @param string $url
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function externalUrlStarts(string $url): GroupCollectorInterface
|
||||
|
@ -34,6 +34,7 @@ trait TimeCollection
|
||||
{
|
||||
/**
|
||||
* @param string $day
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function dayAfter(string $day): GroupCollectorInterface
|
||||
@ -44,6 +45,7 @@ trait TimeCollection
|
||||
|
||||
/**
|
||||
* @param string $day
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function dayBefore(string $day): GroupCollectorInterface
|
||||
@ -54,6 +56,7 @@ trait TimeCollection
|
||||
|
||||
/**
|
||||
* @param string $day
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function dayIs(string $day): GroupCollectorInterface
|
||||
@ -64,6 +67,7 @@ trait TimeCollection
|
||||
|
||||
/**
|
||||
* @param string $day
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function dayIsNot(string $day): GroupCollectorInterface
|
||||
@ -76,6 +80,7 @@ trait TimeCollection
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
* @param string $field
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function excludeMetaDateRange(Carbon $start, Carbon $end, string $field): GroupCollectorInterface
|
||||
@ -118,6 +123,7 @@ trait TimeCollection
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
* @param string $field
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function excludeObjectRange(Carbon $start, Carbon $end, string $field): GroupCollectorInterface
|
||||
@ -134,6 +140,7 @@ trait TimeCollection
|
||||
/**
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function excludeRange(Carbon $start, Carbon $end): GroupCollectorInterface
|
||||
@ -153,6 +160,7 @@ trait TimeCollection
|
||||
/**
|
||||
* @param string $day
|
||||
* @param string $field
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function metaDayAfter(string $day, string $field): GroupCollectorInterface
|
||||
@ -176,6 +184,7 @@ trait TimeCollection
|
||||
/**
|
||||
* @param string $day
|
||||
* @param string $field
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function metaDayBefore(string $day, string $field): GroupCollectorInterface
|
||||
@ -199,6 +208,7 @@ trait TimeCollection
|
||||
/**
|
||||
* @param string $day
|
||||
* @param string $field
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function metaDayIs(string $day, string $field): GroupCollectorInterface
|
||||
@ -221,6 +231,7 @@ trait TimeCollection
|
||||
/**
|
||||
* @param string $day
|
||||
* @param string $field
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function metaDayIsNot(string $day, string $field): GroupCollectorInterface
|
||||
@ -243,6 +254,7 @@ trait TimeCollection
|
||||
/**
|
||||
* @param string $month
|
||||
* @param string $field
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function metaMonthAfter(string $month, string $field): GroupCollectorInterface
|
||||
@ -266,6 +278,7 @@ trait TimeCollection
|
||||
/**
|
||||
* @param string $month
|
||||
* @param string $field
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function metaMonthBefore(string $month, string $field): GroupCollectorInterface
|
||||
@ -289,6 +302,7 @@ trait TimeCollection
|
||||
/**
|
||||
* @param string $month
|
||||
* @param string $field
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function metaMonthIs(string $month, string $field): GroupCollectorInterface
|
||||
@ -311,6 +325,7 @@ trait TimeCollection
|
||||
/**
|
||||
* @param string $month
|
||||
* @param string $field
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function metaMonthIsNot(string $month, string $field): GroupCollectorInterface
|
||||
@ -333,6 +348,7 @@ trait TimeCollection
|
||||
/**
|
||||
* @param string $year
|
||||
* @param string $field
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function metaYearAfter(string $year, string $field): GroupCollectorInterface
|
||||
@ -356,6 +372,7 @@ trait TimeCollection
|
||||
/**
|
||||
* @param string $year
|
||||
* @param string $field
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function metaYearBefore(string $year, string $field): GroupCollectorInterface
|
||||
@ -379,6 +396,7 @@ trait TimeCollection
|
||||
/**
|
||||
* @param string $year
|
||||
* @param string $field
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function metaYearIs(string $year, string $field): GroupCollectorInterface
|
||||
@ -402,6 +420,7 @@ trait TimeCollection
|
||||
/**
|
||||
* @param string $year
|
||||
* @param string $field
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function metaYearIsNot(string $year, string $field): GroupCollectorInterface
|
||||
@ -423,6 +442,7 @@ trait TimeCollection
|
||||
|
||||
/**
|
||||
* @param string $month
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function monthAfter(string $month): GroupCollectorInterface
|
||||
@ -433,6 +453,7 @@ trait TimeCollection
|
||||
|
||||
/**
|
||||
* @param string $month
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function monthBefore(string $month): GroupCollectorInterface
|
||||
@ -443,6 +464,7 @@ trait TimeCollection
|
||||
|
||||
/**
|
||||
* @param string $month
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function monthIs(string $month): GroupCollectorInterface
|
||||
@ -453,6 +475,7 @@ trait TimeCollection
|
||||
|
||||
/**
|
||||
* @param string $month
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function monthIsNot(string $month): GroupCollectorInterface
|
||||
@ -464,6 +487,7 @@ trait TimeCollection
|
||||
/**
|
||||
* @param string $day
|
||||
* @param string $field
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function objectDayAfter(string $day, string $field): GroupCollectorInterface
|
||||
@ -475,6 +499,7 @@ trait TimeCollection
|
||||
/**
|
||||
* @param string $day
|
||||
* @param string $field
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function objectDayBefore(string $day, string $field): GroupCollectorInterface
|
||||
@ -486,6 +511,7 @@ trait TimeCollection
|
||||
/**
|
||||
* @param string $day
|
||||
* @param string $field
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function objectDayIs(string $day, string $field): GroupCollectorInterface
|
||||
@ -497,6 +523,7 @@ trait TimeCollection
|
||||
/**
|
||||
* @param string $day
|
||||
* @param string $field
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function objectDayIsNot(string $day, string $field): GroupCollectorInterface
|
||||
@ -508,6 +535,7 @@ trait TimeCollection
|
||||
/**
|
||||
* @param string $month
|
||||
* @param string $field
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function objectMonthAfter(string $month, string $field): GroupCollectorInterface
|
||||
@ -519,6 +547,7 @@ trait TimeCollection
|
||||
/**
|
||||
* @param string $month
|
||||
* @param string $field
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function objectMonthBefore(string $month, string $field): GroupCollectorInterface
|
||||
@ -530,6 +559,7 @@ trait TimeCollection
|
||||
/**
|
||||
* @param string $month
|
||||
* @param string $field
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function objectMonthIs(string $month, string $field): GroupCollectorInterface
|
||||
@ -541,6 +571,7 @@ trait TimeCollection
|
||||
/**
|
||||
* @param string $month
|
||||
* @param string $field
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function objectMonthIsNot(string $month, string $field): GroupCollectorInterface
|
||||
@ -552,6 +583,7 @@ trait TimeCollection
|
||||
/**
|
||||
* @param string $year
|
||||
* @param string $field
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function objectYearAfter(string $year, string $field): GroupCollectorInterface
|
||||
@ -563,6 +595,7 @@ trait TimeCollection
|
||||
/**
|
||||
* @param string $year
|
||||
* @param string $field
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function objectYearBefore(string $year, string $field): GroupCollectorInterface
|
||||
@ -574,6 +607,7 @@ trait TimeCollection
|
||||
/**
|
||||
* @param string $year
|
||||
* @param string $field
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function objectYearIs(string $year, string $field): GroupCollectorInterface
|
||||
@ -585,6 +619,7 @@ trait TimeCollection
|
||||
/**
|
||||
* @param string $year
|
||||
* @param string $field
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function objectYearIsNot(string $year, string $field): GroupCollectorInterface
|
||||
@ -643,6 +678,7 @@ trait TimeCollection
|
||||
/**
|
||||
* @param Carbon $date
|
||||
* @param string $field
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function setMetaAfter(Carbon $date, string $field): GroupCollectorInterface
|
||||
@ -667,6 +703,7 @@ trait TimeCollection
|
||||
/**
|
||||
* @param Carbon $date
|
||||
* @param string $field
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function setMetaBefore(Carbon $date, string $field): GroupCollectorInterface
|
||||
@ -691,6 +728,7 @@ trait TimeCollection
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
* @param string $field
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function setMetaDateRange(Carbon $start, Carbon $end, string $field): GroupCollectorInterface
|
||||
@ -720,6 +758,7 @@ trait TimeCollection
|
||||
/**
|
||||
* @param Carbon $date
|
||||
* @param string $field
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function setObjectAfter(Carbon $date, string $field): GroupCollectorInterface
|
||||
@ -733,6 +772,7 @@ trait TimeCollection
|
||||
/**
|
||||
* @param Carbon $date
|
||||
* @param string $field
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function setObjectBefore(Carbon $date, string $field): GroupCollectorInterface
|
||||
@ -746,6 +786,7 @@ trait TimeCollection
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
* @param string $field
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function setObjectRange(Carbon $start, Carbon $end, string $field): GroupCollectorInterface
|
||||
@ -800,6 +841,7 @@ trait TimeCollection
|
||||
|
||||
/**
|
||||
* @param string $year
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function yearAfter(string $year): GroupCollectorInterface
|
||||
@ -810,6 +852,7 @@ trait TimeCollection
|
||||
|
||||
/**
|
||||
* @param string $year
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function yearBefore(string $year): GroupCollectorInterface
|
||||
@ -820,6 +863,7 @@ trait TimeCollection
|
||||
|
||||
/**
|
||||
* @param string $year
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function yearIs(string $year): GroupCollectorInterface
|
||||
@ -830,6 +874,7 @@ trait TimeCollection
|
||||
|
||||
/**
|
||||
* @param string $year
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function yearIsNot(string $year): GroupCollectorInterface
|
||||
|
@ -664,6 +664,7 @@ class GroupCollector implements GroupCollectorInterface
|
||||
|
||||
/**
|
||||
* @param array $array
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
private function convertToStrings(array $array): array
|
||||
@ -772,6 +773,7 @@ class GroupCollector implements GroupCollectorInterface
|
||||
|
||||
/**
|
||||
* @param Collection $collection
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
private function postFilterCollection(Collection $collection): Collection
|
||||
|
@ -75,120 +75,140 @@ interface GroupCollectorInterface
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function attachmentNameContains(string $name): GroupCollectorInterface;
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function attachmentNameDoesNotContain(string $name): GroupCollectorInterface;
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function attachmentNameDoesNotEnd(string $name): GroupCollectorInterface;
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function attachmentNameDoesNotStart(string $name): GroupCollectorInterface;
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function attachmentNameEnds(string $name): GroupCollectorInterface;
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function attachmentNameIs(string $name): GroupCollectorInterface;
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function attachmentNameIsNot(string $name): GroupCollectorInterface;
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function attachmentNameStarts(string $name): GroupCollectorInterface;
|
||||
|
||||
/**
|
||||
* @param string $value
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function attachmentNotesAre(string $value): GroupCollectorInterface;
|
||||
|
||||
/**
|
||||
* @param string $value
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function attachmentNotesAreNot(string $value): GroupCollectorInterface;
|
||||
|
||||
/**
|
||||
* @param string $value
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function attachmentNotesContains(string $value): GroupCollectorInterface;
|
||||
|
||||
/**
|
||||
* @param string $value
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function attachmentNotesDoNotContain(string $value): GroupCollectorInterface;
|
||||
|
||||
/**
|
||||
* @param string $value
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function attachmentNotesDoNotEnd(string $value): GroupCollectorInterface;
|
||||
|
||||
/**
|
||||
* @param string $value
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function attachmentNotesDoNotStart(string $value): GroupCollectorInterface;
|
||||
|
||||
/**
|
||||
* @param string $value
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function attachmentNotesEnds(string $value): GroupCollectorInterface;
|
||||
|
||||
/**
|
||||
* @param string $value
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function attachmentNotesStarts(string $value): GroupCollectorInterface;
|
||||
|
||||
/**
|
||||
* @param string $day
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function dayAfter(string $day): GroupCollectorInterface;
|
||||
|
||||
/**
|
||||
* @param string $day
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function dayBefore(string $day): GroupCollectorInterface;
|
||||
|
||||
/**
|
||||
* @param string $day
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function dayIs(string $day): GroupCollectorInterface;
|
||||
|
||||
/**
|
||||
* @param string $day
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function dayIsNot(string $day): GroupCollectorInterface;
|
||||
@ -287,6 +307,7 @@ interface GroupCollectorInterface
|
||||
* Exclude a set of categories.
|
||||
*
|
||||
* @param Collection $categories
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function excludeCategories(Collection $categories): GroupCollectorInterface;
|
||||
@ -329,6 +350,7 @@ interface GroupCollectorInterface
|
||||
|
||||
/**
|
||||
* @param string $url
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function excludeExternalUrl(string $url): GroupCollectorInterface;
|
||||
@ -373,6 +395,7 @@ interface GroupCollectorInterface
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
* @param string $field
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function excludeMetaDateRange(Carbon $start, Carbon $end, string $field): GroupCollectorInterface;
|
||||
@ -381,6 +404,7 @@ interface GroupCollectorInterface
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
* @param string $field
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function excludeObjectRange(Carbon $start, Carbon $end, string $field): GroupCollectorInterface;
|
||||
@ -388,6 +412,7 @@ interface GroupCollectorInterface
|
||||
/**
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function excludeRange(Carbon $start, Carbon $end): GroupCollectorInterface;
|
||||
@ -433,72 +458,84 @@ interface GroupCollectorInterface
|
||||
|
||||
/**
|
||||
* @param string $externalId
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function externalIdContains(string $externalId): GroupCollectorInterface;
|
||||
|
||||
/**
|
||||
* @param string $externalId
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function externalIdDoesNotContain(string $externalId): GroupCollectorInterface;
|
||||
|
||||
/**
|
||||
* @param string $externalId
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function externalIdDoesNotEnd(string $externalId): GroupCollectorInterface;
|
||||
|
||||
/**
|
||||
* @param string $externalId
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function externalIdDoesNotStart(string $externalId): GroupCollectorInterface;
|
||||
|
||||
/**
|
||||
* @param string $externalId
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function externalIdEnds(string $externalId): GroupCollectorInterface;
|
||||
|
||||
/**
|
||||
* @param string $externalId
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function externalIdStarts(string $externalId): GroupCollectorInterface;
|
||||
|
||||
/**
|
||||
* @param string $url
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function externalUrlContains(string $url): GroupCollectorInterface;
|
||||
|
||||
/**
|
||||
* @param string $url
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function externalUrlDoesNotContain(string $url): GroupCollectorInterface;
|
||||
|
||||
/**
|
||||
* @param string $url
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function externalUrlDoesNotEnd(string $url): GroupCollectorInterface;
|
||||
|
||||
/**
|
||||
* @param string $url
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function externalUrlDoesNotStart(string $url): GroupCollectorInterface;
|
||||
|
||||
/**
|
||||
* @param string $url
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function externalUrlEnds(string $url): GroupCollectorInterface;
|
||||
|
||||
/**
|
||||
* @param string $url
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function externalUrlStarts(string $url): GroupCollectorInterface;
|
||||
@ -588,36 +625,42 @@ interface GroupCollectorInterface
|
||||
|
||||
/**
|
||||
* @param string $externalId
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function internalReferenceContains(string $externalId): GroupCollectorInterface;
|
||||
|
||||
/**
|
||||
* @param string $externalId
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function internalReferenceDoesNotContain(string $externalId): GroupCollectorInterface;
|
||||
|
||||
/**
|
||||
* @param string $externalId
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function internalReferenceDoesNotEnd(string $externalId): GroupCollectorInterface;
|
||||
|
||||
/**
|
||||
* @param string $externalId
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function internalReferenceDoesNotStart(string $externalId): GroupCollectorInterface;
|
||||
|
||||
/**
|
||||
* @param string $externalId
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function internalReferenceEnds(string $externalId): GroupCollectorInterface;
|
||||
|
||||
/**
|
||||
* @param string $externalId
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function internalReferenceStarts(string $externalId): GroupCollectorInterface;
|
||||
@ -639,6 +682,7 @@ interface GroupCollectorInterface
|
||||
/**
|
||||
* @param string $day
|
||||
* @param string $field
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function metaDayAfter(string $day, string $field): GroupCollectorInterface;
|
||||
@ -646,6 +690,7 @@ interface GroupCollectorInterface
|
||||
/**
|
||||
* @param string $day
|
||||
* @param string $field
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function metaDayBefore(string $day, string $field): GroupCollectorInterface;
|
||||
@ -653,6 +698,7 @@ interface GroupCollectorInterface
|
||||
/**
|
||||
* @param string $day
|
||||
* @param string $field
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function metaDayIs(string $day, string $field): GroupCollectorInterface;
|
||||
@ -660,6 +706,7 @@ interface GroupCollectorInterface
|
||||
/**
|
||||
* @param string $day
|
||||
* @param string $field
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function metaDayIsNot(string $day, string $field): GroupCollectorInterface;
|
||||
@ -667,6 +714,7 @@ interface GroupCollectorInterface
|
||||
/**
|
||||
* @param string $month
|
||||
* @param string $field
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function metaMonthAfter(string $month, string $field): GroupCollectorInterface;
|
||||
@ -674,6 +722,7 @@ interface GroupCollectorInterface
|
||||
/**
|
||||
* @param string $month
|
||||
* @param string $field
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function metaMonthBefore(string $month, string $field): GroupCollectorInterface;
|
||||
@ -681,6 +730,7 @@ interface GroupCollectorInterface
|
||||
/**
|
||||
* @param string $month
|
||||
* @param string $field
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function metaMonthIs(string $month, string $field): GroupCollectorInterface;
|
||||
@ -688,6 +738,7 @@ interface GroupCollectorInterface
|
||||
/**
|
||||
* @param string $month
|
||||
* @param string $field
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function metaMonthIsNot(string $month, string $field): GroupCollectorInterface;
|
||||
@ -695,6 +746,7 @@ interface GroupCollectorInterface
|
||||
/**
|
||||
* @param string $year
|
||||
* @param string $field
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function metaYearAfter(string $year, string $field): GroupCollectorInterface;
|
||||
@ -702,6 +754,7 @@ interface GroupCollectorInterface
|
||||
/**
|
||||
* @param string $year
|
||||
* @param string $field
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function metaYearBefore(string $year, string $field): GroupCollectorInterface;
|
||||
@ -709,6 +762,7 @@ interface GroupCollectorInterface
|
||||
/**
|
||||
* @param string $year
|
||||
* @param string $field
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function metaYearIs(string $year, string $field): GroupCollectorInterface;
|
||||
@ -716,30 +770,35 @@ interface GroupCollectorInterface
|
||||
/**
|
||||
* @param string $year
|
||||
* @param string $field
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function metaYearIsNot(string $year, string $field): GroupCollectorInterface;
|
||||
|
||||
/**
|
||||
* @param string $month
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function monthAfter(string $month): GroupCollectorInterface;
|
||||
|
||||
/**
|
||||
* @param string $month
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function monthBefore(string $month): GroupCollectorInterface;
|
||||
|
||||
/**
|
||||
* @param string $month
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function monthIs(string $month): GroupCollectorInterface;
|
||||
|
||||
/**
|
||||
* @param string $month
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function monthIsNot(string $month): GroupCollectorInterface;
|
||||
@ -767,6 +826,7 @@ interface GroupCollectorInterface
|
||||
|
||||
/**
|
||||
* @param string $value
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function notesDontStartWith(string $value): GroupCollectorInterface;
|
||||
@ -802,6 +862,7 @@ interface GroupCollectorInterface
|
||||
/**
|
||||
* @param string $day
|
||||
* @param string $field
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function objectDayAfter(string $day, string $field): GroupCollectorInterface;
|
||||
@ -809,6 +870,7 @@ interface GroupCollectorInterface
|
||||
/**
|
||||
* @param string $day
|
||||
* @param string $field
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function objectDayBefore(string $day, string $field): GroupCollectorInterface;
|
||||
@ -816,6 +878,7 @@ interface GroupCollectorInterface
|
||||
/**
|
||||
* @param string $day
|
||||
* @param string $field
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function objectDayIs(string $day, string $field): GroupCollectorInterface;
|
||||
@ -823,6 +886,7 @@ interface GroupCollectorInterface
|
||||
/**
|
||||
* @param string $day
|
||||
* @param string $field
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function objectDayIsNot(string $day, string $field): GroupCollectorInterface;
|
||||
@ -830,6 +894,7 @@ interface GroupCollectorInterface
|
||||
/**
|
||||
* @param string $month
|
||||
* @param string $field
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function objectMonthAfter(string $month, string $field): GroupCollectorInterface;
|
||||
@ -837,6 +902,7 @@ interface GroupCollectorInterface
|
||||
/**
|
||||
* @param string $month
|
||||
* @param string $field
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function objectMonthBefore(string $month, string $field): GroupCollectorInterface;
|
||||
@ -844,6 +910,7 @@ interface GroupCollectorInterface
|
||||
/**
|
||||
* @param string $month
|
||||
* @param string $field
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function objectMonthIs(string $month, string $field): GroupCollectorInterface;
|
||||
@ -851,6 +918,7 @@ interface GroupCollectorInterface
|
||||
/**
|
||||
* @param string $month
|
||||
* @param string $field
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function objectMonthIsNot(string $month, string $field): GroupCollectorInterface;
|
||||
@ -858,6 +926,7 @@ interface GroupCollectorInterface
|
||||
/**
|
||||
* @param string $year
|
||||
* @param string $field
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function objectYearAfter(string $year, string $field): GroupCollectorInterface;
|
||||
@ -865,6 +934,7 @@ interface GroupCollectorInterface
|
||||
/**
|
||||
* @param string $year
|
||||
* @param string $field
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function objectYearBefore(string $year, string $field): GroupCollectorInterface;
|
||||
@ -872,6 +942,7 @@ interface GroupCollectorInterface
|
||||
/**
|
||||
* @param string $year
|
||||
* @param string $field
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function objectYearIs(string $year, string $field): GroupCollectorInterface;
|
||||
@ -879,6 +950,7 @@ interface GroupCollectorInterface
|
||||
/**
|
||||
* @param string $year
|
||||
* @param string $field
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function objectYearIsNot(string $year, string $field): GroupCollectorInterface;
|
||||
@ -1011,6 +1083,7 @@ interface GroupCollectorInterface
|
||||
|
||||
/**
|
||||
* @param string $url
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function setExternalUrl(string $url): GroupCollectorInterface;
|
||||
@ -1065,6 +1138,7 @@ interface GroupCollectorInterface
|
||||
*
|
||||
* @param Carbon $date
|
||||
* @param string $field
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function setMetaAfter(Carbon $date, string $field): GroupCollectorInterface;
|
||||
@ -1074,6 +1148,7 @@ interface GroupCollectorInterface
|
||||
*
|
||||
* @param Carbon $date
|
||||
* @param string $field
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function setMetaBefore(Carbon $date, string $field): GroupCollectorInterface;
|
||||
@ -1101,6 +1176,7 @@ interface GroupCollectorInterface
|
||||
/**
|
||||
* @param Carbon $date
|
||||
* @param string $field
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function setObjectAfter(Carbon $date, string $field): GroupCollectorInterface;
|
||||
@ -1108,6 +1184,7 @@ interface GroupCollectorInterface
|
||||
/**
|
||||
* @param Carbon $date
|
||||
* @param string $field
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function setObjectBefore(Carbon $date, string $field): GroupCollectorInterface;
|
||||
@ -1116,6 +1193,7 @@ interface GroupCollectorInterface
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
* @param string $field
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function setObjectRange(Carbon $start, Carbon $end, string $field): GroupCollectorInterface;
|
||||
@ -1159,6 +1237,7 @@ interface GroupCollectorInterface
|
||||
|
||||
/**
|
||||
* @param string $sepaCT
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function setSepaCT(string $sepaCT): GroupCollectorInterface;
|
||||
@ -1332,6 +1411,7 @@ interface GroupCollectorInterface
|
||||
* Transaction must have meta date field X.
|
||||
*
|
||||
* @param string $field
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function withMetaDate(string $field): GroupCollectorInterface;
|
||||
@ -1397,24 +1477,28 @@ interface GroupCollectorInterface
|
||||
|
||||
/**
|
||||
* @param string $year
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function yearAfter(string $year): GroupCollectorInterface;
|
||||
|
||||
/**
|
||||
* @param string $year
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function yearBefore(string $year): GroupCollectorInterface;
|
||||
|
||||
/**
|
||||
* @param string $year
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function yearIs(string $year): GroupCollectorInterface;
|
||||
|
||||
/**
|
||||
* @param string $year
|
||||
*
|
||||
* @return GroupCollectorInterface
|
||||
*/
|
||||
public function yearIsNot(string $year): GroupCollectorInterface;
|
||||
|
@ -24,7 +24,6 @@ declare(strict_types=1);
|
||||
namespace FireflyIII\Helpers\Fiscal;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use Psr\Container\ContainerExceptionInterface;
|
||||
use Psr\Container\NotFoundExceptionInterface;
|
||||
|
||||
|
@ -49,6 +49,7 @@ interface NetWorthInterface
|
||||
*
|
||||
* @param Collection $accounts
|
||||
* @param Carbon $date
|
||||
*
|
||||
* @return array
|
||||
* @deprecated
|
||||
*/
|
||||
|
@ -155,9 +155,9 @@ class ReconcileController extends Controller
|
||||
* Submit a new reconciliation.
|
||||
*
|
||||
* @param ReconciliationStoreRequest $request
|
||||
* @param Account $account
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
* @param Account $account
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
*
|
||||
* @return RedirectResponse|Redirector
|
||||
* @throws DuplicateTransactionException
|
||||
|
@ -23,7 +23,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Http\Controllers\Admin;
|
||||
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Http\Controllers\Controller;
|
||||
use FireflyIII\Http\Middleware\IsDemoUser;
|
||||
use FireflyIII\Http\Requests\ConfigurationRequest;
|
||||
|
@ -24,7 +24,6 @@ declare(strict_types=1);
|
||||
namespace FireflyIII\Http\Controllers\Admin;
|
||||
|
||||
use FireflyIII\Events\AdminRequestedTestMessage;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Http\Controllers\Controller;
|
||||
use FireflyIII\Http\Middleware\IsDemoUser;
|
||||
use FireflyIII\Support\Facades\FireflyConfig;
|
||||
@ -84,6 +83,7 @@ class HomeController extends Controller
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
*
|
||||
* @return RedirectResponse
|
||||
*/
|
||||
public function notifications(Request $request): RedirectResponse
|
||||
|
@ -89,6 +89,7 @@ class UserController extends Controller
|
||||
|
||||
/**
|
||||
* @param InvitedUser $invitedUser
|
||||
*
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function deleteInvite(InvitedUser $invitedUser): JsonResponse
|
||||
@ -192,6 +193,7 @@ class UserController extends Controller
|
||||
|
||||
/**
|
||||
* @param InviteUserFormRequest $request
|
||||
*
|
||||
* @return RedirectResponse
|
||||
*/
|
||||
public function invite(InviteUserFormRequest $request): RedirectResponse
|
||||
|
@ -35,7 +35,6 @@ use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\View\View;
|
||||
use JsonException;
|
||||
use Psr\Container\ContainerExceptionInterface;
|
||||
use Psr\Container\NotFoundExceptionInterface;
|
||||
|
||||
|
@ -517,6 +517,7 @@ class AccountController extends Controller
|
||||
*
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
*
|
||||
* @return JsonResponse
|
||||
* @throws FireflyException
|
||||
* @throws JsonException
|
||||
|
@ -24,7 +24,6 @@ declare(strict_types=1);
|
||||
namespace FireflyIII\Http\Controllers\Chart;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Generator\Chart\Basic\GeneratorInterface;
|
||||
use FireflyIII\Helpers\Collector\GroupCollectorInterface;
|
||||
use FireflyIII\Helpers\Report\NetWorthInterface;
|
||||
|
@ -208,6 +208,7 @@ class CurrencyController extends Controller
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
*
|
||||
* @return JsonResponse
|
||||
* @throws FireflyException
|
||||
*/
|
||||
@ -300,6 +301,7 @@ class CurrencyController extends Controller
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
*
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function enableCurrency(Request $request): JsonResponse
|
||||
|
@ -32,8 +32,6 @@ use FireflyIII\Repositories\Recurring\RecurringRepositoryInterface;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Psr\Container\ContainerExceptionInterface;
|
||||
use Psr\Container\NotFoundExceptionInterface;
|
||||
|
||||
/**
|
||||
* Class RecurrenceController
|
||||
@ -148,11 +146,11 @@ class RecurrenceController extends Controller
|
||||
*/
|
||||
public function suggest(Request $request): JsonResponse
|
||||
{
|
||||
$string = '' === (string)$request->get('date') ? date('Y-m-d') : (string)$request->get('date');
|
||||
$today = today(config('app.timezone'))->startOfDay();
|
||||
$string = '' === (string)$request->get('date') ? date('Y-m-d') : (string)$request->get('date');
|
||||
$today = today(config('app.timezone'))->startOfDay();
|
||||
try {
|
||||
$date = Carbon::createFromFormat('Y-m-d', $string, config('app.timezone'))->startOfDay();
|
||||
} catch(InvalidFormatException $e) {
|
||||
} catch (InvalidFormatException $e) {
|
||||
$date = Carbon::today(config('app.timezone'));
|
||||
}
|
||||
$preSelected = (string)$request->get('pre_select');
|
||||
|
@ -54,12 +54,12 @@ class ReportController extends Controller
|
||||
app('view')->share('end', $attributes['endDate']);
|
||||
|
||||
$html = match ($attributes['location']) {
|
||||
default => sprintf('Firefly III cannot handle "%s"-popups.', $attributes['location']),
|
||||
default => sprintf('Firefly III cannot handle "%s"-popups.', $attributes['location']),
|
||||
'budget-spent-amount' => $this->budgetSpentAmount($attributes),
|
||||
'expense-entry' => $this->expenseEntry($attributes),
|
||||
'income-entry' => $this->incomeEntry($attributes),
|
||||
'category-entry' => $this->categoryEntry($attributes),
|
||||
'budget-entry' => $this->budgetEntry($attributes),
|
||||
'expense-entry' => $this->expenseEntry($attributes),
|
||||
'income-entry' => $this->incomeEntry($attributes),
|
||||
'category-entry' => $this->categoryEntry($attributes),
|
||||
'budget-entry' => $this->budgetEntry($attributes),
|
||||
};
|
||||
return response()->json(['html' => $html]);
|
||||
}
|
||||
|
@ -1,5 +1,26 @@
|
||||
<?php
|
||||
|
||||
|
||||
/*
|
||||
* TriggerController.php
|
||||
* Copyright (c) 2023 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
/*
|
||||
* TriggerController.php
|
||||
@ -41,6 +62,7 @@ class TriggerController extends Controller
|
||||
/**
|
||||
* @param Recurrence $recurrence
|
||||
* @param TriggerRecurrenceRequest $request
|
||||
*
|
||||
* @return RedirectResponse
|
||||
*/
|
||||
public function trigger(Recurrence $recurrence, TriggerRecurrenceRequest $request): RedirectResponse
|
||||
|
@ -45,8 +45,8 @@ class BillController extends Controller
|
||||
* @return mixed|string
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function overview(Collection $accounts, Carbon $start, Carbon $end)
|
||||
{ // chart properties for cache:
|
||||
public function overview(Collection $accounts, Carbon $start, Carbon $end) // chart properties for cache:
|
||||
{
|
||||
$cache = new CacheProperties();
|
||||
$cache->addProperty($start);
|
||||
$cache->addProperty($end);
|
||||
|
@ -313,11 +313,11 @@ class ReportController extends Controller
|
||||
public function options(string $reportType)
|
||||
{
|
||||
$result = match ($reportType) {
|
||||
default => $this->noReportOptions(),
|
||||
default => $this->noReportOptions(),
|
||||
'category' => $this->categoryReportOptions(),
|
||||
'budget' => $this->budgetReportOptions(),
|
||||
'tag' => $this->tagReportOptions(),
|
||||
'double' => $this->doubleReportOptions(),
|
||||
'budget' => $this->budgetReportOptions(),
|
||||
'tag' => $this->tagReportOptions(),
|
||||
'double' => $this->doubleReportOptions(),
|
||||
};
|
||||
|
||||
return response()->json(['html' => $result]);
|
||||
@ -381,12 +381,12 @@ class ReportController extends Controller
|
||||
}
|
||||
|
||||
$url = match ($reportType) {
|
||||
default => route('reports.report.default', [$accounts, $start, $end]),
|
||||
default => route('reports.report.default', [$accounts, $start, $end]),
|
||||
'category' => route('reports.report.category', [$accounts, $categories, $start, $end]),
|
||||
'audit' => route('reports.report.audit', [$accounts, $start, $end]),
|
||||
'budget' => route('reports.report.budget', [$accounts, $budgets, $start, $end]),
|
||||
'tag' => route('reports.report.tag', [$accounts, $tags, $start, $end]),
|
||||
'double' => route('reports.report.double', [$accounts, $double, $start, $end]),
|
||||
'audit' => route('reports.report.audit', [$accounts, $start, $end]),
|
||||
'budget' => route('reports.report.budget', [$accounts, $budgets, $start, $end]),
|
||||
'tag' => route('reports.report.tag', [$accounts, $tags, $start, $end]),
|
||||
'double' => route('reports.report.double', [$accounts, $double, $start, $end]),
|
||||
};
|
||||
|
||||
return redirect($url);
|
||||
|
@ -241,6 +241,7 @@ class CreateController extends Controller
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
*
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function duplicate(Request $request): JsonResponse
|
||||
|
@ -138,6 +138,7 @@ class InstallController extends Controller
|
||||
/**
|
||||
* @param string $command
|
||||
* @param array $args
|
||||
*
|
||||
* @return bool
|
||||
* @throws FireflyException
|
||||
*/
|
||||
|
@ -155,6 +155,7 @@ class LinkController extends Controller
|
||||
* Switch link from A <> B to B <> A.
|
||||
*
|
||||
* @param Request $request
|
||||
*
|
||||
* @return RedirectResponse|Redirector
|
||||
*/
|
||||
public function switchLink(Request $request)
|
||||
|
@ -39,6 +39,7 @@ class AcceptHeaders
|
||||
*
|
||||
* @param Request $request
|
||||
* @param callable $next
|
||||
*
|
||||
* @return Response
|
||||
* @throws BadHttpHeaderException
|
||||
*/
|
||||
@ -78,6 +79,7 @@ class AcceptHeaders
|
||||
/**
|
||||
* @param string $content
|
||||
* @param array $accepted
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
private function acceptsHeader(string $content, array $accepted): bool
|
||||
|
@ -121,6 +121,7 @@ class Authenticate
|
||||
/**
|
||||
* @param User|null $user
|
||||
* @param array $guards
|
||||
*
|
||||
* @return void
|
||||
* @throws AuthenticationException
|
||||
*/
|
||||
|
@ -86,6 +86,7 @@ class RuleFormRequest extends FormRequest
|
||||
|
||||
/**
|
||||
* @param array $array
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function replaceAmountTrigger(array $array): array
|
||||
|
@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* TriggerRecurrenceRequest.php
|
||||
* Copyright (c) 2022 james@firefly-iii.org
|
||||
* Copyright (c) 2023 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
@ -21,6 +21,8 @@ declare(strict_types=1);
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Http\Requests;
|
||||
|
||||
use FireflyIII\Support\Request\ChecksLogin;
|
||||
@ -40,8 +42,7 @@ class TriggerRecurrenceRequest extends FormRequest
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAll(): array
|
||||
{
|
||||
public function getAll(): array {
|
||||
return [
|
||||
'date' => $this->getCarbonDate('date'),
|
||||
];
|
||||
@ -52,8 +53,7 @@ class TriggerRecurrenceRequest extends FormRequest
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
public function rules(): array {
|
||||
return [
|
||||
'date' => 'required|date',
|
||||
];
|
||||
|
@ -314,6 +314,7 @@ class CreateAutoBudgetLimits implements ShouldQueue
|
||||
|
||||
/**
|
||||
* @param AutoBudget $autoBudget
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function createAdjustedLimit(AutoBudget $autoBudget): void
|
||||
|
@ -94,6 +94,7 @@ class DownloadExchangeRates implements ShouldQueue
|
||||
|
||||
/**
|
||||
* @param TransactionCurrency $currency
|
||||
*
|
||||
* @return void
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
@ -126,8 +127,9 @@ class DownloadExchangeRates implements ShouldQueue
|
||||
|
||||
/**
|
||||
* @param TransactionCurrency $currency
|
||||
* @param Carbon $date
|
||||
* @param array $rates
|
||||
* @param Carbon $date
|
||||
* @param array $rates
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function saveRates(TransactionCurrency $currency, Carbon $date, array $rates): void
|
||||
@ -145,6 +147,7 @@ class DownloadExchangeRates implements ShouldQueue
|
||||
|
||||
/**
|
||||
* @param string $code
|
||||
*
|
||||
* @return TransactionCurrency|null
|
||||
*/
|
||||
private function getCurrency(string $code): ?TransactionCurrency
|
||||
@ -175,8 +178,9 @@ class DownloadExchangeRates implements ShouldQueue
|
||||
/**
|
||||
* @param TransactionCurrency $from
|
||||
* @param TransactionCurrency $to
|
||||
* @param Carbon $date
|
||||
* @param float $rate
|
||||
* @param Carbon $date
|
||||
* @param float $rate
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function saveRate(TransactionCurrency $from, TransactionCurrency $to, Carbon $date, float $rate): void
|
||||
|
@ -97,6 +97,7 @@ class WarnAboutBills implements ShouldQueue
|
||||
|
||||
/**
|
||||
* @param Bill $bill
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
private function hasDateFields(Bill $bill): bool
|
||||
@ -115,6 +116,7 @@ class WarnAboutBills implements ShouldQueue
|
||||
/**
|
||||
* @param Bill $bill
|
||||
* @param string $field
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
private function needsWarning(Bill $bill, string $field): bool
|
||||
@ -134,6 +136,7 @@ class WarnAboutBills implements ShouldQueue
|
||||
/**
|
||||
* @param Bill $bill
|
||||
* @param string $field
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
private function getDiff(Bill $bill, string $field): int
|
||||
@ -146,6 +149,7 @@ class WarnAboutBills implements ShouldQueue
|
||||
/**
|
||||
* @param Bill $bill
|
||||
* @param string $field
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function sendWarning(Bill $bill, string $field): void
|
||||
|
@ -34,13 +34,13 @@ use Illuminate\Support\Carbon;
|
||||
/**
|
||||
* Class UserGroup
|
||||
*
|
||||
* @property int $id
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
* @property string|null $deleted_at
|
||||
* @property string $title
|
||||
* @property int $id
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
* @property string|null $deleted_at
|
||||
* @property string $title
|
||||
* @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 newQuery()
|
||||
* @method static Builder|UserGroup query()
|
||||
@ -49,8 +49,8 @@ use Illuminate\Support\Carbon;
|
||||
* @method static Builder|UserGroup whereId($value)
|
||||
* @method static Builder|UserGroup whereTitle($value)
|
||||
* @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 int|null $accounts_count
|
||||
* @mixin Eloquent
|
||||
*/
|
||||
class UserGroup extends Model
|
||||
|
@ -52,6 +52,7 @@ class TestNotification extends Notification
|
||||
* Get the array representation of the notification.
|
||||
*
|
||||
* @param mixed $notifiable
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function toArray($notifiable)
|
||||
@ -65,6 +66,7 @@ class TestNotification extends Notification
|
||||
* Get the mail representation of the notification.
|
||||
*
|
||||
* @param mixed $notifiable
|
||||
*
|
||||
* @return MailMessage
|
||||
*/
|
||||
public function toMail($notifiable)
|
||||
@ -78,6 +80,7 @@ class TestNotification extends Notification
|
||||
* Get the Slack representation of the notification.
|
||||
*
|
||||
* @param mixed $notifiable
|
||||
*
|
||||
* @return SlackMessage
|
||||
*/
|
||||
public function toSlack($notifiable)
|
||||
@ -89,6 +92,7 @@ class TestNotification extends Notification
|
||||
* Get the notification's delivery channels.
|
||||
*
|
||||
* @param mixed $notifiable
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function via($notifiable)
|
||||
|
@ -53,6 +53,7 @@ class UserInvitation extends Notification
|
||||
* Get the array representation of the notification.
|
||||
*
|
||||
* @param mixed $notifiable
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function toArray($notifiable)
|
||||
@ -66,6 +67,7 @@ class UserInvitation extends Notification
|
||||
* Get the mail representation of the notification.
|
||||
*
|
||||
* @param mixed $notifiable
|
||||
*
|
||||
* @return MailMessage
|
||||
*/
|
||||
public function toMail($notifiable)
|
||||
@ -79,6 +81,7 @@ class UserInvitation extends Notification
|
||||
* Get the Slack representation of the notification.
|
||||
*
|
||||
* @param mixed $notifiable
|
||||
*
|
||||
* @return SlackMessage
|
||||
*/
|
||||
public function toSlack($notifiable)
|
||||
@ -92,6 +95,7 @@ class UserInvitation extends Notification
|
||||
* Get the notification's delivery channels.
|
||||
*
|
||||
* @param mixed $notifiable
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function via($notifiable)
|
||||
|
@ -53,6 +53,7 @@ class UserRegistration extends Notification
|
||||
* Get the array representation of the notification.
|
||||
*
|
||||
* @param mixed $notifiable
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function toArray($notifiable)
|
||||
@ -66,6 +67,7 @@ class UserRegistration extends Notification
|
||||
* Get the mail representation of the notification.
|
||||
*
|
||||
* @param mixed $notifiable
|
||||
*
|
||||
* @return MailMessage
|
||||
*/
|
||||
public function toMail($notifiable)
|
||||
@ -79,6 +81,7 @@ class UserRegistration extends Notification
|
||||
* Get the Slack representation of the notification.
|
||||
*
|
||||
* @param mixed $notifiable
|
||||
*
|
||||
* @return SlackMessage
|
||||
*/
|
||||
public function toSlack($notifiable)
|
||||
@ -90,6 +93,7 @@ class UserRegistration extends Notification
|
||||
* Get the notification's delivery channels.
|
||||
*
|
||||
* @param mixed $notifiable
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function via($notifiable)
|
||||
|
@ -53,6 +53,7 @@ class VersionCheckResult extends Notification
|
||||
* Get the array representation of the notification.
|
||||
*
|
||||
* @param mixed $notifiable
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function toArray($notifiable)
|
||||
@ -66,6 +67,7 @@ class VersionCheckResult extends Notification
|
||||
* Get the mail representation of the notification.
|
||||
*
|
||||
* @param mixed $notifiable
|
||||
*
|
||||
* @return MailMessage
|
||||
*/
|
||||
public function toMail($notifiable)
|
||||
@ -79,6 +81,7 @@ class VersionCheckResult extends Notification
|
||||
* Get the Slack representation of the notification.
|
||||
*
|
||||
* @param mixed $notifiable
|
||||
*
|
||||
* @return SlackMessage
|
||||
*/
|
||||
public function toSlack($notifiable)
|
||||
@ -93,6 +96,7 @@ class VersionCheckResult extends Notification
|
||||
* Get the notification's delivery channels.
|
||||
*
|
||||
* @param mixed $notifiable
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function via($notifiable)
|
||||
|
@ -57,6 +57,7 @@ class BillReminder extends Notification
|
||||
* Get the array representation of the notification.
|
||||
*
|
||||
* @param mixed $notifiable
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function toArray($notifiable)
|
||||
@ -70,6 +71,7 @@ class BillReminder extends Notification
|
||||
* Get the mail representation of the notification.
|
||||
*
|
||||
* @param mixed $notifiable
|
||||
*
|
||||
* @return MailMessage
|
||||
*/
|
||||
public function toMail($notifiable)
|
||||
@ -88,6 +90,7 @@ class BillReminder extends Notification
|
||||
* Get the Slack representation of the notification.
|
||||
*
|
||||
* @param mixed $notifiable
|
||||
*
|
||||
* @return SlackMessage
|
||||
*/
|
||||
public function toSlack($notifiable)
|
||||
@ -110,6 +113,7 @@ class BillReminder extends Notification
|
||||
* Get the notification's delivery channels.
|
||||
*
|
||||
* @param mixed $notifiable
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function via($notifiable)
|
||||
|
@ -49,6 +49,7 @@ class NewAccessToken extends Notification
|
||||
* Get the array representation of the notification.
|
||||
*
|
||||
* @param mixed $notifiable
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function toArray($notifiable)
|
||||
@ -62,6 +63,7 @@ class NewAccessToken extends Notification
|
||||
* Get the mail representation of the notification.
|
||||
*
|
||||
* @param mixed $notifiable
|
||||
*
|
||||
* @return MailMessage
|
||||
*/
|
||||
public function toMail($notifiable)
|
||||
@ -75,6 +77,7 @@ class NewAccessToken extends Notification
|
||||
* Get the Slack representation of the notification.
|
||||
*
|
||||
* @param mixed $notifiable
|
||||
*
|
||||
* @return SlackMessage
|
||||
*/
|
||||
public function toSlack($notifiable)
|
||||
@ -86,6 +89,7 @@ class NewAccessToken extends Notification
|
||||
* Get the notification's delivery channels.
|
||||
*
|
||||
* @param mixed $notifiable
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function via($notifiable)
|
||||
|
@ -51,6 +51,7 @@ class TransactionCreation extends Notification
|
||||
* Get the array representation of the notification.
|
||||
*
|
||||
* @param mixed $notifiable
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function toArray($notifiable)
|
||||
@ -64,6 +65,7 @@ class TransactionCreation extends Notification
|
||||
* Get the mail representation of the notification.
|
||||
*
|
||||
* @param mixed $notifiable
|
||||
*
|
||||
* @return MailMessage
|
||||
*/
|
||||
public function toMail($notifiable)
|
||||
@ -77,6 +79,7 @@ class TransactionCreation extends Notification
|
||||
* Get the notification's delivery channels.
|
||||
*
|
||||
* @param mixed $notifiable
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function via($notifiable)
|
||||
|
@ -54,6 +54,7 @@ class UserLogin extends Notification
|
||||
* Get the array representation of the notification.
|
||||
*
|
||||
* @param mixed $notifiable
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function toArray($notifiable)
|
||||
@ -67,6 +68,7 @@ class UserLogin extends Notification
|
||||
* Get the mail representation of the notification.
|
||||
*
|
||||
* @param mixed $notifiable
|
||||
*
|
||||
* @return MailMessage
|
||||
*/
|
||||
public function toMail($notifiable)
|
||||
@ -92,6 +94,7 @@ class UserLogin extends Notification
|
||||
* Get the Slack representation of the notification.
|
||||
*
|
||||
* @param mixed $notifiable
|
||||
*
|
||||
* @return SlackMessage
|
||||
*/
|
||||
public function toSlack($notifiable)
|
||||
@ -114,6 +117,7 @@ class UserLogin extends Notification
|
||||
* Get the notification's delivery channels.
|
||||
*
|
||||
* @param mixed $notifiable
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function via($notifiable)
|
||||
|
@ -51,6 +51,7 @@ class UserNewPassword extends Notification
|
||||
* Get the array representation of the notification.
|
||||
*
|
||||
* @param mixed $notifiable
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function toArray($notifiable)
|
||||
@ -64,6 +65,7 @@ class UserNewPassword extends Notification
|
||||
* Get the mail representation of the notification.
|
||||
*
|
||||
* @param mixed $notifiable
|
||||
*
|
||||
* @return MailMessage
|
||||
*/
|
||||
public function toMail($notifiable)
|
||||
@ -77,6 +79,7 @@ class UserNewPassword extends Notification
|
||||
* Get the notification's delivery channels.
|
||||
*
|
||||
* @param mixed $notifiable
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function via($notifiable)
|
||||
|
@ -48,6 +48,7 @@ class UserRegistration extends Notification
|
||||
* Get the array representation of the notification.
|
||||
*
|
||||
* @param mixed $notifiable
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function toArray($notifiable)
|
||||
@ -61,6 +62,7 @@ class UserRegistration extends Notification
|
||||
* Get the mail representation of the notification.
|
||||
*
|
||||
* @param mixed $notifiable
|
||||
*
|
||||
* @return MailMessage
|
||||
*/
|
||||
public function toMail($notifiable)
|
||||
@ -74,6 +76,7 @@ class UserRegistration extends Notification
|
||||
* Get the notification's delivery channels.
|
||||
*
|
||||
* @param mixed $notifiable
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function via($notifiable)
|
||||
|
@ -47,7 +47,7 @@ class AppServiceProvider extends ServiceProvider
|
||||
$headers = [
|
||||
'Cache-Control' => 'no-store',
|
||||
];
|
||||
$uuid = (string)request()->header('X-Trace-Id');
|
||||
$uuid = (string)request()->header('X-Trace-Id');
|
||||
if ('' !== trim($uuid) && (preg_match('/^[a-f\d]{8}(-[a-f\d]{4}){4}[a-f\d]{8}$/i', trim($uuid)) === 1)) {
|
||||
$headers['X-Trace-Id'] = $uuid;
|
||||
}
|
||||
|
@ -766,7 +766,7 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
|
||||
/**
|
||||
* @param Account $account
|
||||
* @param array $data
|
||||
* @param array $data
|
||||
*
|
||||
* @return Account
|
||||
* @throws FireflyException
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* AccountRepository.php
|
||||
* Copyright (c) 2023 james@firefly-iii.org
|
||||
@ -21,6 +21,8 @@ declare(strict_types=1);
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Repositories\Administration\Account;
|
||||
|
||||
use FireflyIII\Support\Repositories\Administration\AdministrationTrait;
|
||||
@ -36,8 +38,7 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function searchAccount(string $query, array $types, int $limit): Collection
|
||||
{
|
||||
public function searchAccount(string $query, array $types, int $limit): Collection {
|
||||
// search by group, not by user
|
||||
$dbQuery = $this->userGroup->accounts()
|
||||
->where('active', true)
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* AccountRepositoryInterface.php
|
||||
* Copyright (c) 2023 james@firefly-iii.org
|
||||
@ -21,6 +21,8 @@ declare(strict_types=1);
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Repositories\Administration\Account;
|
||||
|
||||
use Illuminate\Support\Collection;
|
||||
|
@ -35,12 +35,14 @@ interface ALERepositoryInterface
|
||||
{
|
||||
/**
|
||||
* @param Model $model
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
public function getForObject(Model $model): Collection;
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
*
|
||||
* @return AuditLogEntry
|
||||
*/
|
||||
public function store(array $data): AuditLogEntry;
|
||||
|
@ -282,6 +282,7 @@ interface BillRepositoryInterface
|
||||
*
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function sumPaidInRange(Carbon $start, Carbon $end): array;
|
||||
@ -291,6 +292,7 @@ interface BillRepositoryInterface
|
||||
*
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function sumUnpaidInRange(Carbon $start, Carbon $end): array;
|
||||
|
@ -171,6 +171,7 @@ class BudgetRepository implements BudgetRepositoryInterface
|
||||
* @param BudgetLimit $limit
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
private function daysInOverlap(BudgetLimit $limit, Carbon $start, Carbon $end): int
|
||||
@ -374,6 +375,7 @@ class BudgetRepository implements BudgetRepositoryInterface
|
||||
/**
|
||||
* @param Budget $budget
|
||||
* @param string $text
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function setNoteText(Budget $budget, string $text): void
|
||||
@ -405,6 +407,7 @@ class BudgetRepository implements BudgetRepositoryInterface
|
||||
/**
|
||||
* @param Budget $budget
|
||||
* @param array $data
|
||||
*
|
||||
* @throws FireflyException
|
||||
* @throws JsonException
|
||||
*/
|
||||
|
@ -57,6 +57,7 @@ interface BudgetRepositoryInterface
|
||||
*
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function budgetedInPeriod(Carbon $start, Carbon $end): array;
|
||||
@ -67,6 +68,7 @@ interface BudgetRepositoryInterface
|
||||
* @param Budget $budget
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function budgetedInPeriodForBudget(Budget $budget, Carbon $start, Carbon $end): array;
|
||||
@ -173,6 +175,7 @@ interface BudgetRepositoryInterface
|
||||
|
||||
/**
|
||||
* @param Budget $budget
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getNoteText(Budget $budget): ?string;
|
||||
|
@ -288,6 +288,7 @@ class OperationsRepository implements OperationsRepositoryInterface
|
||||
* @param Collection|null $accounts
|
||||
* @param Collection|null $budgets
|
||||
* @param TransactionCurrency|null $currency
|
||||
*
|
||||
* @return array
|
||||
* @deprecated
|
||||
*/
|
||||
|
@ -473,6 +473,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface
|
||||
* @param TransactionCurrency $toCurrency
|
||||
* @param Carbon $date
|
||||
* @param float $rate
|
||||
*
|
||||
* @return CurrencyExchangeRate
|
||||
*/
|
||||
public function setExchangeRate(TransactionCurrency $fromCurrency, TransactionCurrency $toCurrency, Carbon $date, float $rate): CurrencyExchangeRate
|
||||
|
@ -226,6 +226,7 @@ interface CurrencyRepositoryInterface
|
||||
* @param TransactionCurrency $toCurrency
|
||||
* @param Carbon $date
|
||||
* @param float $rate
|
||||
*
|
||||
* @return CurrencyExchangeRate
|
||||
*/
|
||||
public function setExchangeRate(TransactionCurrency $fromCurrency, TransactionCurrency $toCurrency, Carbon $date, float $rate): CurrencyExchangeRate;
|
||||
|
@ -172,6 +172,7 @@ class LinkTypeRepository implements LinkTypeRepositoryInterface
|
||||
/**
|
||||
* @param TransactionJournal $one
|
||||
* @param TransactionJournal $two
|
||||
*
|
||||
* @return TransactionJournalLink|null
|
||||
*/
|
||||
public function getLink(TransactionJournal $one, TransactionJournal $two): ?TransactionJournalLink
|
||||
|
@ -45,8 +45,9 @@ trait ModifiesPiggyBanks
|
||||
|
||||
/**
|
||||
* @param PiggyBankRepetition $repetition
|
||||
* @param string $amount
|
||||
* @param TransactionJournal $journal
|
||||
* @param string $amount
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function addAmountToRepetition(PiggyBankRepetition $repetition, string $amount, TransactionJournal $journal): void
|
||||
@ -63,9 +64,10 @@ trait ModifiesPiggyBanks
|
||||
}
|
||||
|
||||
/**
|
||||
* @param PiggyBank $piggyBank
|
||||
* @param string $amount
|
||||
* @param PiggyBank $piggyBank
|
||||
* @param string $amount
|
||||
* @param TransactionJournal|null $journal
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function removeAmount(PiggyBank $piggyBank, string $amount, ?TransactionJournal $journal = null): bool
|
||||
@ -87,6 +89,7 @@ trait ModifiesPiggyBanks
|
||||
* @param PiggyBank $piggyBank
|
||||
* @param string $amount
|
||||
* @param TransactionJournal|null $journal
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function addAmount(PiggyBank $piggyBank, string $amount, ?TransactionJournal $journal = null): bool
|
||||
|
@ -41,14 +41,16 @@ interface PiggyBankRepositoryInterface
|
||||
* @param PiggyBank $piggyBank
|
||||
* @param string $amount
|
||||
* @param TransactionJournal|null $journal
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function addAmount(PiggyBank $piggyBank, string $amount, ?TransactionJournal $journal = null): bool;
|
||||
|
||||
/**
|
||||
* @param PiggyBankRepetition $repetition
|
||||
* @param string $amount
|
||||
* @param TransactionJournal $journal
|
||||
* @param string $amount
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function addAmountToRepetition(PiggyBankRepetition $repetition, string $amount, TransactionJournal $journal): void;
|
||||
@ -203,6 +205,7 @@ interface PiggyBankRepositoryInterface
|
||||
* @param PiggyBank $piggyBank
|
||||
* @param string $amount
|
||||
* @param TransactionJournal|null $journal
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function removeAmount(PiggyBank $piggyBank, string $amount, ?TransactionJournal $journal = null): bool;
|
||||
|
@ -42,6 +42,7 @@ interface RecurringRepositoryInterface
|
||||
/**
|
||||
* @param Recurrence $recurrence
|
||||
* @param Carbon $date
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function createdPreviously(Recurrence $recurrence, Carbon $date): bool;
|
||||
|
@ -104,6 +104,7 @@ interface UserRepositoryInterface
|
||||
|
||||
/**
|
||||
* @param InvitedUser $invite
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function deleteInvite(InvitedUser $invite): void;
|
||||
@ -158,6 +159,7 @@ interface UserRepositoryInterface
|
||||
/**
|
||||
* @param User $user
|
||||
* @param int $groupId
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getRolesInGroup(User $user, int $groupId): array;
|
||||
@ -182,12 +184,14 @@ interface UserRepositoryInterface
|
||||
/**
|
||||
* @param User|Authenticatable|null $user
|
||||
* @param string $email
|
||||
*
|
||||
* @return InvitedUser
|
||||
*/
|
||||
public function inviteUser(User | Authenticatable | null $user, string $email): InvitedUser;
|
||||
|
||||
/**
|
||||
* @param string $code
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function redeemCode(string $code): void;
|
||||
@ -245,6 +249,7 @@ interface UserRepositoryInterface
|
||||
|
||||
/**
|
||||
* @param string $code
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function validateInviteCode(string $code): bool;
|
||||
|
@ -79,16 +79,16 @@ class BelongsUser implements Rule
|
||||
Log::debug(sprintf('Going to validate %s', $attribute));
|
||||
|
||||
return match ($attribute) {
|
||||
'piggy_bank_id' => $this->validatePiggyBankId((int)$value),
|
||||
'piggy_bank_name' => $this->validatePiggyBankName($value),
|
||||
'bill_id' => $this->validateBillId((int)$value),
|
||||
'transaction_journal_id' => $this->validateJournalId((int)$value),
|
||||
'bill_name' => $this->validateBillName($value),
|
||||
'budget_id' => $this->validateBudgetId((int)$value),
|
||||
'category_id' => $this->validateCategoryId((int)$value),
|
||||
'budget_name' => $this->validateBudgetName($value),
|
||||
'piggy_bank_id' => $this->validatePiggyBankId((int)$value),
|
||||
'piggy_bank_name' => $this->validatePiggyBankName($value),
|
||||
'bill_id' => $this->validateBillId((int)$value),
|
||||
'transaction_journal_id' => $this->validateJournalId((int)$value),
|
||||
'bill_name' => $this->validateBillName($value),
|
||||
'budget_id' => $this->validateBudgetId((int)$value),
|
||||
'category_id' => $this->validateCategoryId((int)$value),
|
||||
'budget_name' => $this->validateBudgetName($value),
|
||||
'source_id', 'destination_id' => $this->validateAccountId((int)$value),
|
||||
default => throw new FireflyException(sprintf('Rule BelongUser cannot handle "%s"', $attribute)),
|
||||
default => throw new FireflyException(sprintf('Rule BelongUser cannot handle "%s"', $attribute)),
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -400,9 +400,10 @@ trait AccountServiceTrait
|
||||
*
|
||||
*
|
||||
* @param Account $account
|
||||
* @param string $direction
|
||||
* @param string $openingBalance
|
||||
* @param Carbon $openingBalanceDate
|
||||
* @param string $direction
|
||||
* @param string $openingBalance
|
||||
* @param Carbon $openingBalanceDate
|
||||
*
|
||||
* @return TransactionGroup
|
||||
* @throws FireflyException
|
||||
* @throws JsonException
|
||||
@ -612,8 +613,8 @@ trait AccountServiceTrait
|
||||
* Since opening balance and date can still be empty strings, it may fail.
|
||||
*
|
||||
* @param Account $account
|
||||
* @param string $openingBalance
|
||||
* @param Carbon $openingBalanceDate
|
||||
* @param string $openingBalance
|
||||
* @param Carbon $openingBalanceDate
|
||||
*
|
||||
* @return TransactionGroup
|
||||
* @throws FireflyException
|
||||
|
@ -206,10 +206,11 @@ class CreditRecalculateService
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Account $account
|
||||
* @param string $direction
|
||||
* @param Account $account
|
||||
* @param string $direction
|
||||
* @param Transaction $transaction
|
||||
* @param string $leftOfDebt
|
||||
* @param string $leftOfDebt
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function processTransaction(Account $account, string $direction, Transaction $transaction, string $leftOfDebt): string
|
||||
|
@ -244,6 +244,7 @@ trait JournalServiceTrait
|
||||
|
||||
/**
|
||||
* @param array $types
|
||||
*
|
||||
* @return null|string
|
||||
*/
|
||||
private function getCreatableType(array $types): ?string
|
||||
|
@ -243,6 +243,7 @@ class AccountUpdateService
|
||||
|
||||
/**
|
||||
* @param array $array
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
private function getTypeIds(array $array): array
|
||||
|
@ -42,7 +42,7 @@ class GroupUpdateService
|
||||
* Update a transaction group.
|
||||
*
|
||||
* @param TransactionGroup $transactionGroup
|
||||
* @param array $data
|
||||
* @param array $data
|
||||
*
|
||||
* @return TransactionGroup
|
||||
* @throws DuplicateTransactionException
|
||||
|
@ -33,6 +33,7 @@ use FireflyIII\Services\Internal\Support\RecurringTransactionTrait;
|
||||
use FireflyIII\Services\Internal\Support\TransactionTypeTrait;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use JsonException;
|
||||
|
||||
/**
|
||||
* Class RecurrenceUpdateService
|
||||
@ -211,9 +212,10 @@ class RecurrenceUpdateService
|
||||
* TODO this method is very complex.
|
||||
*
|
||||
* @param Recurrence $recurrence
|
||||
* @param array $transactions
|
||||
* @param array $transactions
|
||||
*
|
||||
* @throws FireflyException
|
||||
* @throws \JsonException
|
||||
* @throws JsonException
|
||||
*/
|
||||
private function updateTransactions(Recurrence $recurrence, array $transactions): void
|
||||
{
|
||||
@ -273,6 +275,7 @@ class RecurrenceUpdateService
|
||||
/**
|
||||
* @param Recurrence $recurrence
|
||||
* @param array $combination
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function updateCombination(Recurrence $recurrence, array $combination): void
|
||||
@ -354,6 +357,7 @@ class RecurrenceUpdateService
|
||||
/**
|
||||
* @param Recurrence $recurrence
|
||||
* @param int $transactionId
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function deleteTransaction(Recurrence $recurrence, int $transactionId): void
|
||||
|
@ -49,6 +49,7 @@ class RemoteUserGuard implements Guard
|
||||
*
|
||||
* @param UserProvider $provider
|
||||
* @param Application $app
|
||||
*
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
|
@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
/*
|
||||
* Calculator.php
|
||||
* Copyright (c) 2023 Antonio Spinelli https://github.com/tonicospinelli
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
@ -21,10 +21,13 @@ declare(strict_types=1);
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Support\Calendar;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Support\Calendar\Exceptions\IntervalException;
|
||||
use SplObjectStorage;
|
||||
|
||||
/**
|
||||
* Class Calculator
|
||||
@ -32,62 +35,18 @@ use FireflyIII\Support\Calendar\Exceptions\IntervalException;
|
||||
class Calculator
|
||||
{
|
||||
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) {
|
||||
return self::$intervalMap;
|
||||
}
|
||||
self::$intervalMap = new \SplObjectStorage();
|
||||
foreach (Periodicity::cases() as $interval) {
|
||||
$periodicityClass = __NAMESPACE__ . "\\Periodicity\\{$interval->name}";
|
||||
self::$intervals[] = $interval->name;
|
||||
self::$intervalMap->attach($interval, new $periodicityClass());
|
||||
}
|
||||
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;
|
||||
}
|
||||
private static ?SplObjectStorage $intervalMap = null;
|
||||
private static array $intervals = [];
|
||||
|
||||
/**
|
||||
* @param Carbon $epoch
|
||||
* @param Periodicity $periodicity
|
||||
* @param int $skipInterval
|
||||
*
|
||||
* @return Carbon
|
||||
* @throws IntervalException
|
||||
*/
|
||||
public function nextDateByInterval(Carbon $epoch, Periodicity $periodicity, int $skipInterval = 0): Carbon
|
||||
{
|
||||
public function nextDateByInterval(Carbon $epoch, Periodicity $periodicity, int $skipInterval = 0): Carbon {
|
||||
if (!self::isAvailablePeriodicity($periodicity)) {
|
||||
throw IntervalException::unavailable($periodicity, self::$intervals);
|
||||
}
|
||||
@ -98,4 +57,47 @@ class Calculator
|
||||
return $periodicity->nextDate($epoch->clone(), $interval);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Periodicity $periodicity
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isAvailablePeriodicity(Periodicity $periodicity): bool {
|
||||
return self::containsInterval($periodicity);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Periodicity $periodicity
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
private static function containsInterval(Periodicity $periodicity): bool {
|
||||
return self::loadIntervalMap()->contains($periodicity);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return SplObjectStorage
|
||||
*/
|
||||
private static function loadIntervalMap(): SplObjectStorage {
|
||||
if (self::$intervalMap != null) {
|
||||
return self::$intervalMap;
|
||||
}
|
||||
self::$intervalMap = new SplObjectStorage();
|
||||
foreach (Periodicity::cases() as $interval) {
|
||||
$periodicityClass = __NAMESPACE__ . "\\Periodicity\\{$interval->name}";
|
||||
self::$intervals[] = $interval->name;
|
||||
self::$intervalMap->attach($interval, new $periodicityClass());
|
||||
}
|
||||
return self::$intervalMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $skip
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
private function skipInterval(int $skip): int {
|
||||
return self::DEFAULT_INTERVAL + $skip;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
/*
|
||||
* IntervalException.php
|
||||
* Copyright (c) 2023 Antonio Spinelli https://github.com/tonicospinelli
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
@ -21,32 +21,36 @@ declare(strict_types=1);
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Support\Calendar\Exceptions;
|
||||
|
||||
use Exception;
|
||||
use FireflyIII\Support\Calendar\Periodicity;
|
||||
use Throwable;
|
||||
|
||||
/**
|
||||
* 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';
|
||||
|
||||
public readonly array $availableIntervals;
|
||||
public readonly Periodicity $periodicity;
|
||||
public readonly array $availableIntervals;
|
||||
protected $message = 'The periodicity %s is unknown. Choose one of available periodicity: %s';
|
||||
|
||||
/**
|
||||
* @param Periodicity $periodicity
|
||||
* @param array $intervals
|
||||
* @param int $code
|
||||
* @param \Throwable|null $previous
|
||||
* @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
|
||||
?Throwable $previous = null
|
||||
): IntervalException {
|
||||
$message = sprintf(
|
||||
'The periodicity %s is unknown. Choose one of available periodicity: %s',
|
||||
|
@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
/*
|
||||
* Periodicity.php
|
||||
* Copyright (c) 2023 Antonio Spinelli <https://github.com/tonicospinelli>
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
@ -21,6 +21,8 @@ declare(strict_types=1);
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Support\Calendar;
|
||||
|
||||
/**
|
||||
|
@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
/*
|
||||
* Bimonthly.php
|
||||
* Copyright (c) 2023 Antonio Spinelli <https://github.com/tonicospinelli>
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
@ -21,6 +21,8 @@ declare(strict_types=1);
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Support\Calendar\Periodicity;
|
||||
|
||||
/**
|
||||
|
@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
/*
|
||||
* Daily.php
|
||||
* Copyright (c) 2023 Antonio Spinelli <https://github.com/tonicospinelli>
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
@ -21,6 +21,8 @@ declare(strict_types=1);
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Support\Calendar\Periodicity;
|
||||
|
||||
use Carbon\Carbon;
|
||||
@ -32,11 +34,11 @@ final class Daily extends Interval
|
||||
{
|
||||
/**
|
||||
* @param Carbon $date
|
||||
* @param int $interval
|
||||
* @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));
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
/*
|
||||
* Fortnightly.php
|
||||
* Copyright (c) 2023 Antonio Spinelli <https://github.com/tonicospinelli>
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
@ -21,6 +21,8 @@ declare(strict_types=1);
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Support\Calendar\Periodicity;
|
||||
|
||||
/**
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user