Code for new release

This commit is contained in:
James Cole
2023-07-15 16:02:42 +02:00
parent f43b539470
commit b557805eeb
213 changed files with 1942 additions and 1426 deletions

View File

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

View File

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

View File

@@ -42,6 +42,7 @@ class AutomationHandler
* Respond to the creation of X journals.
*
* @param RequestedReportOnJournals $event
*
* @throws FireflyException
*/
public function reportJournals(RequestedReportOnJournals $event): void

View File

@@ -38,6 +38,7 @@ class BillEventHandler
{
/**
* @param WarnUserAboutBill $event
*
* @return void
*/
public function warnAboutBill(WarnUserAboutBill $event): void

View File

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

View File

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