mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Clean up code.
This commit is contained in:
@@ -50,7 +50,7 @@ class APIEventHandler
|
||||
if (null !== $user) {
|
||||
try {
|
||||
Notification::send($user, new NewAccessToken());
|
||||
} catch (Exception $e) { /** @phpstan-ignore-line */
|
||||
} catch (Exception $e) { // @phpstan-ignore-line
|
||||
$message = $e->getMessage();
|
||||
if (str_contains($message, 'Bcc')) {
|
||||
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
|
||||
|
@@ -31,7 +31,6 @@ use FireflyIII\Notifications\Admin\TestNotification;
|
||||
use FireflyIII\Notifications\Admin\UserInvitation;
|
||||
use FireflyIII\Notifications\Admin\VersionCheckResult;
|
||||
use FireflyIII\Repositories\User\UserRepositoryInterface;
|
||||
use FireflyIII\Support\Facades\FireflyConfig;
|
||||
use Illuminate\Support\Facades\Notification;
|
||||
|
||||
/**
|
||||
@@ -58,7 +57,7 @@ class AdminEventHandler
|
||||
if ($repository->hasRole($user, 'owner')) {
|
||||
try {
|
||||
Notification::send($user, new UserInvitation($event->invitee));
|
||||
} catch (Exception $e) { /** @phpstan-ignore-line */
|
||||
} catch (Exception $e) { // @phpstan-ignore-line
|
||||
$message = $e->getMessage();
|
||||
if (str_contains($message, 'Bcc')) {
|
||||
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
|
||||
@@ -96,7 +95,7 @@ class AdminEventHandler
|
||||
if ($repository->hasRole($user, 'owner')) {
|
||||
try {
|
||||
Notification::send($user, new VersionCheckResult($event->message));
|
||||
} catch (Exception $e) { /** @phpstan-ignore-line */
|
||||
} catch (Exception $e) {// @phpstan-ignore-line
|
||||
$message = $e->getMessage();
|
||||
if (str_contains($message, 'Bcc')) {
|
||||
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
|
||||
@@ -130,7 +129,7 @@ class AdminEventHandler
|
||||
}
|
||||
try {
|
||||
Notification::send($event->user, new TestNotification($event->user->email));
|
||||
} catch (Exception $e) { /** @phpstan-ignore-line */
|
||||
} catch (Exception $e) { // @phpstan-ignore-line
|
||||
$message = $e->getMessage();
|
||||
if (str_contains($message, 'Bcc')) {
|
||||
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
|
||||
|
@@ -75,7 +75,7 @@ class AutomationHandler
|
||||
}
|
||||
try {
|
||||
Notification::send($user, new TransactionCreation($groups));
|
||||
} catch (Exception $e) { /** @phpstan-ignore-line */
|
||||
} catch (Exception $e) { // @phpstan-ignore-line
|
||||
$message = $e->getMessage();
|
||||
if (str_contains($message, 'Bcc')) {
|
||||
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
|
||||
|
@@ -51,7 +51,7 @@ class BillEventHandler
|
||||
app('log')->debug('Bill reminder is true!');
|
||||
try {
|
||||
Notification::send($bill->user, new BillReminder($bill, $event->field, $event->diff));
|
||||
} catch (Exception $e) { /** @phpstan-ignore-line */
|
||||
} catch (Exception $e) { // @phpstan-ignore-line
|
||||
$message = $e->getMessage();
|
||||
if (str_contains($message, 'Bcc')) {
|
||||
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
|
||||
|
@@ -93,7 +93,7 @@ class BudgetLimitHandler
|
||||
$viewRange = '1M';
|
||||
}
|
||||
// safety catch
|
||||
if(null === $viewRange || is_array($viewRange)){
|
||||
if (null === $viewRange || is_array($viewRange)) {
|
||||
$viewRange = '1M';
|
||||
}
|
||||
$viewRange = (string)$viewRange;
|
||||
@@ -190,8 +190,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()
|
||||
);
|
||||
@@ -236,8 +236,8 @@ class BudgetLimitHandler
|
||||
return '0';
|
||||
}
|
||||
$limitPeriod = Period::make(
|
||||
$budgetLimit->start_date,
|
||||
$budgetLimit->end_date,
|
||||
$budgetLimit->start_date,
|
||||
$budgetLimit->end_date,
|
||||
precision : Precision::DAY(),
|
||||
boundaries: Boundaries::EXCLUDE_NONE()
|
||||
);
|
||||
|
@@ -131,7 +131,7 @@ class UserEventHandler
|
||||
$group = null;
|
||||
|
||||
// create a new group.
|
||||
while (true === $groupExists) { /** @phpstan-ignore-line */
|
||||
while (true === $groupExists) { // @phpstan-ignore-line
|
||||
$groupExists = UserGroup::where('title', $groupTitle)->count() > 0;
|
||||
if (false === $groupExists) {
|
||||
$group = UserGroup::create(['title' => $groupTitle]);
|
||||
@@ -205,7 +205,7 @@ class UserEventHandler
|
||||
if (false === $entry['notified']) {
|
||||
try {
|
||||
Notification::send($user, new UserLogin($ipAddress));
|
||||
} catch (Exception $e) {/** @phpstan-ignore-line */
|
||||
} catch (Exception $e) { // @phpstan-ignore-line
|
||||
$message = $e->getMessage();
|
||||
if (str_contains($message, 'Bcc')) {
|
||||
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
|
||||
@@ -239,7 +239,7 @@ class UserEventHandler
|
||||
if ($repository->hasRole($user, 'owner')) {
|
||||
try {
|
||||
Notification::send($user, new AdminRegistrationNotification($event->user));
|
||||
} catch (Exception $e) { /** @phpstan-ignore-line */
|
||||
} catch (Exception $e) { // @phpstan-ignore-line
|
||||
$message = $e->getMessage();
|
||||
if (str_contains($message, 'Bcc')) {
|
||||
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
|
||||
@@ -316,7 +316,7 @@ class UserEventHandler
|
||||
{
|
||||
try {
|
||||
Notification::send($event->user, new UserNewPassword(route('password.reset', [$event->token])));
|
||||
} catch (Exception $e) { /** @phpstan-ignore-line */
|
||||
} catch (Exception $e) { // @phpstan-ignore-line
|
||||
$message = $e->getMessage();
|
||||
if (str_contains($message, 'Bcc')) {
|
||||
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
|
||||
@@ -364,7 +364,7 @@ class UserEventHandler
|
||||
if ($sendMail) {
|
||||
try {
|
||||
Notification::send($event->user, new UserRegistrationNotification());
|
||||
} catch (Exception $e) { /** @phpstan-ignore-line */
|
||||
} catch (Exception $e) { // @phpstan-ignore-line
|
||||
$message = $e->getMessage();
|
||||
if (str_contains($message, 'Bcc')) {
|
||||
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
|
||||
|
Reference in New Issue
Block a user