mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-13 16:00:13 +00:00
Level 7 yay!
This commit is contained in:
@@ -10,7 +10,7 @@ parameters:
|
|||||||
universalObjectCratesClasses:
|
universalObjectCratesClasses:
|
||||||
- Illuminate\Database\Eloquent\Model
|
- Illuminate\Database\Eloquent\Model
|
||||||
# TODO: slowly remove these parameters and fix the issues found.
|
# TODO: slowly remove these parameters and fix the issues found.
|
||||||
reportUnmatchedIgnoredErrors: false
|
reportUnmatchedIgnoredErrors: true
|
||||||
ignoreErrors:
|
ignoreErrors:
|
||||||
# TODO: slowly remove these exceptions and fix the issues found.
|
# TODO: slowly remove these exceptions and fix the issues found.
|
||||||
- '#Dynamic call to static method#' # all the Laravel ORM things depend on this.
|
- '#Dynamic call to static method#' # all the Laravel ORM things depend on this.
|
||||||
|
@@ -88,21 +88,21 @@ class StoreController extends Controller
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
$transactionGroup = $this->groupRepository->store($data);
|
$transactionGroup = $this->groupRepository->store($data);
|
||||||
} catch (DuplicateTransactionException $e) { // @phpstan-ignore-line
|
} catch (DuplicateTransactionException $e) {
|
||||||
app('log')->warning('Caught a duplicate transaction. Return error message.');
|
app('log')->warning('Caught a duplicate transaction. Return error message.');
|
||||||
$validator = \Validator::make(
|
$validator = \Validator::make(
|
||||||
['transactions' => [['description' => $e->getMessage()]]],
|
['transactions' => [['description' => $e->getMessage()]]],
|
||||||
['transactions.0.description' => new IsDuplicateTransaction()]
|
['transactions.0.description' => new IsDuplicateTransaction()]
|
||||||
);
|
);
|
||||||
|
|
||||||
throw new ValidationException($validator); // @phpstan-ignore-line
|
throw new ValidationException($validator);
|
||||||
} catch (FireflyException $e) { // @phpstan-ignore-line
|
} catch (FireflyException $e) {
|
||||||
app('log')->warning('Caught an exception. Return error message.');
|
app('log')->warning('Caught an exception. Return error message.');
|
||||||
app('log')->error($e->getMessage());
|
app('log')->error($e->getMessage());
|
||||||
$message = sprintf('Internal exception: %s', $e->getMessage());
|
$message = sprintf('Internal exception: %s', $e->getMessage());
|
||||||
$validator = \Validator::make(['transactions' => [['description' => $message]]], ['transactions.0.description' => new IsDuplicateTransaction()]);
|
$validator = \Validator::make(['transactions' => [['description' => $message]]], ['transactions.0.description' => new IsDuplicateTransaction()]);
|
||||||
|
|
||||||
throw new ValidationException($validator); // @phpstan-ignore-line
|
throw new ValidationException($validator);
|
||||||
}
|
}
|
||||||
app('preferences')->mark();
|
app('preferences')->mark();
|
||||||
$applyRules = $data['apply_rules'] ?? true;
|
$applyRules = $data['apply_rules'] ?? true;
|
||||||
|
@@ -239,7 +239,7 @@ class ListController extends Controller
|
|||||||
$unfiltered = $recurringRepos->getAll();
|
$unfiltered = $recurringRepos->getAll();
|
||||||
|
|
||||||
// filter selection
|
// filter selection
|
||||||
$collection = $unfiltered->filter( // @phpstan-ignore-line
|
$collection = $unfiltered->filter(
|
||||||
static function (Recurrence $recurrence) use ($currency) { // @phpstan-ignore-line
|
static function (Recurrence $recurrence) use ($currency) { // @phpstan-ignore-line
|
||||||
/** @var RecurrenceTransaction $transaction */
|
/** @var RecurrenceTransaction $transaction */
|
||||||
foreach ($recurrence->recurrenceTransactions as $transaction) {
|
foreach ($recurrence->recurrenceTransactions as $transaction) {
|
||||||
@@ -286,7 +286,7 @@ class ListController extends Controller
|
|||||||
$ruleRepos = app(RuleRepositoryInterface::class);
|
$ruleRepos = app(RuleRepositoryInterface::class);
|
||||||
$unfiltered = $ruleRepos->getAll();
|
$unfiltered = $ruleRepos->getAll();
|
||||||
|
|
||||||
$collection = $unfiltered->filter( // @phpstan-ignore-line
|
$collection = $unfiltered->filter(
|
||||||
static function (Rule $rule) use ($currency) { // @phpstan-ignore-line
|
static function (Rule $rule) use ($currency) { // @phpstan-ignore-line
|
||||||
/** @var RuleTrigger $trigger */
|
/** @var RuleTrigger $trigger */
|
||||||
foreach ($rule->ruleTriggers as $trigger) {
|
foreach ($rule->ruleTriggers as $trigger) {
|
||||||
|
@@ -80,21 +80,21 @@ class StoreController extends Controller
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
$transactionGroup = $this->groupRepository->store($data);
|
$transactionGroup = $this->groupRepository->store($data);
|
||||||
} catch (DuplicateTransactionException $e) { // @phpstan-ignore-line
|
} catch (DuplicateTransactionException $e) {
|
||||||
app('log')->warning('Caught a duplicate transaction. Return error message.');
|
app('log')->warning('Caught a duplicate transaction. Return error message.');
|
||||||
$validator = Validator::make(
|
$validator = Validator::make(
|
||||||
['transactions' => [['description' => $e->getMessage()]]],
|
['transactions' => [['description' => $e->getMessage()]]],
|
||||||
['transactions.0.description' => new IsDuplicateTransaction()]
|
['transactions.0.description' => new IsDuplicateTransaction()]
|
||||||
);
|
);
|
||||||
|
|
||||||
throw new ValidationException($validator); // @phpstan-ignore-line
|
throw new ValidationException($validator);
|
||||||
} catch (FireflyException $e) { // @phpstan-ignore-line
|
} catch (FireflyException $e) {
|
||||||
app('log')->warning('Caught an exception. Return error message.');
|
app('log')->warning('Caught an exception. Return error message.');
|
||||||
app('log')->error($e->getMessage());
|
app('log')->error($e->getMessage());
|
||||||
$message = sprintf('Internal exception: %s', $e->getMessage());
|
$message = sprintf('Internal exception: %s', $e->getMessage());
|
||||||
$validator = Validator::make(['transactions' => [['description' => $message]]], ['transactions.0.description' => new IsDuplicateTransaction()]);
|
$validator = Validator::make(['transactions' => [['description' => $message]]], ['transactions.0.description' => new IsDuplicateTransaction()]);
|
||||||
|
|
||||||
throw new ValidationException($validator); // @phpstan-ignore-line
|
throw new ValidationException($validator);
|
||||||
}
|
}
|
||||||
app('preferences')->mark();
|
app('preferences')->mark();
|
||||||
$applyRules = $data['apply_rules'] ?? true;
|
$applyRules = $data['apply_rules'] ?? true;
|
||||||
|
@@ -173,7 +173,7 @@ class ForcesDecimalSize extends Command
|
|||||||
* @var array $fields
|
* @var array $fields
|
||||||
*/
|
*/
|
||||||
foreach ($this->tables as $name => $fields) {
|
foreach ($this->tables as $name => $fields) {
|
||||||
switch ($name) { // @phpstan-ignore-line
|
switch ($name) {
|
||||||
default:
|
default:
|
||||||
$message = sprintf('Cannot handle table "%s"', $name);
|
$message = sprintf('Cannot handle table "%s"', $name);
|
||||||
$this->friendlyError($message);
|
$this->friendlyError($message);
|
||||||
@@ -239,7 +239,7 @@ class ForcesDecimalSize extends Command
|
|||||||
$query->where(static function (Builder $q) use ($fields, $currency, $operator, $cast, $regularExpression): void {
|
$query->where(static function (Builder $q) use ($fields, $currency, $operator, $cast, $regularExpression): void {
|
||||||
foreach ($fields as $field) {
|
foreach ($fields as $field) {
|
||||||
$q->orWhere(
|
$q->orWhere(
|
||||||
DB::raw(sprintf('CAST(accounts.%s AS %s)', $field, $cast)), // @phpstan-ignore-line
|
DB::raw(sprintf('CAST(accounts.%s AS %s)', $field, $cast)),
|
||||||
$operator,
|
$operator,
|
||||||
DB::raw(sprintf($regularExpression, $currency->decimal_places))
|
DB::raw(sprintf($regularExpression, $currency->decimal_places))
|
||||||
);
|
);
|
||||||
@@ -288,7 +288,7 @@ class ForcesDecimalSize extends Command
|
|||||||
/** @var string $field */
|
/** @var string $field */
|
||||||
foreach ($fields as $field) {
|
foreach ($fields as $field) {
|
||||||
$q->orWhere(
|
$q->orWhere(
|
||||||
DB::raw(sprintf('CAST(%s AS %s)', $field, $cast)), // @phpstan-ignore-line
|
DB::raw(sprintf('CAST(%s AS %s)', $field, $cast)),
|
||||||
$operator,
|
$operator,
|
||||||
DB::raw(sprintf($regularExpression, $currency->decimal_places))
|
DB::raw(sprintf($regularExpression, $currency->decimal_places))
|
||||||
);
|
);
|
||||||
@@ -340,7 +340,7 @@ class ForcesDecimalSize extends Command
|
|||||||
->where(static function (Builder $q) use ($fields, $currency, $cast, $operator, $regularExpression): void {
|
->where(static function (Builder $q) use ($fields, $currency, $cast, $operator, $regularExpression): void {
|
||||||
foreach ($fields as $field) {
|
foreach ($fields as $field) {
|
||||||
$q->orWhere(
|
$q->orWhere(
|
||||||
DB::raw(sprintf('CAST(piggy_bank_events.%s AS %s)', $field, $cast)), // @phpstan-ignore-line
|
DB::raw(sprintf('CAST(piggy_bank_events.%s AS %s)', $field, $cast)),
|
||||||
$operator,
|
$operator,
|
||||||
DB::raw(sprintf($regularExpression, $currency->decimal_places))
|
DB::raw(sprintf($regularExpression, $currency->decimal_places))
|
||||||
);
|
);
|
||||||
@@ -395,7 +395,7 @@ class ForcesDecimalSize extends Command
|
|||||||
->where(static function (Builder $q) use ($fields, $currency, $operator, $cast, $regularExpression): void {
|
->where(static function (Builder $q) use ($fields, $currency, $operator, $cast, $regularExpression): void {
|
||||||
foreach ($fields as $field) {
|
foreach ($fields as $field) {
|
||||||
$q->orWhere(
|
$q->orWhere(
|
||||||
DB::raw(sprintf('CAST(piggy_bank_repetitions.%s AS %s)', $field, $cast)), // @phpstan-ignore-line
|
DB::raw(sprintf('CAST(piggy_bank_repetitions.%s AS %s)', $field, $cast)),
|
||||||
$operator,
|
$operator,
|
||||||
DB::raw(sprintf($regularExpression, $currency->decimal_places))
|
DB::raw(sprintf($regularExpression, $currency->decimal_places))
|
||||||
);
|
);
|
||||||
@@ -448,7 +448,7 @@ class ForcesDecimalSize extends Command
|
|||||||
->where(static function (Builder $q) use ($fields, $currency, $operator, $cast, $regularExpression): void {
|
->where(static function (Builder $q) use ($fields, $currency, $operator, $cast, $regularExpression): void {
|
||||||
foreach ($fields as $field) {
|
foreach ($fields as $field) {
|
||||||
$q->orWhere(
|
$q->orWhere(
|
||||||
DB::raw(sprintf('CAST(piggy_banks.%s AS %s)', $field, $cast)), // @phpstan-ignore-line
|
DB::raw(sprintf('CAST(piggy_banks.%s AS %s)', $field, $cast)),
|
||||||
$operator,
|
$operator,
|
||||||
DB::raw(sprintf($regularExpression, $currency->decimal_places))
|
DB::raw(sprintf($regularExpression, $currency->decimal_places))
|
||||||
);
|
);
|
||||||
@@ -490,7 +490,7 @@ class ForcesDecimalSize extends Command
|
|||||||
// select all transactions with this currency and issue.
|
// select all transactions with this currency and issue.
|
||||||
/** @var Builder $query */
|
/** @var Builder $query */
|
||||||
$query = Transaction::where('transaction_currency_id', $currency->id)->where(
|
$query = Transaction::where('transaction_currency_id', $currency->id)->where(
|
||||||
DB::raw(sprintf('CAST(amount as %s)', $this->cast)), // @phpstan-ignore-line
|
DB::raw(sprintf('CAST(amount as %s)', $this->cast)),
|
||||||
$this->operator,
|
$this->operator,
|
||||||
DB::raw(sprintf($this->regularExpression, $currency->decimal_places))
|
DB::raw(sprintf($this->regularExpression, $currency->decimal_places))
|
||||||
);
|
);
|
||||||
@@ -518,7 +518,7 @@ class ForcesDecimalSize extends Command
|
|||||||
// select all transactions with this FOREIGN currency and issue.
|
// select all transactions with this FOREIGN currency and issue.
|
||||||
/** @var Builder $query */
|
/** @var Builder $query */
|
||||||
$query = Transaction::where('foreign_currency_id', $currency->id)->where(
|
$query = Transaction::where('foreign_currency_id', $currency->id)->where(
|
||||||
DB::raw(sprintf('CAST(foreign_amount as %s)', $this->cast)), // @phpstan-ignore-line
|
DB::raw(sprintf('CAST(foreign_amount as %s)', $this->cast)),
|
||||||
$this->operator,
|
$this->operator,
|
||||||
DB::raw(sprintf($this->regularExpression, $currency->decimal_places))
|
DB::raw(sprintf($this->regularExpression, $currency->decimal_places))
|
||||||
);
|
);
|
||||||
|
@@ -422,7 +422,7 @@ class TransactionJournalFactory
|
|||||||
|
|
||||||
return [$sourceAccount, $destinationAccount];
|
return [$sourceAccount, $destinationAccount];
|
||||||
}
|
}
|
||||||
if (null === $destinationAccount) { // @phpstan-ignore-line
|
if (null === $destinationAccount) {
|
||||||
app('log')->debug('Destination account is NULL, source account is not.');
|
app('log')->debug('Destination account is NULL, source account is not.');
|
||||||
$account = $this->accountRepository->getReconciliation($sourceAccount);
|
$account = $this->accountRepository->getReconciliation($sourceAccount);
|
||||||
app('log')->debug(sprintf('Will return account #%d ("%s") of type "%s"', $account->id, $account->name, $account->accountType->type));
|
app('log')->debug(sprintf('Will return account #%d ("%s") of type "%s"', $account->id, $account->name, $account->accountType->type));
|
||||||
|
@@ -48,7 +48,7 @@ class APIEventHandler
|
|||||||
if (null !== $user) {
|
if (null !== $user) {
|
||||||
try {
|
try {
|
||||||
Notification::send($user, new NewAccessToken());
|
Notification::send($user, new NewAccessToken());
|
||||||
} catch (\Exception $e) { // @phpstan-ignore-line
|
} catch (\Exception $e) {
|
||||||
$message = $e->getMessage();
|
$message = $e->getMessage();
|
||||||
if (str_contains($message, 'Bcc')) {
|
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.');
|
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
|
||||||
|
@@ -52,7 +52,7 @@ class AdminEventHandler
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
Notification::send(new OwnerNotifiable(), new UserInvitation($event->invitee));
|
Notification::send(new OwnerNotifiable(), new UserInvitation($event->invitee));
|
||||||
} catch (\Exception $e) { // @phpstan-ignore-line
|
} catch (\Exception $e) {
|
||||||
$message = $e->getMessage();
|
$message = $e->getMessage();
|
||||||
if (str_contains($message, 'Bcc')) {
|
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.');
|
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
|
||||||
@@ -74,7 +74,7 @@ class AdminEventHandler
|
|||||||
try {
|
try {
|
||||||
$owner = new OwnerNotifiable();
|
$owner = new OwnerNotifiable();
|
||||||
Notification::send($owner, new UnknownUserLoginAttempt($event->address));
|
Notification::send($owner, new UnknownUserLoginAttempt($event->address));
|
||||||
} catch (\Exception $e) { // @phpstan-ignore-line
|
} catch (\Exception $e) {
|
||||||
$message = $e->getMessage();
|
$message = $e->getMessage();
|
||||||
if (str_contains($message, 'Bcc')) {
|
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.');
|
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
|
||||||
@@ -104,7 +104,7 @@ class AdminEventHandler
|
|||||||
try {
|
try {
|
||||||
$owner = new OwnerNotifiable();
|
$owner = new OwnerNotifiable();
|
||||||
Notification::send($owner, new VersionCheckResult($event->message));
|
Notification::send($owner, new VersionCheckResult($event->message));
|
||||||
} catch (\Exception $e) {// @phpstan-ignore-line
|
} catch (\Exception $e) {
|
||||||
$message = $e->getMessage();
|
$message = $e->getMessage();
|
||||||
if (str_contains($message, 'Bcc')) {
|
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.');
|
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
|
||||||
@@ -158,7 +158,7 @@ class AdminEventHandler
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
Notification::send($event->owner, new $class());
|
Notification::send($event->owner, new $class());
|
||||||
} catch (\Exception $e) { // @phpstan-ignore-line
|
} catch (\Exception $e) {
|
||||||
$message = $e->getMessage();
|
$message = $e->getMessage();
|
||||||
if (str_contains($message, 'Bcc')) {
|
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.');
|
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
|
||||||
|
@@ -78,7 +78,7 @@ class AutomationHandler
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
Notification::send($user, new TransactionCreation($groups));
|
Notification::send($user, new TransactionCreation($groups));
|
||||||
} catch (\Exception $e) { // @phpstan-ignore-line
|
} catch (\Exception $e) {
|
||||||
$message = $e->getMessage();
|
$message = $e->getMessage();
|
||||||
if (str_contains($message, 'Bcc')) {
|
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.');
|
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
|
||||||
|
@@ -47,7 +47,7 @@ class BillEventHandler
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
Notification::send($bill->user, new BillReminder($bill, $event->field, $event->diff));
|
Notification::send($bill->user, new BillReminder($bill, $event->field, $event->diff));
|
||||||
} catch (\Exception $e) { // @phpstan-ignore-line
|
} catch (\Exception $e) {
|
||||||
$message = $e->getMessage();
|
$message = $e->getMessage();
|
||||||
if (str_contains($message, 'Bcc')) {
|
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.');
|
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 MFAHandler
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
Notification::send($user, new MFABackupFewLeftNotification($user, $count));
|
Notification::send($user, new MFABackupFewLeftNotification($user, $count));
|
||||||
} catch (\Exception $e) { // @phpstan-ignore-line
|
} catch (\Exception $e) {
|
||||||
$message = $e->getMessage();
|
$message = $e->getMessage();
|
||||||
if (str_contains($message, 'Bcc')) {
|
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.');
|
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
|
||||||
@@ -76,7 +76,7 @@ class MFAHandler
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
Notification::send($user, new MFABackupNoLeftNotification($user));
|
Notification::send($user, new MFABackupNoLeftNotification($user));
|
||||||
} catch (\Exception $e) { // @phpstan-ignore-line
|
} catch (\Exception $e) {
|
||||||
$message = $e->getMessage();
|
$message = $e->getMessage();
|
||||||
if (str_contains($message, 'Bcc')) {
|
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.');
|
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
|
||||||
@@ -101,7 +101,7 @@ class MFAHandler
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
Notification::send($user, new DisabledMFANotification($user));
|
Notification::send($user, new DisabledMFANotification($user));
|
||||||
} catch (\Exception $e) { // @phpstan-ignore-line
|
} catch (\Exception $e) {
|
||||||
$message = $e->getMessage();
|
$message = $e->getMessage();
|
||||||
if (str_contains($message, 'Bcc')) {
|
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.');
|
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
|
||||||
@@ -126,7 +126,7 @@ class MFAHandler
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
Notification::send($user, new EnabledMFANotification($user));
|
Notification::send($user, new EnabledMFANotification($user));
|
||||||
} catch (\Exception $e) { // @phpstan-ignore-line
|
} catch (\Exception $e) {
|
||||||
$message = $e->getMessage();
|
$message = $e->getMessage();
|
||||||
if (str_contains($message, 'Bcc')) {
|
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.');
|
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
|
||||||
@@ -152,7 +152,7 @@ class MFAHandler
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
Notification::send($user, new MFAManyFailedAttemptsNotification($user, $count));
|
Notification::send($user, new MFAManyFailedAttemptsNotification($user, $count));
|
||||||
} catch (\Exception $e) { // @phpstan-ignore-line
|
} catch (\Exception $e) {
|
||||||
$message = $e->getMessage();
|
$message = $e->getMessage();
|
||||||
if (str_contains($message, 'Bcc')) {
|
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.');
|
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
|
||||||
@@ -177,7 +177,7 @@ class MFAHandler
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
Notification::send($user, new NewBackupCodesNotification($user));
|
Notification::send($user, new NewBackupCodesNotification($user));
|
||||||
} catch (\Exception $e) { // @phpstan-ignore-line
|
} catch (\Exception $e) {
|
||||||
$message = $e->getMessage();
|
$message = $e->getMessage();
|
||||||
if (str_contains($message, 'Bcc')) {
|
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.');
|
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
|
||||||
@@ -202,7 +202,7 @@ class MFAHandler
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
Notification::send($user, new MFAUsedBackupCodeNotification($user));
|
Notification::send($user, new MFAUsedBackupCodeNotification($user));
|
||||||
} catch (\Exception $e) { // @phpstan-ignore-line
|
} catch (\Exception $e) {
|
||||||
$message = $e->getMessage();
|
$message = $e->getMessage();
|
||||||
if (str_contains($message, 'Bcc')) {
|
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.');
|
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
|
||||||
|
@@ -203,7 +203,7 @@ class UserEventHandler
|
|||||||
if (false === $entry['notified']) {
|
if (false === $entry['notified']) {
|
||||||
try {
|
try {
|
||||||
Notification::send($user, new UserLogin());
|
Notification::send($user, new UserLogin());
|
||||||
} catch (\Exception $e) { // @phpstan-ignore-line
|
} catch (\Exception $e) {
|
||||||
$message = $e->getMessage();
|
$message = $e->getMessage();
|
||||||
if (str_contains($message, 'Bcc')) {
|
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.');
|
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
|
||||||
@@ -233,7 +233,7 @@ class UserEventHandler
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
Notification::send($owner, new AdminRegistrationNotification($event->user));
|
Notification::send($owner, new AdminRegistrationNotification($event->user));
|
||||||
} catch (\Exception $e) { // @phpstan-ignore-line
|
} catch (\Exception $e) {
|
||||||
$message = $e->getMessage();
|
$message = $e->getMessage();
|
||||||
if (str_contains($message, 'Bcc')) {
|
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.');
|
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
|
||||||
@@ -304,7 +304,7 @@ class UserEventHandler
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
Notification::send($event->user, new UserFailedLoginAttempt($event->user));
|
Notification::send($event->user, new UserFailedLoginAttempt($event->user));
|
||||||
} catch (\Exception $e) { // @phpstan-ignore-line
|
} catch (\Exception $e) {
|
||||||
$message = $e->getMessage();
|
$message = $e->getMessage();
|
||||||
if (str_contains($message, 'Bcc')) {
|
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.');
|
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
|
||||||
@@ -328,7 +328,7 @@ class UserEventHandler
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
Notification::send($event->user, new UserNewPassword(route('password.reset', [$event->token])));
|
Notification::send($event->user, new UserNewPassword(route('password.reset', [$event->token])));
|
||||||
} catch (\Exception $e) { // @phpstan-ignore-line
|
} catch (\Exception $e) {
|
||||||
$message = $e->getMessage();
|
$message = $e->getMessage();
|
||||||
if (str_contains($message, 'Bcc')) {
|
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.');
|
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
|
||||||
@@ -374,7 +374,7 @@ class UserEventHandler
|
|||||||
if ($sendMail) {
|
if ($sendMail) {
|
||||||
try {
|
try {
|
||||||
Notification::send($event->user, new UserRegistrationNotification());
|
Notification::send($event->user, new UserRegistrationNotification());
|
||||||
} catch (\Exception $e) { // @phpstan-ignore-line
|
} catch (\Exception $e) {
|
||||||
$message = $e->getMessage();
|
$message = $e->getMessage();
|
||||||
if (str_contains($message, 'Bcc')) {
|
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.');
|
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
|
||||||
@@ -429,7 +429,7 @@ class UserEventHandler
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
Notification::send($event->user, new $class());
|
Notification::send($event->user, new $class());
|
||||||
} catch (\Exception $e) { // @phpstan-ignore-line
|
} catch (\Exception $e) {
|
||||||
$message = $e->getMessage();
|
$message = $e->getMessage();
|
||||||
if (str_contains($message, 'Bcc')) {
|
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.');
|
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
|
||||||
|
@@ -155,7 +155,7 @@ class GroupCollector implements GroupCollectorInterface
|
|||||||
public function descriptionDoesNotEnd(array $array): GroupCollectorInterface
|
public function descriptionDoesNotEnd(array $array): GroupCollectorInterface
|
||||||
{
|
{
|
||||||
$this->query->where(
|
$this->query->where(
|
||||||
static function (EloquentBuilder $q) use ($array): void { // @phpstan-ignore-line
|
static function (EloquentBuilder $q) use ($array): void {
|
||||||
$q->where(
|
$q->where(
|
||||||
static function (EloquentBuilder $q1) use ($array): void {
|
static function (EloquentBuilder $q1) use ($array): void {
|
||||||
foreach ($array as $word) {
|
foreach ($array as $word) {
|
||||||
@@ -182,7 +182,7 @@ class GroupCollector implements GroupCollectorInterface
|
|||||||
public function descriptionDoesNotStart(array $array): GroupCollectorInterface
|
public function descriptionDoesNotStart(array $array): GroupCollectorInterface
|
||||||
{
|
{
|
||||||
$this->query->where(
|
$this->query->where(
|
||||||
static function (EloquentBuilder $q) use ($array): void { // @phpstan-ignore-line
|
static function (EloquentBuilder $q) use ($array): void {
|
||||||
$q->where(
|
$q->where(
|
||||||
static function (EloquentBuilder $q1) use ($array): void {
|
static function (EloquentBuilder $q1) use ($array): void {
|
||||||
foreach ($array as $word) {
|
foreach ($array as $word) {
|
||||||
@@ -209,7 +209,7 @@ class GroupCollector implements GroupCollectorInterface
|
|||||||
public function descriptionEnds(array $array): GroupCollectorInterface
|
public function descriptionEnds(array $array): GroupCollectorInterface
|
||||||
{
|
{
|
||||||
$this->query->where(
|
$this->query->where(
|
||||||
static function (EloquentBuilder $q) use ($array): void { // @phpstan-ignore-line
|
static function (EloquentBuilder $q) use ($array): void {
|
||||||
$q->where(
|
$q->where(
|
||||||
static function (EloquentBuilder $q1) use ($array): void {
|
static function (EloquentBuilder $q1) use ($array): void {
|
||||||
foreach ($array as $word) {
|
foreach ($array as $word) {
|
||||||
@@ -235,7 +235,7 @@ class GroupCollector implements GroupCollectorInterface
|
|||||||
public function descriptionIs(string $value): GroupCollectorInterface
|
public function descriptionIs(string $value): GroupCollectorInterface
|
||||||
{
|
{
|
||||||
$this->query->where(
|
$this->query->where(
|
||||||
static function (EloquentBuilder $q) use ($value): void { // @phpstan-ignore-line
|
static function (EloquentBuilder $q) use ($value): void {
|
||||||
$q->where('transaction_journals.description', '=', $value);
|
$q->where('transaction_journals.description', '=', $value);
|
||||||
$q->orWhere('transaction_groups.title', '=', $value);
|
$q->orWhere('transaction_groups.title', '=', $value);
|
||||||
}
|
}
|
||||||
@@ -247,7 +247,7 @@ class GroupCollector implements GroupCollectorInterface
|
|||||||
public function descriptionIsNot(string $value): GroupCollectorInterface
|
public function descriptionIsNot(string $value): GroupCollectorInterface
|
||||||
{
|
{
|
||||||
$this->query->where(
|
$this->query->where(
|
||||||
static function (EloquentBuilder $q) use ($value): void { // @phpstan-ignore-line
|
static function (EloquentBuilder $q) use ($value): void {
|
||||||
$q->where('transaction_journals.description', '!=', $value);
|
$q->where('transaction_journals.description', '!=', $value);
|
||||||
$q->where(
|
$q->where(
|
||||||
static function (EloquentBuilder $q2) use ($value): void {
|
static function (EloquentBuilder $q2) use ($value): void {
|
||||||
@@ -264,7 +264,7 @@ class GroupCollector implements GroupCollectorInterface
|
|||||||
public function descriptionStarts(array $array): GroupCollectorInterface
|
public function descriptionStarts(array $array): GroupCollectorInterface
|
||||||
{
|
{
|
||||||
$this->query->where(
|
$this->query->where(
|
||||||
static function (EloquentBuilder $q) use ($array): void { // @phpstan-ignore-line
|
static function (EloquentBuilder $q) use ($array): void {
|
||||||
$q->where(
|
$q->where(
|
||||||
static function (EloquentBuilder $q1) use ($array): void {
|
static function (EloquentBuilder $q1) use ($array): void {
|
||||||
foreach ($array as $word) {
|
foreach ($array as $word) {
|
||||||
@@ -320,7 +320,7 @@ class GroupCollector implements GroupCollectorInterface
|
|||||||
public function excludeCurrency(TransactionCurrency $currency): GroupCollectorInterface
|
public function excludeCurrency(TransactionCurrency $currency): GroupCollectorInterface
|
||||||
{
|
{
|
||||||
$this->query->where(
|
$this->query->where(
|
||||||
static function (EloquentBuilder $q) use ($currency): void { // @phpstan-ignore-line
|
static function (EloquentBuilder $q) use ($currency): void {
|
||||||
$q->where('source.transaction_currency_id', '!=', $currency->id);
|
$q->where('source.transaction_currency_id', '!=', $currency->id);
|
||||||
$q->where(
|
$q->where(
|
||||||
static function (EloquentBuilder $q2) use ($currency): void {
|
static function (EloquentBuilder $q2) use ($currency): void {
|
||||||
@@ -378,7 +378,7 @@ class GroupCollector implements GroupCollectorInterface
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
$this->query->where(
|
$this->query->where(
|
||||||
static function (EloquentBuilder $q) use ($array): void { // @phpstan-ignore-line
|
static function (EloquentBuilder $q) use ($array): void {
|
||||||
$q->where(
|
$q->where(
|
||||||
static function (EloquentBuilder $q1) use ($array): void {
|
static function (EloquentBuilder $q1) use ($array): void {
|
||||||
foreach ($array as $word) {
|
foreach ($array as $word) {
|
||||||
@@ -515,7 +515,7 @@ class GroupCollector implements GroupCollectorInterface
|
|||||||
'user_id' => $augumentedJournal->user_id,
|
'user_id' => $augumentedJournal->user_id,
|
||||||
'user_group_id' => $augumentedJournal->user_group_id,
|
'user_group_id' => $augumentedJournal->user_group_id,
|
||||||
// Field transaction_group_title was added by the query.
|
// Field transaction_group_title was added by the query.
|
||||||
'title' => $augumentedJournal->transaction_group_title, // @phpstan-ignore-line
|
'title' => $augumentedJournal->transaction_group_title,
|
||||||
'created_at' => new Carbon($augumentedJournal->group_created_at, config('app.timezone')),
|
'created_at' => new Carbon($augumentedJournal->group_created_at, config('app.timezone')),
|
||||||
'updated_at' => new Carbon($augumentedJournal->group_updated_at, config('app.timezone')),
|
'updated_at' => new Carbon($augumentedJournal->group_updated_at, config('app.timezone')),
|
||||||
'transaction_type' => $parsedGroup['transaction_type_type'],
|
'transaction_type' => $parsedGroup['transaction_type_type'],
|
||||||
@@ -524,7 +524,7 @@ class GroupCollector implements GroupCollectorInterface
|
|||||||
'transactions' => [],
|
'transactions' => [],
|
||||||
];
|
];
|
||||||
// Field transaction_journal_id was added by the query.
|
// Field transaction_journal_id was added by the query.
|
||||||
$journalId = (int) $augumentedJournal->transaction_journal_id; // @phpstan-ignore-line
|
$journalId = (int) $augumentedJournal->transaction_journal_id;
|
||||||
$groupArray['transactions'][$journalId] = $parsedGroup;
|
$groupArray['transactions'][$journalId] = $parsedGroup;
|
||||||
$groups[$groupId] = $groupArray;
|
$groups[$groupId] = $groupArray;
|
||||||
|
|
||||||
@@ -532,7 +532,7 @@ class GroupCollector implements GroupCollectorInterface
|
|||||||
}
|
}
|
||||||
// or parse the rest.
|
// or parse the rest.
|
||||||
// Field transaction_journal_id was added by the query.
|
// Field transaction_journal_id was added by the query.
|
||||||
$journalId = (int) $augumentedJournal->transaction_journal_id; // @phpstan-ignore-line
|
$journalId = (int) $augumentedJournal->transaction_journal_id;
|
||||||
if (array_key_exists($journalId, $groups[$groupId]['transactions'])) {
|
if (array_key_exists($journalId, $groups[$groupId]['transactions'])) {
|
||||||
// append data to existing group + journal (for multiple tags or multiple attachments)
|
// append data to existing group + journal (for multiple tags or multiple attachments)
|
||||||
$groups[$groupId]['transactions'][$journalId] = $this->mergeTags($groups[$groupId]['transactions'][$journalId], $augumentedJournal);
|
$groups[$groupId]['transactions'][$journalId] = $this->mergeTags($groups[$groupId]['transactions'][$journalId], $augumentedJournal);
|
||||||
@@ -865,7 +865,7 @@ class GroupCollector implements GroupCollectorInterface
|
|||||||
public function setCurrency(TransactionCurrency $currency): GroupCollectorInterface
|
public function setCurrency(TransactionCurrency $currency): GroupCollectorInterface
|
||||||
{
|
{
|
||||||
$this->query->where(
|
$this->query->where(
|
||||||
static function (EloquentBuilder $q) use ($currency): void { // @phpstan-ignore-line
|
static function (EloquentBuilder $q) use ($currency): void {
|
||||||
$q->where('source.transaction_currency_id', $currency->id);
|
$q->where('source.transaction_currency_id', $currency->id);
|
||||||
$q->orWhere('source.foreign_currency_id', $currency->id);
|
$q->orWhere('source.foreign_currency_id', $currency->id);
|
||||||
}
|
}
|
||||||
@@ -952,7 +952,7 @@ class GroupCollector implements GroupCollectorInterface
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
$this->query->where(
|
$this->query->where(
|
||||||
static function (EloquentBuilder $q) use ($array): void { // @phpstan-ignore-line
|
static function (EloquentBuilder $q) use ($array): void {
|
||||||
$q->where(
|
$q->where(
|
||||||
static function (EloquentBuilder $q1) use ($array): void {
|
static function (EloquentBuilder $q1) use ($array): void {
|
||||||
foreach ($array as $word) {
|
foreach ($array as $word) {
|
||||||
|
@@ -258,7 +258,7 @@ class DebugController extends Controller
|
|||||||
$return['build'] = trim((string) file_get_contents('/var/www/counter-main.txt'));
|
$return['build'] = trim((string) file_get_contents('/var/www/counter-main.txt'));
|
||||||
app('log')->debug(sprintf('build is now "%s"', $return['build']));
|
app('log')->debug(sprintf('build is now "%s"', $return['build']));
|
||||||
}
|
}
|
||||||
} catch (\Exception $e) { // @phpstan-ignore-line
|
} catch (\Exception $e) {
|
||||||
app('log')->debug('Could not check build counter, but thats ok.');
|
app('log')->debug('Could not check build counter, but thats ok.');
|
||||||
app('log')->warning($e->getMessage());
|
app('log')->warning($e->getMessage());
|
||||||
}
|
}
|
||||||
@@ -267,7 +267,7 @@ class DebugController extends Controller
|
|||||||
if (file_exists('/var/www/build-date-main.txt')) {
|
if (file_exists('/var/www/build-date-main.txt')) {
|
||||||
$return['build_date'] = trim((string) file_get_contents('/var/www/build-date-main.txt'));
|
$return['build_date'] = trim((string) file_get_contents('/var/www/build-date-main.txt'));
|
||||||
}
|
}
|
||||||
} catch (\Exception $e) { // @phpstan-ignore-line
|
} catch (\Exception $e) {
|
||||||
app('log')->debug('Could not check build date, but thats ok.');
|
app('log')->debug('Could not check build date, but thats ok.');
|
||||||
app('log')->warning($e->getMessage());
|
app('log')->warning($e->getMessage());
|
||||||
}
|
}
|
||||||
|
@@ -88,7 +88,7 @@ class MailError extends Job implements ShouldQueue
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
} catch (\Exception|TransportException $e) { // @phpstan-ignore-line
|
} catch (\Exception|TransportException $e) {
|
||||||
$message = $e->getMessage();
|
$message = $e->getMessage();
|
||||||
if (str_contains($message, 'Bcc')) {
|
if (str_contains($message, 'Bcc')) {
|
||||||
app('log')->warning('[Bcc] Could not email or log the error. Please validate your email settings, use the .env.example file as a guide.');
|
app('log')->warning('[Bcc] Could not email or log the error. Please validate your email settings, use the .env.example file as a guide.');
|
||||||
|
@@ -107,7 +107,7 @@ class AccountRepository implements AccountRepositoryInterface
|
|||||||
->leftJoin('account_meta', 'accounts.id', '=', 'account_meta.account_id')
|
->leftJoin('account_meta', 'accounts.id', '=', 'account_meta.account_id')
|
||||||
->where('accounts.active', true)
|
->where('accounts.active', true)
|
||||||
->where(
|
->where(
|
||||||
static function (EloquentBuilder $q1) use ($number): void { // @phpstan-ignore-line
|
static function (EloquentBuilder $q1) use ($number): void {
|
||||||
$json = json_encode($number);
|
$json = json_encode($number);
|
||||||
$q1->where('account_meta.name', '=', 'account_number');
|
$q1->where('account_meta.name', '=', 'account_number');
|
||||||
$q1->where('account_meta.data', '=', $json);
|
$q1->where('account_meta.data', '=', $json);
|
||||||
@@ -188,7 +188,7 @@ class AccountRepository implements AccountRepositoryInterface
|
|||||||
{
|
{
|
||||||
$query = $this->user->accounts()->with(
|
$query = $this->user->accounts()->with(
|
||||||
[ // @phpstan-ignore-line
|
[ // @phpstan-ignore-line
|
||||||
'accountmeta' => static function (HasMany $query): void { // @phpstan-ignore-line
|
'accountmeta' => static function (HasMany $query): void {
|
||||||
$query->where('name', 'account_role');
|
$query->where('name', 'account_role');
|
||||||
},
|
},
|
||||||
'attachments',
|
'attachments',
|
||||||
@@ -260,7 +260,7 @@ class AccountRepository implements AccountRepositoryInterface
|
|||||||
{
|
{
|
||||||
$query = $this->user->accounts()->with(
|
$query = $this->user->accounts()->with(
|
||||||
[ // @phpstan-ignore-line
|
[ // @phpstan-ignore-line
|
||||||
'accountmeta' => static function (HasMany $query): void { // @phpstan-ignore-line
|
'accountmeta' => static function (HasMany $query): void {
|
||||||
$query->where('name', 'account_role');
|
$query->where('name', 'account_role');
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
@@ -617,7 +617,7 @@ class AccountRepository implements AccountRepositoryInterface
|
|||||||
foreach ($parts as $part) {
|
foreach ($parts as $part) {
|
||||||
$search = sprintf('%%%s%%', $part);
|
$search = sprintf('%%%s%%', $part);
|
||||||
$dbQuery->where(
|
$dbQuery->where(
|
||||||
static function (EloquentBuilder $q1) use ($search): void { // @phpstan-ignore-line
|
static function (EloquentBuilder $q1) use ($search): void {
|
||||||
$q1->whereLike('accounts.iban', $search);
|
$q1->whereLike('accounts.iban', $search);
|
||||||
$q1->orWhere(
|
$q1->orWhere(
|
||||||
static function (EloquentBuilder $q2) use ($search): void {
|
static function (EloquentBuilder $q2) use ($search): void {
|
||||||
|
@@ -36,7 +36,7 @@ class ALERepository implements ALERepositoryInterface
|
|||||||
public function getForObject(Model $model): Collection
|
public function getForObject(Model $model): Collection
|
||||||
{
|
{
|
||||||
// all Models have an ID.
|
// all Models have an ID.
|
||||||
return AuditLogEntry::where('auditable_id', $model->id)->where('auditable_type', get_class($model))->get(); // @phpstan-ignore-line
|
return AuditLogEntry::where('auditable_id', $model->id)->where('auditable_type', get_class($model))->get();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function store(array $data): AuditLogEntry
|
public function store(array $data): AuditLogEntry
|
||||||
|
@@ -67,7 +67,7 @@ class AvailableBudgetRepository implements AvailableBudgetRepositoryInterface
|
|||||||
$query = $this->user->availableBudgets()->with(['transactionCurrency']);
|
$query = $this->user->availableBudgets()->with(['transactionCurrency']);
|
||||||
if (null !== $start && null !== $end) {
|
if (null !== $start && null !== $end) {
|
||||||
$query->where(
|
$query->where(
|
||||||
static function (Builder $q1) use ($start, $end): void { // @phpstan-ignore-line
|
static function (Builder $q1) use ($start, $end): void {
|
||||||
$q1->where('start_date', '=', $start->format('Y-m-d'));
|
$q1->where('start_date', '=', $start->format('Y-m-d'));
|
||||||
$q1->where('end_date', '=', $end->format('Y-m-d'));
|
$q1->where('end_date', '=', $end->format('Y-m-d'));
|
||||||
}
|
}
|
||||||
|
@@ -223,7 +223,7 @@ class BudgetLimitRepository implements BudgetLimitRepositoryInterface
|
|||||||
// when both dates are set:
|
// when both dates are set:
|
||||||
return $budget->budgetlimits()
|
return $budget->budgetlimits()
|
||||||
->where(
|
->where(
|
||||||
static function (Builder $q5) use ($start, $end): void { // @phpstan-ignore-line
|
static function (Builder $q5) use ($start, $end): void {
|
||||||
$q5->where(
|
$q5->where(
|
||||||
static function (Builder $q1) use ($start, $end): void {
|
static function (Builder $q1) use ($start, $end): void {
|
||||||
// budget limit ends within period
|
// budget limit ends within period
|
||||||
|
@@ -156,7 +156,7 @@ class TransactionGroupRepository implements TransactionGroupRepositoryInterface
|
|||||||
$current['file_exists'] = true;
|
$current['file_exists'] = true;
|
||||||
$current['notes'] = $repository->getNoteText($attachment);
|
$current['notes'] = $repository->getNoteText($attachment);
|
||||||
// already determined that this attachable is a TransactionJournal.
|
// already determined that this attachable is a TransactionJournal.
|
||||||
$current['journal_title'] = $attachment->attachable->description; // @phpstan-ignore-line
|
$current['journal_title'] = $attachment->attachable->description;
|
||||||
$result[$journalId][] = $current;
|
$result[$journalId][] = $current;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -220,7 +220,7 @@ class TransactionGroupRepository implements TransactionGroupRepositoryInterface
|
|||||||
'link' => $entry->outward,
|
'link' => $entry->outward,
|
||||||
'group' => $entry->destination->transaction_group_id,
|
'group' => $entry->destination->transaction_group_id,
|
||||||
'description' => $entry->destination->description,
|
'description' => $entry->destination->description,
|
||||||
'editable' => 1 === (int) $entry->editable, // @phpstan-ignore-line
|
'editable' => 1 === (int) $entry->editable,
|
||||||
'amount' => $amount,
|
'amount' => $amount,
|
||||||
'foreign_amount' => $foreignAmount,
|
'foreign_amount' => $foreignAmount,
|
||||||
];
|
];
|
||||||
@@ -233,7 +233,7 @@ class TransactionGroupRepository implements TransactionGroupRepositoryInterface
|
|||||||
'link' => $entry->inward,
|
'link' => $entry->inward,
|
||||||
'group' => $entry->source->transaction_group_id,
|
'group' => $entry->source->transaction_group_id,
|
||||||
'description' => $entry->source->description,
|
'description' => $entry->source->description,
|
||||||
'editable' => 1 === (int) $entry->editable, // @phpstan-ignore-line
|
'editable' => 1 === (int) $entry->editable,
|
||||||
'amount' => $amount,
|
'amount' => $amount,
|
||||||
'foreign_amount' => $foreignAmount,
|
'foreign_amount' => $foreignAmount,
|
||||||
];
|
];
|
||||||
|
@@ -63,7 +63,7 @@ class AccountRepository implements AccountRepositoryInterface
|
|||||||
->leftJoin('account_meta', 'accounts.id', '=', 'account_meta.account_id')
|
->leftJoin('account_meta', 'accounts.id', '=', 'account_meta.account_id')
|
||||||
->where('accounts.active', true)
|
->where('accounts.active', true)
|
||||||
->where(
|
->where(
|
||||||
static function (EloquentBuilder $q1) use ($number): void { // @phpstan-ignore-line
|
static function (EloquentBuilder $q1) use ($number): void {
|
||||||
$json = json_encode($number);
|
$json = json_encode($number);
|
||||||
$q1->where('account_meta.name', '=', 'account_number');
|
$q1->where('account_meta.name', '=', 'account_number');
|
||||||
$q1->where('account_meta.data', '=', $json);
|
$q1->where('account_meta.data', '=', $json);
|
||||||
|
@@ -55,7 +55,7 @@ class IsDateOrTime implements ValidationRule
|
|||||||
$fail('validation.date_or_time')->translate();
|
$fail('validation.date_or_time')->translate();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
} catch (InvalidFormatException $e) { // @phpstan-ignore-line
|
} catch (InvalidFormatException $e) {
|
||||||
app('log')->error(sprintf('"%s" is of an invalid format: %s', $value, $e->getMessage()));
|
app('log')->error(sprintf('"%s" is of an invalid format: %s', $value, $e->getMessage()));
|
||||||
|
|
||||||
$fail('validation.date_or_time')->translate();
|
$fail('validation.date_or_time')->translate();
|
||||||
|
@@ -102,7 +102,7 @@ class ValidRecurrenceRepetitionValue implements ValidationRule
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
Carbon::createFromFormat('Y-m-d', $dateString);
|
Carbon::createFromFormat('Y-m-d', $dateString);
|
||||||
} catch (\InvalidArgumentException $e) { // @phpstan-ignore-line
|
} catch (\InvalidArgumentException $e) {
|
||||||
app('log')->debug(sprintf('Could not parse date %s: %s', $dateString, $e->getMessage()));
|
app('log')->debug(sprintf('Could not parse date %s: %s', $dateString, $e->getMessage()));
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@@ -208,7 +208,7 @@ class ExpandedForm
|
|||||||
/** @var \Eloquent $entry */
|
/** @var \Eloquent $entry */
|
||||||
foreach ($set as $entry) {
|
foreach ($set as $entry) {
|
||||||
// All Eloquent models have an ID
|
// All Eloquent models have an ID
|
||||||
$entryId = $entry->id; // @phpstan-ignore-line
|
$entryId = $entry->id;
|
||||||
$current = $entry->toArray();
|
$current = $entry->toArray();
|
||||||
$title = null;
|
$title = null;
|
||||||
foreach ($fields as $field) {
|
foreach ($fields as $field) {
|
||||||
|
@@ -93,7 +93,7 @@ class Navigation
|
|||||||
return $this->calculator->nextDateByInterval($epoch, $periodicity, $skipInterval);
|
return $this->calculator->nextDateByInterval($epoch, $periodicity, $skipInterval);
|
||||||
} catch (IntervalException $exception) {
|
} catch (IntervalException $exception) {
|
||||||
Log::warning($exception->getMessage(), ['exception' => $exception]);
|
Log::warning($exception->getMessage(), ['exception' => $exception]);
|
||||||
} catch (\Throwable $exception) { // @phpstan-ignore-line
|
} catch (\Throwable $exception) {
|
||||||
Log::error($exception->getMessage(), ['exception' => $exception]);
|
Log::error($exception->getMessage(), ['exception' => $exception]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -123,7 +123,7 @@ class ParseDateString
|
|||||||
{
|
{
|
||||||
$today = today(config('app.timezone'))->startOfDay();
|
$today = today(config('app.timezone'))->startOfDay();
|
||||||
|
|
||||||
return match ($keyword) { // @phpstan-ignore-line
|
return match ($keyword) {
|
||||||
default => $today,
|
default => $today,
|
||||||
'yesterday' => $today->subDay(),
|
'yesterday' => $today->subDay(),
|
||||||
'tomorrow' => $today->addDay(),
|
'tomorrow' => $today->addDay(),
|
||||||
@@ -144,7 +144,7 @@ class ParseDateString
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
$result = Carbon::createFromFormat('Y-m-d', $date);
|
$result = Carbon::createFromFormat('Y-m-d', $date);
|
||||||
} catch (InvalidFormatException $e) { // @phpstan-ignore-line
|
} catch (InvalidFormatException $e) {
|
||||||
Log::error(sprintf('parseDefaultDate("%s") ran into an error, but dont mind: %s', $date, $e->getMessage()));
|
Log::error(sprintf('parseDefaultDate("%s") ran into an error, but dont mind: %s', $date, $e->getMessage()));
|
||||||
}
|
}
|
||||||
if (false === $result) {
|
if (false === $result) {
|
||||||
|
@@ -72,7 +72,7 @@ class AccountSearch implements GenericSearchInterface
|
|||||||
default:
|
default:
|
||||||
case self::SEARCH_ALL:
|
case self::SEARCH_ALL:
|
||||||
$searchQuery->where(
|
$searchQuery->where(
|
||||||
static function (Builder $q) use ($like): void { // @phpstan-ignore-line
|
static function (Builder $q) use ($like): void {
|
||||||
$q->whereLike('accounts.id', $like);
|
$q->whereLike('accounts.id', $like);
|
||||||
$q->orWhereLike('accounts.name', $like);
|
$q->orWhereLike('accounts.name', $like);
|
||||||
$q->orWhereLike('accounts.iban', $like);
|
$q->orWhereLike('accounts.iban', $like);
|
||||||
@@ -80,7 +80,7 @@ class AccountSearch implements GenericSearchInterface
|
|||||||
);
|
);
|
||||||
// meta data:
|
// meta data:
|
||||||
$searchQuery->orWhere(
|
$searchQuery->orWhere(
|
||||||
static function (Builder $q) use ($originalQuery): void { // @phpstan-ignore-line
|
static function (Builder $q) use ($originalQuery): void {
|
||||||
$json = json_encode($originalQuery, JSON_THROW_ON_ERROR);
|
$json = json_encode($originalQuery, JSON_THROW_ON_ERROR);
|
||||||
$q->where('account_meta.name', '=', 'account_number');
|
$q->where('account_meta.name', '=', 'account_number');
|
||||||
$q->whereLike('account_meta.data', $json);
|
$q->whereLike('account_meta.data', $json);
|
||||||
@@ -107,7 +107,7 @@ class AccountSearch implements GenericSearchInterface
|
|||||||
case self::SEARCH_NUMBER:
|
case self::SEARCH_NUMBER:
|
||||||
// meta data:
|
// meta data:
|
||||||
$searchQuery->Where(
|
$searchQuery->Where(
|
||||||
static function (Builder $q) use ($originalQuery): void { // @phpstan-ignore-line
|
static function (Builder $q) use ($originalQuery): void {
|
||||||
$json = json_encode($originalQuery, JSON_THROW_ON_ERROR);
|
$json = json_encode($originalQuery, JSON_THROW_ON_ERROR);
|
||||||
$q->where('account_meta.name', 'account_number');
|
$q->where('account_meta.name', 'account_number');
|
||||||
$q->where('account_meta.data', $json);
|
$q->where('account_meta.data', $json);
|
||||||
|
Reference in New Issue
Block a user