mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-18 18:44:16 +00:00
Import statements and update configuration.
This commit is contained in:
@@ -53,6 +53,9 @@ return $config->setRules(
|
|||||||
'statement_indentation' => true,
|
'statement_indentation' => true,
|
||||||
'void_return' => true,
|
'void_return' => true,
|
||||||
|
|
||||||
|
// about importing statements
|
||||||
|
'global_namespace_import' => ['import_classes' => true, 'import_constants' => true, 'import_functions' => true],
|
||||||
|
|
||||||
// disabled rules
|
// disabled rules
|
||||||
'native_function_invocation' => false, // annoying
|
'native_function_invocation' => false, // annoying
|
||||||
'php_unit_data_provider_name' => false, // bloody annoying long test names
|
'php_unit_data_provider_name' => false, // bloody annoying long test names
|
||||||
|
@@ -29,7 +29,7 @@ rm -f .php-cs-fixer.cache
|
|||||||
PHP_CS_FIXER_IGNORE_ENV=true ./vendor/bin/php-cs-fixer fix \
|
PHP_CS_FIXER_IGNORE_ENV=true ./vendor/bin/php-cs-fixer fix \
|
||||||
--config $SCRIPT_DIR/php-cs-fixer/.php-cs-fixer.php \
|
--config $SCRIPT_DIR/php-cs-fixer/.php-cs-fixer.php \
|
||||||
--format=txt -v \
|
--format=txt -v \
|
||||||
--allow-risky=yes
|
--allow-risky=yes -v
|
||||||
|
|
||||||
EXIT_CODE=$?
|
EXIT_CODE=$?
|
||||||
|
|
||||||
|
1
.github/workflows/sonarcloud.yml
vendored
1
.github/workflows/sonarcloud.yml
vendored
@@ -5,7 +5,6 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- develop
|
|
||||||
env:
|
env:
|
||||||
DB_CONNECTION: sqlite
|
DB_CONNECTION: sqlite
|
||||||
APP_KEY: TestTestTestTestTestTestTestTest
|
APP_KEY: TestTestTestTestTestTestTestTest
|
||||||
|
@@ -42,6 +42,7 @@ use FireflyIII\Support\Facades\Amount;
|
|||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
|
use ValueError;
|
||||||
|
|
||||||
class CorrectsAmounts extends Command
|
class CorrectsAmounts extends Command
|
||||||
{
|
{
|
||||||
@@ -234,7 +235,7 @@ class CorrectsAmounts extends Command
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$check = bccomp((string) $item->trigger_value, '0');
|
$check = bccomp((string) $item->trigger_value, '0');
|
||||||
} catch (\ValueError) {
|
} catch (ValueError) {
|
||||||
$this->friendlyError(sprintf('Rule #%d contained invalid %s-trigger "%s". The trigger has been removed, and the rule is disabled.', $item->rule_id, $item->trigger_type, $item->trigger_value));
|
$this->friendlyError(sprintf('Rule #%d contained invalid %s-trigger "%s". The trigger has been removed, and the rule is disabled.', $item->rule_id, $item->trigger_type, $item->trigger_value));
|
||||||
$item->rule->active = false;
|
$item->rule->active = false;
|
||||||
$item->rule->save();
|
$item->rule->save();
|
||||||
|
@@ -34,6 +34,8 @@ use FireflyIII\Support\Models\AccountBalanceCalculator;
|
|||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
|
use ValueError;
|
||||||
|
use stdClass;
|
||||||
|
|
||||||
class CorrectsUnevenAmount extends Command
|
class CorrectsUnevenAmount extends Command
|
||||||
{
|
{
|
||||||
@@ -135,7 +137,7 @@ class CorrectsUnevenAmount extends Command
|
|||||||
->get(['transaction_journal_id', DB::raw('SUM(amount) AS the_sum')])
|
->get(['transaction_journal_id', DB::raw('SUM(amount) AS the_sum')])
|
||||||
;
|
;
|
||||||
|
|
||||||
/** @var \stdClass $entry */
|
/** @var stdClass $entry */
|
||||||
foreach ($journals as $entry) {
|
foreach ($journals as $entry) {
|
||||||
$sum = (string) $entry->the_sum;
|
$sum = (string) $entry->the_sum;
|
||||||
if (!is_numeric($sum)
|
if (!is_numeric($sum)
|
||||||
@@ -157,7 +159,7 @@ class CorrectsUnevenAmount extends Command
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
$res = bccomp($sum, '0');
|
$res = bccomp($sum, '0');
|
||||||
} catch (\ValueError $e) {
|
} catch (ValueError $e) {
|
||||||
$this->friendlyError(sprintf('Could not bccomp("%s", "0").', $sum));
|
$this->friendlyError(sprintf('Could not bccomp("%s", "0").', $sum));
|
||||||
Log::error($e->getMessage());
|
Log::error($e->getMessage());
|
||||||
Log::error($e->getTraceAsString());
|
Log::error($e->getTraceAsString());
|
||||||
|
@@ -28,6 +28,7 @@ use FireflyIII\Console\Commands\ShowsFriendlyMessages;
|
|||||||
use FireflyIII\Repositories\User\UserRepositoryInterface;
|
use FireflyIII\Repositories\User\UserRepositoryInterface;
|
||||||
use FireflyIII\User;
|
use FireflyIII\User;
|
||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
|
use Exception;
|
||||||
|
|
||||||
class CreatesAccessTokens extends Command
|
class CreatesAccessTokens extends Command
|
||||||
{
|
{
|
||||||
@@ -40,7 +41,7 @@ class CreatesAccessTokens extends Command
|
|||||||
/**
|
/**
|
||||||
* Execute the console command.
|
* Execute the console command.
|
||||||
*
|
*
|
||||||
* @throws \Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function handle(): int
|
public function handle(): int
|
||||||
{
|
{
|
||||||
|
@@ -27,6 +27,7 @@ namespace FireflyIII\Console\Commands\Correction;
|
|||||||
use FireflyIII\Console\Commands\ShowsFriendlyMessages;
|
use FireflyIII\Console\Commands\ShowsFriendlyMessages;
|
||||||
use FireflyIII\Models\TransactionGroup;
|
use FireflyIII\Models\TransactionGroup;
|
||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
|
use Exception;
|
||||||
|
|
||||||
class RemovesEmptyGroups extends Command
|
class RemovesEmptyGroups extends Command
|
||||||
{
|
{
|
||||||
@@ -38,7 +39,7 @@ class RemovesEmptyGroups extends Command
|
|||||||
/**
|
/**
|
||||||
* Execute the console command.
|
* Execute the console command.
|
||||||
*
|
*
|
||||||
* @throws \Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function handle(): int
|
public function handle(): int
|
||||||
{
|
{
|
||||||
|
@@ -28,6 +28,8 @@ use FireflyIII\Console\Commands\ShowsFriendlyMessages;
|
|||||||
use FireflyIII\Models\Transaction;
|
use FireflyIII\Models\Transaction;
|
||||||
use FireflyIII\Models\TransactionJournal;
|
use FireflyIII\Models\TransactionJournal;
|
||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
|
use Exception;
|
||||||
|
use stdClass;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deletes transactions where the journal has been deleted.
|
* Deletes transactions where the journal has been deleted.
|
||||||
@@ -43,7 +45,7 @@ class RemovesOrphanedTransactions extends Command
|
|||||||
/**
|
/**
|
||||||
* Execute the console command.
|
* Execute the console command.
|
||||||
*
|
*
|
||||||
* @throws \Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function handle(): int
|
public function handle(): int
|
||||||
{
|
{
|
||||||
@@ -85,7 +87,7 @@ class RemovesOrphanedTransactions extends Command
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @throws \Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
private function deleteOrphanedTransactions(): void
|
private function deleteOrphanedTransactions(): void
|
||||||
{
|
{
|
||||||
@@ -102,7 +104,7 @@ class RemovesOrphanedTransactions extends Command
|
|||||||
)
|
)
|
||||||
;
|
;
|
||||||
|
|
||||||
/** @var \stdClass $entry */
|
/** @var stdClass $entry */
|
||||||
foreach ($set as $entry) {
|
foreach ($set as $entry) {
|
||||||
$transaction = Transaction::find((int) $entry->transaction_id);
|
$transaction = Transaction::find((int) $entry->transaction_id);
|
||||||
if (null !== $transaction) {
|
if (null !== $transaction) {
|
||||||
|
@@ -35,6 +35,8 @@ use FireflyIII\Repositories\Journal\JournalRepositoryInterface;
|
|||||||
use FireflyIII\Support\Export\ExportDataGenerator;
|
use FireflyIII\Support\Export\ExportDataGenerator;
|
||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
|
use Exception;
|
||||||
|
use InvalidArgumentException;
|
||||||
|
|
||||||
class ExportsData extends Command
|
class ExportsData extends Command
|
||||||
{
|
{
|
||||||
@@ -139,7 +141,7 @@ class ExportsData extends Command
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @throws FireflyException
|
* @throws FireflyException
|
||||||
* @throws \Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
private function parseOptions(): array
|
private function parseOptions(): array
|
||||||
{
|
{
|
||||||
@@ -169,7 +171,7 @@ class ExportsData extends Command
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @throws \Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
private function getDateParameter(string $field): Carbon
|
private function getDateParameter(string $field): Carbon
|
||||||
{
|
{
|
||||||
@@ -183,7 +185,7 @@ class ExportsData extends Command
|
|||||||
if (is_string($this->option($field))) {
|
if (is_string($this->option($field))) {
|
||||||
try {
|
try {
|
||||||
$date = Carbon::createFromFormat('!Y-m-d', $this->option($field));
|
$date = Carbon::createFromFormat('!Y-m-d', $this->option($field));
|
||||||
} catch (\InvalidArgumentException $e) {
|
} catch (InvalidArgumentException $e) {
|
||||||
app('log')->error($e->getMessage());
|
app('log')->error($e->getMessage());
|
||||||
$this->friendlyError(sprintf('%s date "%s" must be formatted YYYY-MM-DD. Field will be ignored.', $field, $this->option('start')));
|
$this->friendlyError(sprintf('%s date "%s" must be formatted YYYY-MM-DD. Field will be ignored.', $field, $this->option('start')));
|
||||||
$error = true;
|
$error = true;
|
||||||
|
@@ -30,6 +30,7 @@ use FireflyIII\Models\Budget;
|
|||||||
use FireflyIII\Models\Category;
|
use FireflyIII\Models\Category;
|
||||||
use FireflyIII\Models\Tag;
|
use FireflyIII\Models\Tag;
|
||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
|
use stdClass;
|
||||||
|
|
||||||
class ReportsEmptyObjects extends Command
|
class ReportsEmptyObjects extends Command
|
||||||
{
|
{
|
||||||
@@ -66,7 +67,7 @@ class ReportsEmptyObjects extends Command
|
|||||||
->get(['budgets.id', 'budgets.name', 'budgets.user_id', 'users.email'])
|
->get(['budgets.id', 'budgets.name', 'budgets.user_id', 'users.email'])
|
||||||
;
|
;
|
||||||
|
|
||||||
/** @var \stdClass $entry */
|
/** @var stdClass $entry */
|
||||||
foreach ($set as $entry) {
|
foreach ($set as $entry) {
|
||||||
$line = sprintf(
|
$line = sprintf(
|
||||||
'User #%d (%s) has budget #%d ("%s") which has no transaction journals.',
|
'User #%d (%s) has budget #%d ("%s") which has no transaction journals.',
|
||||||
@@ -92,7 +93,7 @@ class ReportsEmptyObjects extends Command
|
|||||||
->get(['categories.id', 'categories.name', 'categories.user_id', 'users.email'])
|
->get(['categories.id', 'categories.name', 'categories.user_id', 'users.email'])
|
||||||
;
|
;
|
||||||
|
|
||||||
/** @var \stdClass $entry */
|
/** @var stdClass $entry */
|
||||||
foreach ($set as $entry) {
|
foreach ($set as $entry) {
|
||||||
$line = sprintf(
|
$line = sprintf(
|
||||||
'User #%d (%s) has category #%d ("%s") which has no transaction journals.',
|
'User #%d (%s) has category #%d ("%s") which has no transaction journals.',
|
||||||
@@ -115,7 +116,7 @@ class ReportsEmptyObjects extends Command
|
|||||||
->get(['tags.id', 'tags.tag', 'tags.user_id', 'users.email'])
|
->get(['tags.id', 'tags.tag', 'tags.user_id', 'users.email'])
|
||||||
;
|
;
|
||||||
|
|
||||||
/** @var \stdClass $entry */
|
/** @var stdClass $entry */
|
||||||
foreach ($set as $entry) {
|
foreach ($set as $entry) {
|
||||||
$line = sprintf(
|
$line = sprintf(
|
||||||
'User #%d (%s) has tag #%d ("%s") which has no transaction journals.',
|
'User #%d (%s) has tag #%d ("%s") which has no transaction journals.',
|
||||||
@@ -142,7 +143,7 @@ class ReportsEmptyObjects extends Command
|
|||||||
)
|
)
|
||||||
;
|
;
|
||||||
|
|
||||||
/** @var \stdClass $entry */
|
/** @var stdClass $entry */
|
||||||
foreach ($set as $entry) {
|
foreach ($set as $entry) {
|
||||||
$line = 'User #%d (%s) has account #%d ("%s") which has no transactions.';
|
$line = 'User #%d (%s) has account #%d ("%s") which has no transactions.';
|
||||||
$line = sprintf($line, $entry->user_id, $entry->email, $entry->id, $entry->name);
|
$line = sprintf($line, $entry->user_id, $entry->email, $entry->id, $entry->name);
|
||||||
|
@@ -27,6 +27,7 @@ namespace FireflyIII\Console\Commands\System;
|
|||||||
use FireflyIII\Console\Commands\ShowsFriendlyMessages;
|
use FireflyIII\Console\Commands\ShowsFriendlyMessages;
|
||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
use PDO;
|
use PDO;
|
||||||
|
use PDOException;
|
||||||
|
|
||||||
class CreatesDatabase extends Command
|
class CreatesDatabase extends Command
|
||||||
{
|
{
|
||||||
@@ -53,15 +54,15 @@ class CreatesDatabase extends Command
|
|||||||
$this->friendlyLine(sprintf('DSN is %s', $dsn));
|
$this->friendlyLine(sprintf('DSN is %s', $dsn));
|
||||||
|
|
||||||
$options = [
|
$options = [
|
||||||
\PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION,
|
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||||
\PDO::ATTR_DEFAULT_FETCH_MODE => \PDO::FETCH_ASSOC,
|
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
||||||
\PDO::ATTR_EMULATE_PREPARES => false,
|
PDO::ATTR_EMULATE_PREPARES => false,
|
||||||
];
|
];
|
||||||
|
|
||||||
// when it fails, display error
|
// when it fails, display error
|
||||||
try {
|
try {
|
||||||
$pdo = new \PDO($dsn, (string) env('DB_USERNAME'), (string) env('DB_PASSWORD'), $options);
|
$pdo = new PDO($dsn, (string) env('DB_USERNAME'), (string) env('DB_PASSWORD'), $options);
|
||||||
} catch (\PDOException $e) {
|
} catch (PDOException $e) {
|
||||||
$this->friendlyError(sprintf('Error when connecting to DB: %s', $e->getMessage()));
|
$this->friendlyError(sprintf('Error when connecting to DB: %s', $e->getMessage()));
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
@@ -34,6 +34,7 @@ use FireflyIII\Support\Cronjobs\RecurringCronjob;
|
|||||||
use FireflyIII\Support\Cronjobs\UpdateCheckCronjob;
|
use FireflyIII\Support\Cronjobs\UpdateCheckCronjob;
|
||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
|
use InvalidArgumentException;
|
||||||
|
|
||||||
class Cron extends Command
|
class Cron extends Command
|
||||||
{
|
{
|
||||||
@@ -62,7 +63,7 @@ class Cron extends Command
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
$date = new Carbon($this->option('date'));
|
$date = new Carbon($this->option('date'));
|
||||||
} catch (\InvalidArgumentException $e) {
|
} catch (InvalidArgumentException $e) {
|
||||||
$this->friendlyError(sprintf('"%s" is not a valid date', $this->option('date')));
|
$this->friendlyError(sprintf('"%s" is not a valid date', $this->option('date')));
|
||||||
}
|
}
|
||||||
$force = (bool) $this->option('force'); // @phpstan-ignore-line
|
$force = (bool) $this->option('force'); // @phpstan-ignore-line
|
||||||
|
@@ -31,6 +31,8 @@ use Illuminate\Console\Command;
|
|||||||
use Illuminate\Contracts\Encryption\DecryptException;
|
use Illuminate\Contracts\Encryption\DecryptException;
|
||||||
use Illuminate\Support\Facades\Crypt;
|
use Illuminate\Support\Facades\Crypt;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use JsonException;
|
||||||
|
use stdClass;
|
||||||
|
|
||||||
class RemovesDatabaseDecryption extends Command
|
class RemovesDatabaseDecryption extends Command
|
||||||
{
|
{
|
||||||
@@ -105,13 +107,13 @@ class RemovesDatabaseDecryption extends Command
|
|||||||
{
|
{
|
||||||
$rows = DB::table($table)->get(['id', $field]);
|
$rows = DB::table($table)->get(['id', $field]);
|
||||||
|
|
||||||
/** @var \stdClass $row */
|
/** @var stdClass $row */
|
||||||
foreach ($rows as $row) {
|
foreach ($rows as $row) {
|
||||||
$this->decryptRow($table, $field, $row);
|
$this->decryptRow($table, $field, $row);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private function decryptRow(string $table, string $field, \stdClass $row): void
|
private function decryptRow(string $table, string $field, stdClass $row): void
|
||||||
{
|
{
|
||||||
$original = $row->{$field};
|
$original = $row->{$field};
|
||||||
if (null === $original) {
|
if (null === $original) {
|
||||||
@@ -168,7 +170,7 @@ class RemovesDatabaseDecryption extends Command
|
|||||||
// try to json_decrypt the value.
|
// try to json_decrypt the value.
|
||||||
try {
|
try {
|
||||||
$newValue = \Safe\json_decode($value, true, 512, JSON_THROW_ON_ERROR) ?? $value;
|
$newValue = \Safe\json_decode($value, true, 512, JSON_THROW_ON_ERROR) ?? $value;
|
||||||
} catch (\JsonException $e) {
|
} catch (JsonException $e) {
|
||||||
$message = sprintf('Could not JSON decode preference row #%d: %s. This does not have to be a problem.', $id, $e->getMessage());
|
$message = sprintf('Could not JSON decode preference row #%d: %s. This does not have to be a problem.', $id, $e->getMessage());
|
||||||
$this->friendlyError($message);
|
$this->friendlyError($message);
|
||||||
app('log')->warning($message);
|
app('log')->warning($message);
|
||||||
|
@@ -36,6 +36,7 @@ use FireflyIII\Services\Internal\Destroy\JournalDestroyService;
|
|||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use Exception;
|
||||||
|
|
||||||
class UpgradesToGroups extends Command
|
class UpgradesToGroups extends Command
|
||||||
{
|
{
|
||||||
@@ -103,7 +104,7 @@ class UpgradesToGroups extends Command
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @throws \Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
private function makeGroupsFromSplitJournals(): void
|
private function makeGroupsFromSplitJournals(): void
|
||||||
{
|
{
|
||||||
@@ -119,7 +120,7 @@ class UpgradesToGroups extends Command
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @throws \Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
private function makeMultiGroup(TransactionJournal $journal): void
|
private function makeMultiGroup(TransactionJournal $journal): void
|
||||||
{
|
{
|
||||||
|
@@ -26,6 +26,7 @@ namespace FireflyIII\Console;
|
|||||||
|
|
||||||
use Illuminate\Console\Scheduling\Schedule;
|
use Illuminate\Console\Scheduling\Schedule;
|
||||||
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
||||||
|
use Override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* File to make sure commands work.
|
* File to make sure commands work.
|
||||||
@@ -35,7 +36,7 @@ class Kernel extends ConsoleKernel
|
|||||||
/**
|
/**
|
||||||
* Register the commands for the application.
|
* Register the commands for the application.
|
||||||
*/
|
*/
|
||||||
#[\Override]
|
#[Override]
|
||||||
protected function commands(): void
|
protected function commands(): void
|
||||||
{
|
{
|
||||||
$this->load(__DIR__.'/Commands');
|
$this->load(__DIR__.'/Commands');
|
||||||
@@ -46,7 +47,7 @@ class Kernel extends ConsoleKernel
|
|||||||
/**
|
/**
|
||||||
* Define the application's command schedule.
|
* Define the application's command schedule.
|
||||||
*/
|
*/
|
||||||
#[\Override]
|
#[Override]
|
||||||
protected function schedule(Schedule $schedule): void
|
protected function schedule(Schedule $schedule): void
|
||||||
{
|
{
|
||||||
$schedule->call(
|
$schedule->call(
|
||||||
|
@@ -24,7 +24,9 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace FireflyIII\Exceptions;
|
namespace FireflyIII\Exceptions;
|
||||||
|
|
||||||
class BadHttpHeaderException extends \Exception
|
use Exception;
|
||||||
|
|
||||||
|
class BadHttpHeaderException extends Exception
|
||||||
{
|
{
|
||||||
public int $statusCode = 406;
|
public int $statusCode = 406;
|
||||||
}
|
}
|
||||||
|
@@ -24,7 +24,9 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace FireflyIII\Exceptions;
|
namespace FireflyIII\Exceptions;
|
||||||
|
|
||||||
|
use Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class DuplicateTransactionException
|
* Class DuplicateTransactionException
|
||||||
*/
|
*/
|
||||||
class DuplicateTransactionException extends \Exception {}
|
class DuplicateTransactionException extends Exception {}
|
||||||
|
@@ -24,7 +24,9 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace FireflyIII\Exceptions;
|
namespace FireflyIII\Exceptions;
|
||||||
|
|
||||||
|
use Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class FireflyException.
|
* Class FireflyException.
|
||||||
*/
|
*/
|
||||||
class FireflyException extends \Exception {}
|
class FireflyException extends Exception {}
|
||||||
|
@@ -34,6 +34,8 @@ use FireflyIII\User;
|
|||||||
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
|
use Override;
|
||||||
|
use Throwable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class GracefulNotFoundHandler
|
* Class GracefulNotFoundHandler
|
||||||
@@ -45,12 +47,12 @@ class GracefulNotFoundHandler extends ExceptionHandler
|
|||||||
*
|
*
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
*
|
*
|
||||||
* @throws \Throwable
|
* @throws Throwable
|
||||||
*
|
*
|
||||||
* @SuppressWarnings("PHPMD.CyclomaticComplexity")
|
* @SuppressWarnings("PHPMD.CyclomaticComplexity")
|
||||||
*/
|
*/
|
||||||
#[\Override]
|
#[Override]
|
||||||
public function render($request, \Throwable $e): Response
|
public function render($request, Throwable $e): Response
|
||||||
{
|
{
|
||||||
$route = $request->route();
|
$route = $request->route();
|
||||||
if (null === $route) {
|
if (null === $route) {
|
||||||
@@ -149,9 +151,9 @@ class GracefulNotFoundHandler extends ExceptionHandler
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @throws \Throwable
|
* @throws Throwable
|
||||||
*/
|
*/
|
||||||
private function handleAccount(Request $request, \Throwable $exception): Response
|
private function handleAccount(Request $request, Throwable $exception): Response
|
||||||
{
|
{
|
||||||
app('log')->debug('404 page is probably a deleted account. Redirect to overview of account types.');
|
app('log')->debug('404 page is probably a deleted account. Redirect to overview of account types.');
|
||||||
|
|
||||||
@@ -184,9 +186,9 @@ class GracefulNotFoundHandler extends ExceptionHandler
|
|||||||
/**
|
/**
|
||||||
* @return Response
|
* @return Response
|
||||||
*
|
*
|
||||||
* @throws \Throwable
|
* @throws Throwable
|
||||||
*/
|
*/
|
||||||
private function handleGroup(Request $request, \Throwable $exception)
|
private function handleGroup(Request $request, Throwable $exception)
|
||||||
{
|
{
|
||||||
app('log')->debug('404 page is probably a deleted group. Redirect to overview of group types.');
|
app('log')->debug('404 page is probably a deleted group. Redirect to overview of group types.');
|
||||||
|
|
||||||
@@ -224,9 +226,9 @@ class GracefulNotFoundHandler extends ExceptionHandler
|
|||||||
/**
|
/**
|
||||||
* @return Response
|
* @return Response
|
||||||
*
|
*
|
||||||
* @throws \Throwable
|
* @throws Throwable
|
||||||
*/
|
*/
|
||||||
private function handleAttachment(Request $request, \Throwable $exception)
|
private function handleAttachment(Request $request, Throwable $exception)
|
||||||
{
|
{
|
||||||
app('log')->debug('404 page is probably a deleted attachment. Redirect to parent object.');
|
app('log')->debug('404 page is probably a deleted attachment. Redirect to parent object.');
|
||||||
|
|
||||||
|
@@ -44,6 +44,9 @@ use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
|
|||||||
use Symfony\Component\HttpKernel\Exception\HttpException;
|
use Symfony\Component\HttpKernel\Exception\HttpException;
|
||||||
use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException;
|
use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException;
|
||||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||||
|
use ErrorException;
|
||||||
|
use Override;
|
||||||
|
use Throwable;
|
||||||
|
|
||||||
// temp
|
// temp
|
||||||
/**
|
/**
|
||||||
@@ -52,7 +55,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
|||||||
class Handler extends ExceptionHandler
|
class Handler extends ExceptionHandler
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var array<int, class-string<\Throwable>>
|
* @var array<int, class-string<Throwable>>
|
||||||
*/
|
*/
|
||||||
protected $dontReport
|
protected $dontReport
|
||||||
= [
|
= [
|
||||||
@@ -70,7 +73,7 @@ class Handler extends ExceptionHandler
|
|||||||
/**
|
/**
|
||||||
* Register the exception handling callbacks for the application.
|
* Register the exception handling callbacks for the application.
|
||||||
*/
|
*/
|
||||||
#[\Override]
|
#[Override]
|
||||||
public function register(): void {}
|
public function register(): void {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -79,13 +82,13 @@ class Handler extends ExceptionHandler
|
|||||||
*
|
*
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
*
|
*
|
||||||
* @throws \Throwable
|
* @throws Throwable
|
||||||
*
|
*
|
||||||
* @SuppressWarnings("PHPMD.NPathComplexity")
|
* @SuppressWarnings("PHPMD.NPathComplexity")
|
||||||
* @SuppressWarnings("PHPMD.CyclomaticComplexity")
|
* @SuppressWarnings("PHPMD.CyclomaticComplexity")
|
||||||
*/
|
*/
|
||||||
#[\Override]
|
#[Override]
|
||||||
public function render($request, \Throwable $e): Response
|
public function render($request, Throwable $e): Response
|
||||||
{
|
{
|
||||||
$expectsJson = $request->expectsJson();
|
$expectsJson = $request->expectsJson();
|
||||||
|
|
||||||
@@ -188,7 +191,7 @@ class Handler extends ExceptionHandler
|
|||||||
return response()->view('errors.DatabaseException', ['exception' => $e, 'debug' => $isDebug], 500);
|
return response()->view('errors.DatabaseException', ['exception' => $e, 'debug' => $isDebug], 500);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($e instanceof FireflyException || $e instanceof \ErrorException || $e instanceof OAuthServerException) {
|
if ($e instanceof FireflyException || $e instanceof ErrorException || $e instanceof OAuthServerException) {
|
||||||
app('log')->debug('Return Firefly III error view.');
|
app('log')->debug('Return Firefly III error view.');
|
||||||
$isDebug = config('app.debug');
|
$isDebug = config('app.debug');
|
||||||
|
|
||||||
@@ -203,10 +206,10 @@ class Handler extends ExceptionHandler
|
|||||||
/**
|
/**
|
||||||
* Report or log an exception.
|
* Report or log an exception.
|
||||||
*
|
*
|
||||||
* @throws \Throwable
|
* @throws Throwable
|
||||||
*/
|
*/
|
||||||
#[\Override]
|
#[Override]
|
||||||
public function report(\Throwable $e): void
|
public function report(Throwable $e): void
|
||||||
{
|
{
|
||||||
$doMailError = (bool) config('firefly.send_error_message');
|
$doMailError = (bool) config('firefly.send_error_message');
|
||||||
if ($this->shouldntReportLocal($e) || !$doMailError) {
|
if ($this->shouldntReportLocal($e) || !$doMailError) {
|
||||||
@@ -250,7 +253,7 @@ class Handler extends ExceptionHandler
|
|||||||
parent::report($e);
|
parent::report($e);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function shouldntReportLocal(\Throwable $e): bool
|
private function shouldntReportLocal(Throwable $e): bool
|
||||||
{
|
{
|
||||||
return null !== Arr::first(
|
return null !== Arr::first(
|
||||||
$this->dontReport,
|
$this->dontReport,
|
||||||
@@ -263,7 +266,7 @@ class Handler extends ExceptionHandler
|
|||||||
*
|
*
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
*/
|
*/
|
||||||
#[\Override]
|
#[Override]
|
||||||
protected function invalid($request, LaravelValidationException $exception): \Illuminate\Http\Response|JsonResponse|RedirectResponse
|
protected function invalid($request, LaravelValidationException $exception): \Illuminate\Http\Response|JsonResponse|RedirectResponse
|
||||||
{
|
{
|
||||||
// protect against open redirect when submitting invalid forms.
|
// protect against open redirect when submitting invalid forms.
|
||||||
|
@@ -25,11 +25,13 @@ declare(strict_types=1);
|
|||||||
namespace FireflyIII\Exceptions;
|
namespace FireflyIII\Exceptions;
|
||||||
|
|
||||||
use FireflyIII\Support\Calendar\Periodicity;
|
use FireflyIII\Support\Calendar\Periodicity;
|
||||||
|
use Exception;
|
||||||
|
use Throwable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class IntervalException
|
* Class IntervalException
|
||||||
*/
|
*/
|
||||||
final class IntervalException extends \Exception
|
final class IntervalException extends Exception
|
||||||
{
|
{
|
||||||
public array $availableIntervals;
|
public array $availableIntervals;
|
||||||
public Periodicity $periodicity;
|
public Periodicity $periodicity;
|
||||||
@@ -37,7 +39,7 @@ final class IntervalException extends \Exception
|
|||||||
/** @var mixed */
|
/** @var mixed */
|
||||||
protected $message = 'The periodicity %s is unknown. Choose one of available periodicity: %s';
|
protected $message = 'The periodicity %s is unknown. Choose one of available periodicity: %s';
|
||||||
|
|
||||||
public function __construct(string $message = '', int $code = 0, ?\Throwable $previous = null)
|
public function __construct(string $message = '', int $code = 0, ?Throwable $previous = null)
|
||||||
{
|
{
|
||||||
parent::__construct($message, $code, $previous);
|
parent::__construct($message, $code, $previous);
|
||||||
$this->availableIntervals = [];
|
$this->availableIntervals = [];
|
||||||
@@ -48,7 +50,7 @@ final class IntervalException extends \Exception
|
|||||||
Periodicity $periodicity,
|
Periodicity $periodicity,
|
||||||
array $intervals,
|
array $intervals,
|
||||||
int $code = 0,
|
int $code = 0,
|
||||||
?\Throwable $previous = null
|
?Throwable $previous = null
|
||||||
): self {
|
): self {
|
||||||
$message = sprintf(
|
$message = sprintf(
|
||||||
'The periodicity %s is unknown. Choose one of available periodicity: %s',
|
'The periodicity %s is unknown. Choose one of available periodicity: %s',
|
||||||
|
@@ -24,7 +24,9 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace FireflyIII\Exceptions;
|
namespace FireflyIII\Exceptions;
|
||||||
|
|
||||||
|
use Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class NotImplementedException.
|
* Class NotImplementedException.
|
||||||
*/
|
*/
|
||||||
class NotImplementedException extends \Exception {}
|
class NotImplementedException extends Exception {}
|
||||||
|
@@ -24,7 +24,9 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace FireflyIII\Exceptions;
|
namespace FireflyIII\Exceptions;
|
||||||
|
|
||||||
|
use Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class ValidationExceptions.
|
* Class ValidationExceptions.
|
||||||
*/
|
*/
|
||||||
class ValidationException extends \Exception {}
|
class ValidationException extends Exception {}
|
||||||
|
@@ -51,6 +51,8 @@ use FireflyIII\User;
|
|||||||
use FireflyIII\Validation\AccountValidator;
|
use FireflyIII\Validation\AccountValidator;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
|
use Exception;
|
||||||
|
use JsonException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class TransactionJournalFactory
|
* Class TransactionJournalFactory
|
||||||
@@ -76,7 +78,7 @@ class TransactionJournalFactory
|
|||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
* @throws \Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
@@ -324,7 +326,7 @@ class TransactionJournalFactory
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
$json = \Safe\json_encode($dataRow, JSON_THROW_ON_ERROR);
|
$json = \Safe\json_encode($dataRow, JSON_THROW_ON_ERROR);
|
||||||
} catch (\JsonException $e) {
|
} catch (JsonException $e) {
|
||||||
Log::error(sprintf('Could not encode dataRow: %s', $e->getMessage()));
|
Log::error(sprintf('Could not encode dataRow: %s', $e->getMessage()));
|
||||||
$json = microtime();
|
$json = microtime();
|
||||||
}
|
}
|
||||||
|
@@ -27,6 +27,7 @@ use Carbon\Carbon;
|
|||||||
use FireflyIII\Exceptions\FireflyException;
|
use FireflyIII\Exceptions\FireflyException;
|
||||||
use FireflyIII\Generator\Report\ReportGeneratorInterface;
|
use FireflyIII\Generator\Report\ReportGeneratorInterface;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
|
use Throwable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class MonthReportGenerator.
|
* Class MonthReportGenerator.
|
||||||
@@ -56,7 +57,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
|
|||||||
->with('doubles', $this->expense)
|
->with('doubles', $this->expense)
|
||||||
->render()
|
->render()
|
||||||
;
|
;
|
||||||
} catch (\Throwable $e) {
|
} catch (Throwable $e) {
|
||||||
app('log')->error(sprintf('Cannot render reports.double.report: %s', $e->getMessage()));
|
app('log')->error(sprintf('Cannot render reports.double.report: %s', $e->getMessage()));
|
||||||
app('log')->error($e->getTraceAsString());
|
app('log')->error($e->getTraceAsString());
|
||||||
$result = sprintf('Could not render report view: %s', $e->getMessage());
|
$result = sprintf('Could not render report view: %s', $e->getMessage());
|
||||||
|
@@ -23,6 +23,8 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace FireflyIII\Generator\Report\Account;
|
namespace FireflyIII\Generator\Report\Account;
|
||||||
|
|
||||||
|
use Override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class MultiYearReportGenerator.
|
* Class MultiYearReportGenerator.
|
||||||
*/
|
*/
|
||||||
@@ -31,7 +33,7 @@ class MultiYearReportGenerator extends MonthReportGenerator
|
|||||||
/**
|
/**
|
||||||
* Returns the preferred period.
|
* Returns the preferred period.
|
||||||
*/
|
*/
|
||||||
#[\Override]
|
#[Override]
|
||||||
protected function preferredPeriod(): string
|
protected function preferredPeriod(): string
|
||||||
{
|
{
|
||||||
return 'year';
|
return 'year';
|
||||||
|
@@ -23,6 +23,8 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace FireflyIII\Generator\Report\Account;
|
namespace FireflyIII\Generator\Report\Account;
|
||||||
|
|
||||||
|
use Override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class YearReportGenerator.
|
* Class YearReportGenerator.
|
||||||
*/
|
*/
|
||||||
@@ -31,7 +33,7 @@ class YearReportGenerator extends MonthReportGenerator
|
|||||||
/**
|
/**
|
||||||
* Returns the preferred period.
|
* Returns the preferred period.
|
||||||
*/
|
*/
|
||||||
#[\Override]
|
#[Override]
|
||||||
protected function preferredPeriod(): string
|
protected function preferredPeriod(): string
|
||||||
{
|
{
|
||||||
return 'month';
|
return 'month';
|
||||||
|
@@ -34,6 +34,7 @@ use FireflyIII\Repositories\Journal\JournalRepositoryInterface;
|
|||||||
use FireflyIII\Support\Facades\Steam;
|
use FireflyIII\Support\Facades\Steam;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
|
use Throwable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class MonthReportGenerator.
|
* Class MonthReportGenerator.
|
||||||
@@ -103,7 +104,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
|
|||||||
->with('start', $this->start)->with('end', $this->end)->with('accounts', $this->accounts)
|
->with('start', $this->start)->with('end', $this->end)->with('accounts', $this->accounts)
|
||||||
->render()
|
->render()
|
||||||
;
|
;
|
||||||
} catch (\Throwable $e) {
|
} catch (Throwable $e) {
|
||||||
app('log')->error(sprintf('Cannot render reports.audit.report: %s', $e->getMessage()));
|
app('log')->error(sprintf('Cannot render reports.audit.report: %s', $e->getMessage()));
|
||||||
app('log')->error($e->getTraceAsString());
|
app('log')->error($e->getTraceAsString());
|
||||||
$result = sprintf('Could not render report view: %s', $e->getMessage());
|
$result = sprintf('Could not render report view: %s', $e->getMessage());
|
||||||
|
@@ -29,6 +29,7 @@ use FireflyIII\Exceptions\FireflyException;
|
|||||||
use FireflyIII\Generator\Report\ReportGeneratorInterface;
|
use FireflyIII\Generator\Report\ReportGeneratorInterface;
|
||||||
use FireflyIII\Helpers\Collector\GroupCollectorInterface;
|
use FireflyIII\Helpers\Collector\GroupCollectorInterface;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
|
use Throwable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class MonthReportGenerator.
|
* Class MonthReportGenerator.
|
||||||
@@ -70,7 +71,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
|
|||||||
->with('accounts', $this->accounts)
|
->with('accounts', $this->accounts)
|
||||||
->render()
|
->render()
|
||||||
;
|
;
|
||||||
} catch (\Throwable $e) {
|
} catch (Throwable $e) {
|
||||||
app('log')->error(sprintf('Cannot render reports.account.report: %s', $e->getMessage()));
|
app('log')->error(sprintf('Cannot render reports.account.report: %s', $e->getMessage()));
|
||||||
app('log')->error($e->getTraceAsString());
|
app('log')->error($e->getTraceAsString());
|
||||||
$result = sprintf('Could not render report view: %s', $e->getMessage());
|
$result = sprintf('Could not render report view: %s', $e->getMessage());
|
||||||
|
@@ -29,6 +29,7 @@ use FireflyIII\Exceptions\FireflyException;
|
|||||||
use FireflyIII\Generator\Report\ReportGeneratorInterface;
|
use FireflyIII\Generator\Report\ReportGeneratorInterface;
|
||||||
use FireflyIII\Helpers\Collector\GroupCollectorInterface;
|
use FireflyIII\Helpers\Collector\GroupCollectorInterface;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
|
use Throwable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class MonthReportGenerator.
|
* Class MonthReportGenerator.
|
||||||
@@ -71,7 +72,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
|
|||||||
->with('accounts', $this->accounts)
|
->with('accounts', $this->accounts)
|
||||||
->render()
|
->render()
|
||||||
;
|
;
|
||||||
} catch (\Throwable $e) {
|
} catch (Throwable $e) {
|
||||||
app('log')->error(sprintf('Cannot render reports.category.month: %s', $e->getMessage()));
|
app('log')->error(sprintf('Cannot render reports.category.month: %s', $e->getMessage()));
|
||||||
app('log')->error($e->getTraceAsString());
|
app('log')->error($e->getTraceAsString());
|
||||||
$result = sprintf('Could not render report view: %s', $e->getMessage());
|
$result = sprintf('Could not render report view: %s', $e->getMessage());
|
||||||
|
@@ -27,6 +27,7 @@ use Carbon\Carbon;
|
|||||||
use FireflyIII\Exceptions\FireflyException;
|
use FireflyIII\Exceptions\FireflyException;
|
||||||
use FireflyIII\Generator\Report\ReportGeneratorInterface;
|
use FireflyIII\Generator\Report\ReportGeneratorInterface;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
|
use Throwable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class MonthReportGenerator.
|
* Class MonthReportGenerator.
|
||||||
@@ -54,7 +55,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
return view('reports.default.month', compact('accountIds', 'reportType'))->with('start', $this->start)->with('end', $this->end)->render();
|
return view('reports.default.month', compact('accountIds', 'reportType'))->with('start', $this->start)->with('end', $this->end)->render();
|
||||||
} catch (\Throwable $e) {
|
} catch (Throwable $e) {
|
||||||
app('log')->error(sprintf('Cannot render reports.default.month: %s', $e->getMessage()));
|
app('log')->error(sprintf('Cannot render reports.default.month: %s', $e->getMessage()));
|
||||||
app('log')->error($e->getTraceAsString());
|
app('log')->error($e->getTraceAsString());
|
||||||
$result = 'Could not render report view.';
|
$result = 'Could not render report view.';
|
||||||
|
@@ -27,6 +27,7 @@ use Carbon\Carbon;
|
|||||||
use FireflyIII\Exceptions\FireflyException;
|
use FireflyIII\Exceptions\FireflyException;
|
||||||
use FireflyIII\Generator\Report\ReportGeneratorInterface;
|
use FireflyIII\Generator\Report\ReportGeneratorInterface;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
|
use Throwable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class MonthReportGenerator.
|
* Class MonthReportGenerator.
|
||||||
@@ -58,7 +59,7 @@ class MultiYearReportGenerator implements ReportGeneratorInterface
|
|||||||
'reports.default.multi-year',
|
'reports.default.multi-year',
|
||||||
compact('accountIds', 'reportType')
|
compact('accountIds', 'reportType')
|
||||||
)->with('start', $this->start)->with('end', $this->end)->render();
|
)->with('start', $this->start)->with('end', $this->end)->render();
|
||||||
} catch (\Throwable $e) {
|
} catch (Throwable $e) {
|
||||||
app('log')->error(sprintf('Cannot render reports.default.multi-year: %s', $e->getMessage()));
|
app('log')->error(sprintf('Cannot render reports.default.multi-year: %s', $e->getMessage()));
|
||||||
app('log')->error($e->getTraceAsString());
|
app('log')->error($e->getTraceAsString());
|
||||||
$result = sprintf('Could not render report view: %s', $e->getMessage());
|
$result = sprintf('Could not render report view: %s', $e->getMessage());
|
||||||
|
@@ -27,6 +27,7 @@ use Carbon\Carbon;
|
|||||||
use FireflyIII\Exceptions\FireflyException;
|
use FireflyIII\Exceptions\FireflyException;
|
||||||
use FireflyIII\Generator\Report\ReportGeneratorInterface;
|
use FireflyIII\Generator\Report\ReportGeneratorInterface;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
|
use Throwable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class MonthReportGenerator.
|
* Class MonthReportGenerator.
|
||||||
@@ -58,7 +59,7 @@ class YearReportGenerator implements ReportGeneratorInterface
|
|||||||
'reports.default.year',
|
'reports.default.year',
|
||||||
compact('accountIds', 'reportType')
|
compact('accountIds', 'reportType')
|
||||||
)->with('start', $this->start)->with('end', $this->end)->render();
|
)->with('start', $this->start)->with('end', $this->end)->render();
|
||||||
} catch (\Throwable $e) {
|
} catch (Throwable $e) {
|
||||||
app('log')->error(sprintf('Cannot render reports.account.report: %s', $e->getMessage()));
|
app('log')->error(sprintf('Cannot render reports.account.report: %s', $e->getMessage()));
|
||||||
app('log')->error($e->getTraceAsString());
|
app('log')->error($e->getTraceAsString());
|
||||||
$result = 'Could not render report view.';
|
$result = 'Could not render report view.';
|
||||||
|
@@ -28,6 +28,7 @@ use Carbon\Carbon;
|
|||||||
use FireflyIII\Exceptions\FireflyException;
|
use FireflyIII\Exceptions\FireflyException;
|
||||||
use FireflyIII\Generator\Report\ReportGeneratorInterface;
|
use FireflyIII\Generator\Report\ReportGeneratorInterface;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
|
use Throwable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class MonthReportGenerator.
|
* Class MonthReportGenerator.
|
||||||
@@ -65,7 +66,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
|
|||||||
'reports.tag.month',
|
'reports.tag.month',
|
||||||
compact('accountIds', 'reportType', 'tagIds')
|
compact('accountIds', 'reportType', 'tagIds')
|
||||||
)->with('start', $this->start)->with('end', $this->end)->with('tags', $this->tags)->with('accounts', $this->accounts)->render();
|
)->with('start', $this->start)->with('end', $this->end)->with('tags', $this->tags)->with('accounts', $this->accounts)->render();
|
||||||
} catch (\Throwable $e) {
|
} catch (Throwable $e) {
|
||||||
app('log')->error(sprintf('Cannot render reports.tag.month: %s', $e->getMessage()));
|
app('log')->error(sprintf('Cannot render reports.tag.month: %s', $e->getMessage()));
|
||||||
app('log')->error($e->getTraceAsString());
|
app('log')->error($e->getTraceAsString());
|
||||||
$result = sprintf('Could not render report view: %s', $e->getMessage());
|
$result = sprintf('Could not render report view: %s', $e->getMessage());
|
||||||
|
@@ -28,6 +28,7 @@ use FireflyIII\Notifications\User\NewAccessToken;
|
|||||||
use FireflyIII\Repositories\User\UserRepositoryInterface;
|
use FireflyIII\Repositories\User\UserRepositoryInterface;
|
||||||
use Illuminate\Support\Facades\Notification;
|
use Illuminate\Support\Facades\Notification;
|
||||||
use Laravel\Passport\Events\AccessTokenCreated;
|
use Laravel\Passport\Events\AccessTokenCreated;
|
||||||
|
use Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class APIEventHandler
|
* Class APIEventHandler
|
||||||
@@ -48,7 +49,7 @@ class APIEventHandler
|
|||||||
if (null !== $user) {
|
if (null !== $user) {
|
||||||
try {
|
try {
|
||||||
Notification::send($user, new NewAccessToken());
|
Notification::send($user, new NewAccessToken());
|
||||||
} catch (\Exception $e) {
|
} 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.');
|
||||||
|
@@ -37,6 +37,7 @@ use FireflyIII\Notifications\Test\OwnerTestNotificationPushover;
|
|||||||
use FireflyIII\Notifications\Test\OwnerTestNotificationSlack;
|
use FireflyIII\Notifications\Test\OwnerTestNotificationSlack;
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
use Illuminate\Support\Facades\Notification;
|
use Illuminate\Support\Facades\Notification;
|
||||||
|
use Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class AdminEventHandler.
|
* Class AdminEventHandler.
|
||||||
@@ -52,7 +53,7 @@ class AdminEventHandler
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
Notification::send(new OwnerNotifiable(), new UserInvitation($event->invitee));
|
Notification::send(new OwnerNotifiable(), new UserInvitation($event->invitee));
|
||||||
} catch (\Exception $e) {
|
} 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 +75,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) {
|
} 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 +105,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) {
|
} 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 +159,7 @@ class AdminEventHandler
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
Notification::send($event->owner, new $class());
|
Notification::send($event->owner, new $class());
|
||||||
} catch (\Exception $e) {
|
} 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.');
|
||||||
|
@@ -31,6 +31,7 @@ use FireflyIII\Notifications\User\TransactionCreation;
|
|||||||
use FireflyIII\Repositories\User\UserRepositoryInterface;
|
use FireflyIII\Repositories\User\UserRepositoryInterface;
|
||||||
use FireflyIII\Transformers\TransactionGroupTransformer;
|
use FireflyIII\Transformers\TransactionGroupTransformer;
|
||||||
use Illuminate\Support\Facades\Notification;
|
use Illuminate\Support\Facades\Notification;
|
||||||
|
use Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class AutomationHandler
|
* Class AutomationHandler
|
||||||
@@ -78,7 +79,7 @@ class AutomationHandler
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
Notification::send($user, new TransactionCreation($groups));
|
Notification::send($user, new TransactionCreation($groups));
|
||||||
} catch (\Exception $e) {
|
} 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.');
|
||||||
|
@@ -27,6 +27,7 @@ namespace FireflyIII\Handlers\Events;
|
|||||||
use FireflyIII\Events\WarnUserAboutBill;
|
use FireflyIII\Events\WarnUserAboutBill;
|
||||||
use FireflyIII\Notifications\User\BillReminder;
|
use FireflyIII\Notifications\User\BillReminder;
|
||||||
use Illuminate\Support\Facades\Notification;
|
use Illuminate\Support\Facades\Notification;
|
||||||
|
use Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class BillEventHandler
|
* Class BillEventHandler
|
||||||
@@ -47,7 +48,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) {
|
} 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.');
|
||||||
|
@@ -39,6 +39,7 @@ use FireflyIII\Notifications\Security\MFAManyFailedAttemptsNotification;
|
|||||||
use FireflyIII\Notifications\Security\MFAUsedBackupCodeNotification;
|
use FireflyIII\Notifications\Security\MFAUsedBackupCodeNotification;
|
||||||
use FireflyIII\Notifications\Security\NewBackupCodesNotification;
|
use FireflyIII\Notifications\Security\NewBackupCodesNotification;
|
||||||
use Illuminate\Support\Facades\Notification;
|
use Illuminate\Support\Facades\Notification;
|
||||||
|
use Exception;
|
||||||
|
|
||||||
class MFAHandler
|
class MFAHandler
|
||||||
{
|
{
|
||||||
@@ -51,7 +52,7 @@ class MFAHandler
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
Notification::send($user, new MFABackupFewLeftNotification($user, $count));
|
Notification::send($user, new MFABackupFewLeftNotification($user, $count));
|
||||||
} catch (\Exception $e) {
|
} 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 +77,7 @@ class MFAHandler
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
Notification::send($user, new MFABackupNoLeftNotification($user));
|
Notification::send($user, new MFABackupNoLeftNotification($user));
|
||||||
} catch (\Exception $e) {
|
} 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 +102,7 @@ class MFAHandler
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
Notification::send($user, new DisabledMFANotification($user));
|
Notification::send($user, new DisabledMFANotification($user));
|
||||||
} catch (\Exception $e) {
|
} 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 +127,7 @@ class MFAHandler
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
Notification::send($user, new EnabledMFANotification($user));
|
Notification::send($user, new EnabledMFANotification($user));
|
||||||
} catch (\Exception $e) {
|
} 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 +153,7 @@ class MFAHandler
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
Notification::send($user, new MFAManyFailedAttemptsNotification($user, $count));
|
Notification::send($user, new MFAManyFailedAttemptsNotification($user, $count));
|
||||||
} catch (\Exception $e) {
|
} 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 +178,7 @@ class MFAHandler
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
Notification::send($user, new NewBackupCodesNotification($user));
|
Notification::send($user, new NewBackupCodesNotification($user));
|
||||||
} catch (\Exception $e) {
|
} 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 +203,7 @@ class MFAHandler
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
Notification::send($user, new MFAUsedBackupCodeNotification($user));
|
Notification::send($user, new MFAUsedBackupCodeNotification($user));
|
||||||
} catch (\Exception $e) {
|
} 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.');
|
||||||
|
@@ -56,6 +56,7 @@ use Illuminate\Auth\Events\Login;
|
|||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
use Illuminate\Support\Facades\Mail;
|
use Illuminate\Support\Facades\Mail;
|
||||||
use Illuminate\Support\Facades\Notification;
|
use Illuminate\Support\Facades\Notification;
|
||||||
|
use Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class UserEventHandler.
|
* Class UserEventHandler.
|
||||||
@@ -203,7 +204,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) {
|
} 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 +234,7 @@ class UserEventHandler
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
Notification::send($owner, new AdminRegistrationNotification($event->user));
|
Notification::send($owner, new AdminRegistrationNotification($event->user));
|
||||||
} catch (\Exception $e) {
|
} 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.');
|
||||||
@@ -267,7 +268,7 @@ class UserEventHandler
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
Mail::to($newEmail)->send(new ConfirmEmailChangeMail($newEmail, $oldEmail, $url));
|
Mail::to($newEmail)->send(new ConfirmEmailChangeMail($newEmail, $oldEmail, $url));
|
||||||
} catch (\Exception $e) {
|
} catch (Exception $e) {
|
||||||
app('log')->error($e->getMessage());
|
app('log')->error($e->getMessage());
|
||||||
app('log')->error($e->getTraceAsString());
|
app('log')->error($e->getTraceAsString());
|
||||||
|
|
||||||
@@ -292,7 +293,7 @@ class UserEventHandler
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
Mail::to($oldEmail)->send(new UndoEmailChangeMail($newEmail, $oldEmail, $url));
|
Mail::to($oldEmail)->send(new UndoEmailChangeMail($newEmail, $oldEmail, $url));
|
||||||
} catch (\Exception $e) {
|
} catch (Exception $e) {
|
||||||
app('log')->error($e->getMessage());
|
app('log')->error($e->getMessage());
|
||||||
app('log')->error($e->getTraceAsString());
|
app('log')->error($e->getTraceAsString());
|
||||||
|
|
||||||
@@ -304,7 +305,7 @@ class UserEventHandler
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
Notification::send($event->user, new UserFailedLoginAttempt($event->user));
|
Notification::send($event->user, new UserFailedLoginAttempt($event->user));
|
||||||
} catch (\Exception $e) {
|
} 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 +329,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) {
|
} 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.');
|
||||||
@@ -356,7 +357,7 @@ class UserEventHandler
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
Mail::to($invitee)->send(new InvitationMail($invitee, $admin, $url));
|
Mail::to($invitee)->send(new InvitationMail($invitee, $admin, $url));
|
||||||
} catch (\Exception $e) {
|
} catch (Exception $e) {
|
||||||
app('log')->error($e->getMessage());
|
app('log')->error($e->getMessage());
|
||||||
app('log')->error($e->getTraceAsString());
|
app('log')->error($e->getTraceAsString());
|
||||||
|
|
||||||
@@ -374,7 +375,7 @@ class UserEventHandler
|
|||||||
if ($sendMail) {
|
if ($sendMail) {
|
||||||
try {
|
try {
|
||||||
Notification::send($event->user, new UserRegistrationNotification());
|
Notification::send($event->user, new UserRegistrationNotification());
|
||||||
} catch (\Exception $e) {
|
} 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 +430,7 @@ class UserEventHandler
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
Notification::send($event->user, new $class());
|
Notification::send($event->user, new $class());
|
||||||
} catch (\Exception $e) {
|
} 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.');
|
||||||
|
@@ -37,6 +37,8 @@ use Illuminate\Support\Facades\Storage;
|
|||||||
use Illuminate\Support\MessageBag;
|
use Illuminate\Support\MessageBag;
|
||||||
use Symfony\Component\HttpFoundation\File\UploadedFile;
|
use Symfony\Component\HttpFoundation\File\UploadedFile;
|
||||||
|
|
||||||
|
use const DIRECTORY_SEPARATOR;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class AttachmentHelper.
|
* Class AttachmentHelper.
|
||||||
*/
|
*/
|
||||||
@@ -85,7 +87,7 @@ class AttachmentHelper implements AttachmentHelperInterface
|
|||||||
*/
|
*/
|
||||||
public function getAttachmentLocation(Attachment $attachment): string
|
public function getAttachmentLocation(Attachment $attachment): string
|
||||||
{
|
{
|
||||||
return sprintf('%sat-%d.data', \DIRECTORY_SEPARATOR, $attachment->id);
|
return sprintf('%sat-%d.data', DIRECTORY_SEPARATOR, $attachment->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -30,13 +30,14 @@ use FireflyIII\Support\Facades\Steam;
|
|||||||
use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
|
use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
|
use Override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Trait AccountCollection
|
* Trait AccountCollection
|
||||||
*/
|
*/
|
||||||
trait AccountCollection
|
trait AccountCollection
|
||||||
{
|
{
|
||||||
#[\Override]
|
#[Override]
|
||||||
public function accountBalanceIs(string $direction, string $operator, string $value): GroupCollectorInterface
|
public function accountBalanceIs(string $direction, string $operator, string $value): GroupCollectorInterface
|
||||||
{
|
{
|
||||||
Log::warning(sprintf('GroupCollector will be SLOW: accountBalanceIs: "%s" "%s" "%s"', $direction, $operator, $value));
|
Log::warning(sprintf('GroupCollector will be SLOW: accountBalanceIs: "%s" "%s" "%s"', $direction, $operator, $value));
|
||||||
|
@@ -45,6 +45,8 @@ use Illuminate\Database\Query\JoinClause;
|
|||||||
use Illuminate\Pagination\LengthAwarePaginator;
|
use Illuminate\Pagination\LengthAwarePaginator;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
|
use Closure;
|
||||||
|
use Override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class GroupCollector
|
* Class GroupCollector
|
||||||
@@ -582,7 +584,7 @@ class GroupCollector implements GroupCollectorInterface
|
|||||||
$result['date']->setTimezone(config('app.timezone'));
|
$result['date']->setTimezone(config('app.timezone'));
|
||||||
$result['created_at']->setTimezone(config('app.timezone'));
|
$result['created_at']->setTimezone(config('app.timezone'));
|
||||||
$result['updated_at']->setTimezone(config('app.timezone'));
|
$result['updated_at']->setTimezone(config('app.timezone'));
|
||||||
} catch (\Exception $e) { // intentional generic exception
|
} catch (Exception $e) { // intentional generic exception
|
||||||
app('log')->error($e->getMessage());
|
app('log')->error($e->getMessage());
|
||||||
|
|
||||||
throw new FireflyException($e->getMessage(), 0, $e);
|
throw new FireflyException($e->getMessage(), 0, $e);
|
||||||
@@ -778,7 +780,7 @@ class GroupCollector implements GroupCollectorInterface
|
|||||||
app('log')->debug(sprintf('GroupCollector: postFilterCollection has %d filter(s) and %d transaction(s).', count($this->postFilters), count($currentCollection)));
|
app('log')->debug(sprintf('GroupCollector: postFilterCollection has %d filter(s) and %d transaction(s).', count($this->postFilters), count($currentCollection)));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var \Closure $function
|
* @var Closure $function
|
||||||
*/
|
*/
|
||||||
foreach ($this->postFilters as $function) {
|
foreach ($this->postFilters as $function) {
|
||||||
app('log')->debug('Applying filter...');
|
app('log')->debug('Applying filter...');
|
||||||
@@ -812,7 +814,7 @@ class GroupCollector implements GroupCollectorInterface
|
|||||||
return $currentCollection;
|
return $currentCollection;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[\Override]
|
#[Override]
|
||||||
public function sortCollection(Collection $collection): Collection
|
public function sortCollection(Collection $collection): Collection
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@@ -1004,7 +1006,7 @@ class GroupCollector implements GroupCollectorInterface
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[\Override]
|
#[Override]
|
||||||
public function setSorting(array $instructions): GroupCollectorInterface
|
public function setSorting(array $instructions): GroupCollectorInterface
|
||||||
{
|
{
|
||||||
$this->sorting = $instructions;
|
$this->sorting = $instructions;
|
||||||
|
@@ -26,6 +26,7 @@ namespace FireflyIII\Helpers\Webhook;
|
|||||||
|
|
||||||
use FireflyIII\Exceptions\FireflyException;
|
use FireflyIII\Exceptions\FireflyException;
|
||||||
use FireflyIII\Models\WebhookMessage;
|
use FireflyIII\Models\WebhookMessage;
|
||||||
|
use JsonException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class Sha3SignatureGenerator
|
* Class Sha3SignatureGenerator
|
||||||
@@ -47,7 +48,7 @@ class Sha3SignatureGenerator implements SignatureGeneratorInterface
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
$json = \Safe\json_encode($message->message, JSON_THROW_ON_ERROR);
|
$json = \Safe\json_encode($message->message, JSON_THROW_ON_ERROR);
|
||||||
} catch (\JsonException $e) {
|
} catch (JsonException $e) {
|
||||||
app('log')->error('Could not generate hash.');
|
app('log')->error('Could not generate hash.');
|
||||||
app('log')->error(sprintf('JSON value: %s', $json));
|
app('log')->error(sprintf('JSON value: %s', $json));
|
||||||
app('log')->error($e->getMessage());
|
app('log')->error($e->getMessage());
|
||||||
|
@@ -53,6 +53,9 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
|||||||
use function Safe\file_get_contents;
|
use function Safe\file_get_contents;
|
||||||
use function Safe\ini_get;
|
use function Safe\ini_get;
|
||||||
|
|
||||||
|
use const PHP_INT_SIZE;
|
||||||
|
use const PHP_SAPI;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class DebugController
|
* Class DebugController
|
||||||
*/
|
*/
|
||||||
@@ -177,8 +180,8 @@ class DebugController extends Controller
|
|||||||
'php_version' => PHP_VERSION,
|
'php_version' => PHP_VERSION,
|
||||||
'php_os' => PHP_OS,
|
'php_os' => PHP_OS,
|
||||||
'uname' => php_uname('m'),
|
'uname' => php_uname('m'),
|
||||||
'interface' => \PHP_SAPI,
|
'interface' => PHP_SAPI,
|
||||||
'bits' => \PHP_INT_SIZE * 8,
|
'bits' => PHP_INT_SIZE * 8,
|
||||||
'bcscale' => bcscale(),
|
'bcscale' => bcscale(),
|
||||||
'display_errors' => ini_get('display_errors'),
|
'display_errors' => ini_get('display_errors'),
|
||||||
'error_reporting' => $this->errorReporting((int) ini_get('error_reporting')),
|
'error_reporting' => $this->errorReporting((int) ini_get('error_reporting')),
|
||||||
|
@@ -30,6 +30,7 @@ use Illuminate\Queue\SerializesModels;
|
|||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
use Illuminate\Support\Facades\Mail;
|
use Illuminate\Support\Facades\Mail;
|
||||||
use Symfony\Component\Mailer\Exception\TransportException;
|
use Symfony\Component\Mailer\Exception\TransportException;
|
||||||
|
use Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class MailError.
|
* Class MailError.
|
||||||
@@ -80,7 +81,7 @@ class MailError extends Job implements ShouldQueue
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
} catch (\Exception|TransportException $e) {
|
} 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.');
|
||||||
|
@@ -32,46 +32,46 @@ class AccountType extends Model
|
|||||||
{
|
{
|
||||||
use ReturnsIntegerIdTrait;
|
use ReturnsIntegerIdTrait;
|
||||||
|
|
||||||
#[\Deprecated] /** @deprecated */
|
#[Deprecated] /** @deprecated */
|
||||||
public const string ASSET = 'Asset account';
|
public const string ASSET = 'Asset account';
|
||||||
|
|
||||||
#[\Deprecated] /** @deprecated */
|
#[Deprecated] /** @deprecated */
|
||||||
public const string BENEFICIARY = 'Beneficiary account';
|
public const string BENEFICIARY = 'Beneficiary account';
|
||||||
|
|
||||||
#[\Deprecated] /** @deprecated */
|
#[Deprecated] /** @deprecated */
|
||||||
public const string CASH = 'Cash account';
|
public const string CASH = 'Cash account';
|
||||||
|
|
||||||
#[\Deprecated] /** @deprecated */
|
#[Deprecated] /** @deprecated */
|
||||||
public const string CREDITCARD = 'Credit card';
|
public const string CREDITCARD = 'Credit card';
|
||||||
|
|
||||||
#[\Deprecated] /** @deprecated */
|
#[Deprecated] /** @deprecated */
|
||||||
public const string DEBT = 'Debt';
|
public const string DEBT = 'Debt';
|
||||||
|
|
||||||
#[\Deprecated] /** @deprecated */
|
#[Deprecated] /** @deprecated */
|
||||||
public const string DEFAULT = 'Default account';
|
public const string DEFAULT = 'Default account';
|
||||||
|
|
||||||
#[\Deprecated] /** @deprecated */
|
#[Deprecated] /** @deprecated */
|
||||||
public const string EXPENSE = 'Expense account';
|
public const string EXPENSE = 'Expense account';
|
||||||
|
|
||||||
#[\Deprecated] /** @deprecated */
|
#[Deprecated] /** @deprecated */
|
||||||
public const string IMPORT = 'Import account';
|
public const string IMPORT = 'Import account';
|
||||||
|
|
||||||
#[\Deprecated] /** @deprecated */
|
#[Deprecated] /** @deprecated */
|
||||||
public const string INITIAL_BALANCE = 'Initial balance account';
|
public const string INITIAL_BALANCE = 'Initial balance account';
|
||||||
|
|
||||||
#[\Deprecated] /** @deprecated */
|
#[Deprecated] /** @deprecated */
|
||||||
public const string LIABILITY_CREDIT = 'Liability credit account';
|
public const string LIABILITY_CREDIT = 'Liability credit account';
|
||||||
|
|
||||||
#[\Deprecated] /** @deprecated */
|
#[Deprecated] /** @deprecated */
|
||||||
public const string LOAN = 'Loan';
|
public const string LOAN = 'Loan';
|
||||||
|
|
||||||
#[\Deprecated] /** @deprecated */
|
#[Deprecated] /** @deprecated */
|
||||||
public const string MORTGAGE = 'Mortgage';
|
public const string MORTGAGE = 'Mortgage';
|
||||||
|
|
||||||
#[\Deprecated] /** @deprecated */
|
#[Deprecated] /** @deprecated */
|
||||||
public const string RECONCILIATION = 'Reconciliation account';
|
public const string RECONCILIATION = 'Reconciliation account';
|
||||||
|
|
||||||
#[\Deprecated] /** @deprecated */
|
#[Deprecated] /** @deprecated */
|
||||||
public const string REVENUE = 'Revenue account';
|
public const string REVENUE = 'Revenue account';
|
||||||
|
|
||||||
protected $casts
|
protected $casts
|
||||||
|
@@ -36,13 +36,13 @@ class AutoBudget extends Model
|
|||||||
use ReturnsIntegerIdTrait;
|
use ReturnsIntegerIdTrait;
|
||||||
use SoftDeletes;
|
use SoftDeletes;
|
||||||
|
|
||||||
#[\Deprecated] /** @deprecated */
|
#[Deprecated] /** @deprecated */
|
||||||
public const int AUTO_BUDGET_ADJUSTED = 3;
|
public const int AUTO_BUDGET_ADJUSTED = 3;
|
||||||
|
|
||||||
#[\Deprecated] /** @deprecated */
|
#[Deprecated] /** @deprecated */
|
||||||
public const int AUTO_BUDGET_RESET = 1;
|
public const int AUTO_BUDGET_RESET = 1;
|
||||||
|
|
||||||
#[\Deprecated] /** @deprecated */
|
#[Deprecated] /** @deprecated */
|
||||||
public const int AUTO_BUDGET_ROLLOVER = 2;
|
public const int AUTO_BUDGET_ROLLOVER = 2;
|
||||||
protected $casts
|
protected $casts
|
||||||
= [
|
= [
|
||||||
|
@@ -36,16 +36,16 @@ class RecurrenceRepetition extends Model
|
|||||||
use ReturnsIntegerIdTrait;
|
use ReturnsIntegerIdTrait;
|
||||||
use SoftDeletes;
|
use SoftDeletes;
|
||||||
|
|
||||||
#[\Deprecated] /** @deprecated */
|
#[Deprecated] /** @deprecated */
|
||||||
public const int WEEKEND_DO_NOTHING = 1;
|
public const int WEEKEND_DO_NOTHING = 1;
|
||||||
|
|
||||||
#[\Deprecated] /** @deprecated */
|
#[Deprecated] /** @deprecated */
|
||||||
public const int WEEKEND_SKIP_CREATION = 2;
|
public const int WEEKEND_SKIP_CREATION = 2;
|
||||||
|
|
||||||
#[\Deprecated] /** @deprecated */
|
#[Deprecated] /** @deprecated */
|
||||||
public const int WEEKEND_TO_FRIDAY = 3;
|
public const int WEEKEND_TO_FRIDAY = 3;
|
||||||
|
|
||||||
#[\Deprecated] /** @deprecated */
|
#[Deprecated] /** @deprecated */
|
||||||
public const int WEEKEND_TO_MONDAY = 4;
|
public const int WEEKEND_TO_MONDAY = 4;
|
||||||
|
|
||||||
protected $casts
|
protected $casts
|
||||||
|
@@ -36,25 +36,25 @@ class TransactionType extends Model
|
|||||||
use ReturnsIntegerIdTrait;
|
use ReturnsIntegerIdTrait;
|
||||||
use SoftDeletes;
|
use SoftDeletes;
|
||||||
|
|
||||||
#[\Deprecated] /** @deprecated */
|
#[Deprecated] /** @deprecated */
|
||||||
public const string DEPOSIT = 'Deposit';
|
public const string DEPOSIT = 'Deposit';
|
||||||
|
|
||||||
#[\Deprecated] /** @deprecated */
|
#[Deprecated] /** @deprecated */
|
||||||
public const string INVALID = 'Invalid';
|
public const string INVALID = 'Invalid';
|
||||||
|
|
||||||
#[\Deprecated] /** @deprecated */
|
#[Deprecated] /** @deprecated */
|
||||||
public const string LIABILITY_CREDIT = 'Liability credit';
|
public const string LIABILITY_CREDIT = 'Liability credit';
|
||||||
|
|
||||||
#[\Deprecated] /** @deprecated */
|
#[Deprecated] /** @deprecated */
|
||||||
public const string OPENING_BALANCE = 'Opening balance';
|
public const string OPENING_BALANCE = 'Opening balance';
|
||||||
|
|
||||||
#[\Deprecated] /** @deprecated */
|
#[Deprecated] /** @deprecated */
|
||||||
public const string RECONCILIATION = 'Reconciliation';
|
public const string RECONCILIATION = 'Reconciliation';
|
||||||
|
|
||||||
#[\Deprecated] /** @deprecated */
|
#[Deprecated] /** @deprecated */
|
||||||
public const string TRANSFER = 'Transfer';
|
public const string TRANSFER = 'Transfer';
|
||||||
|
|
||||||
#[\Deprecated] /** @deprecated */
|
#[Deprecated] /** @deprecated */
|
||||||
public const string WITHDRAWAL = 'Withdrawal';
|
public const string WITHDRAWAL = 'Withdrawal';
|
||||||
|
|
||||||
protected $casts
|
protected $casts
|
||||||
|
@@ -31,6 +31,7 @@ use FireflyIII\Repositories\Account\OperationsRepository;
|
|||||||
use FireflyIII\Repositories\Account\OperationsRepositoryInterface;
|
use FireflyIII\Repositories\Account\OperationsRepositoryInterface;
|
||||||
use Illuminate\Foundation\Application;
|
use Illuminate\Foundation\Application;
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
use Override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class AccountServiceProvider.
|
* Class AccountServiceProvider.
|
||||||
@@ -45,7 +46,7 @@ class AccountServiceProvider extends ServiceProvider
|
|||||||
/**
|
/**
|
||||||
* Register the application services.
|
* Register the application services.
|
||||||
*/
|
*/
|
||||||
#[\Override]
|
#[Override]
|
||||||
public function register(): void
|
public function register(): void
|
||||||
{
|
{
|
||||||
$this->registerRepository();
|
$this->registerRepository();
|
||||||
|
@@ -27,6 +27,7 @@ use FireflyIII\Repositories\LinkType\LinkTypeRepository;
|
|||||||
use FireflyIII\Repositories\LinkType\LinkTypeRepositoryInterface;
|
use FireflyIII\Repositories\LinkType\LinkTypeRepositoryInterface;
|
||||||
use Illuminate\Foundation\Application;
|
use Illuminate\Foundation\Application;
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
use Override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class AdminServiceProvider
|
* Class AdminServiceProvider
|
||||||
@@ -41,7 +42,7 @@ class AdminServiceProvider extends ServiceProvider
|
|||||||
/**
|
/**
|
||||||
* Register the application services.
|
* Register the application services.
|
||||||
*/
|
*/
|
||||||
#[\Override]
|
#[Override]
|
||||||
public function register(): void
|
public function register(): void
|
||||||
{
|
{
|
||||||
$this->linkType();
|
$this->linkType();
|
||||||
|
@@ -29,6 +29,7 @@ use Illuminate\Support\Facades\Route;
|
|||||||
use Illuminate\Support\Facades\Schema;
|
use Illuminate\Support\Facades\Schema;
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
use Laravel\Passport\Passport;
|
use Laravel\Passport\Passport;
|
||||||
|
use Override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class AppServiceProvider
|
* Class AppServiceProvider
|
||||||
@@ -87,7 +88,7 @@ class AppServiceProvider extends ServiceProvider
|
|||||||
/**
|
/**
|
||||||
* Register any application services.
|
* Register any application services.
|
||||||
*/
|
*/
|
||||||
#[\Override]
|
#[Override]
|
||||||
public function register(): void
|
public function register(): void
|
||||||
{
|
{
|
||||||
Passport::ignoreRoutes();
|
Passport::ignoreRoutes();
|
||||||
|
@@ -27,6 +27,7 @@ use FireflyIII\Repositories\Attachment\AttachmentRepository;
|
|||||||
use FireflyIII\Repositories\Attachment\AttachmentRepositoryInterface;
|
use FireflyIII\Repositories\Attachment\AttachmentRepositoryInterface;
|
||||||
use Illuminate\Foundation\Application;
|
use Illuminate\Foundation\Application;
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
use Override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class AttachmentServiceProvider.
|
* Class AttachmentServiceProvider.
|
||||||
@@ -41,7 +42,7 @@ class AttachmentServiceProvider extends ServiceProvider
|
|||||||
/**
|
/**
|
||||||
* Register the application services.
|
* Register the application services.
|
||||||
*/
|
*/
|
||||||
#[\Override]
|
#[Override]
|
||||||
public function register(): void
|
public function register(): void
|
||||||
{
|
{
|
||||||
$this->app->bind(
|
$this->app->bind(
|
||||||
|
@@ -27,6 +27,7 @@ use FireflyIII\Repositories\Bill\BillRepository;
|
|||||||
use FireflyIII\Repositories\Bill\BillRepositoryInterface;
|
use FireflyIII\Repositories\Bill\BillRepositoryInterface;
|
||||||
use Illuminate\Foundation\Application;
|
use Illuminate\Foundation\Application;
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
use Override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class BillServiceProvider.
|
* Class BillServiceProvider.
|
||||||
@@ -41,7 +42,7 @@ class BillServiceProvider extends ServiceProvider
|
|||||||
/**
|
/**
|
||||||
* Register the application services.
|
* Register the application services.
|
||||||
*/
|
*/
|
||||||
#[\Override]
|
#[Override]
|
||||||
public function register(): void
|
public function register(): void
|
||||||
{
|
{
|
||||||
$this->app->bind(
|
$this->app->bind(
|
||||||
|
@@ -35,6 +35,7 @@ use FireflyIII\Repositories\Budget\OperationsRepository;
|
|||||||
use FireflyIII\Repositories\Budget\OperationsRepositoryInterface;
|
use FireflyIII\Repositories\Budget\OperationsRepositoryInterface;
|
||||||
use Illuminate\Foundation\Application;
|
use Illuminate\Foundation\Application;
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
use Override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class BudgetServiceProvider.
|
* Class BudgetServiceProvider.
|
||||||
@@ -51,7 +52,7 @@ class BudgetServiceProvider extends ServiceProvider
|
|||||||
*
|
*
|
||||||
* @SuppressWarnings("PHPMD.ExcessiveMethodLength")
|
* @SuppressWarnings("PHPMD.ExcessiveMethodLength")
|
||||||
*/
|
*/
|
||||||
#[\Override]
|
#[Override]
|
||||||
public function register(): void
|
public function register(): void
|
||||||
{
|
{
|
||||||
// reference to auth is not understood by phpstan.
|
// reference to auth is not understood by phpstan.
|
||||||
|
@@ -31,6 +31,7 @@ use FireflyIII\Repositories\Category\OperationsRepository;
|
|||||||
use FireflyIII\Repositories\Category\OperationsRepositoryInterface;
|
use FireflyIII\Repositories\Category\OperationsRepositoryInterface;
|
||||||
use Illuminate\Foundation\Application;
|
use Illuminate\Foundation\Application;
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
use Override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class CategoryServiceProvider.
|
* Class CategoryServiceProvider.
|
||||||
@@ -45,7 +46,7 @@ class CategoryServiceProvider extends ServiceProvider
|
|||||||
/**
|
/**
|
||||||
* Register the application services.
|
* Register the application services.
|
||||||
*/
|
*/
|
||||||
#[\Override]
|
#[Override]
|
||||||
public function register(): void
|
public function register(): void
|
||||||
{
|
{
|
||||||
// phpstan does not understand reference to 'auth'.
|
// phpstan does not understand reference to 'auth'.
|
||||||
|
@@ -31,6 +31,7 @@ use FireflyIII\Repositories\ExchangeRate\ExchangeRateRepository;
|
|||||||
use FireflyIII\Repositories\ExchangeRate\ExchangeRateRepositoryInterface;
|
use FireflyIII\Repositories\ExchangeRate\ExchangeRateRepositoryInterface;
|
||||||
use Illuminate\Foundation\Application;
|
use Illuminate\Foundation\Application;
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
use Override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class CurrencyServiceProvider.
|
* Class CurrencyServiceProvider.
|
||||||
@@ -45,7 +46,7 @@ class CurrencyServiceProvider extends ServiceProvider
|
|||||||
/**
|
/**
|
||||||
* Register the application services.
|
* Register the application services.
|
||||||
*/
|
*/
|
||||||
#[\Override]
|
#[Override]
|
||||||
public function register(): void
|
public function register(): void
|
||||||
{
|
{
|
||||||
$this->app->bind(
|
$this->app->bind(
|
||||||
|
@@ -101,6 +101,7 @@ use FireflyIII\Models\WebhookMessage;
|
|||||||
use Illuminate\Auth\Events\Login;
|
use Illuminate\Auth\Events\Login;
|
||||||
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
|
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
|
||||||
use Laravel\Passport\Events\AccessTokenCreated;
|
use Laravel\Passport\Events\AccessTokenCreated;
|
||||||
|
use Override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class EventServiceProvider.
|
* Class EventServiceProvider.
|
||||||
@@ -260,7 +261,7 @@ class EventServiceProvider extends ServiceProvider
|
|||||||
/**
|
/**
|
||||||
* Register any events for your application.
|
* Register any events for your application.
|
||||||
*/
|
*/
|
||||||
#[\Override]
|
#[Override]
|
||||||
public function boot(): void
|
public function boot(): void
|
||||||
{
|
{
|
||||||
$this->registerObservers();
|
$this->registerObservers();
|
||||||
|
@@ -76,6 +76,7 @@ use Illuminate\Foundation\Application;
|
|||||||
use Illuminate\Support\Facades\Validator;
|
use Illuminate\Support\Facades\Validator;
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
use Symfony\Component\ExpressionLanguage\ExpressionLanguage;
|
use Symfony\Component\ExpressionLanguage\ExpressionLanguage;
|
||||||
|
use Override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class FireflyServiceProvider.
|
* Class FireflyServiceProvider.
|
||||||
@@ -99,7 +100,7 @@ class FireflyServiceProvider extends ServiceProvider
|
|||||||
*
|
*
|
||||||
* @SuppressWarnings("PHPMD.ExcessiveMethodLength")
|
* @SuppressWarnings("PHPMD.ExcessiveMethodLength")
|
||||||
*/
|
*/
|
||||||
#[\Override]
|
#[Override]
|
||||||
public function register(): void
|
public function register(): void
|
||||||
{
|
{
|
||||||
$this->app->bind(
|
$this->app->bind(
|
||||||
|
@@ -26,6 +26,7 @@ namespace FireflyIII\Providers;
|
|||||||
use FireflyIII\Http\Middleware\StartFireflySession;
|
use FireflyIII\Http\Middleware\StartFireflySession;
|
||||||
use Illuminate\Session\SessionManager;
|
use Illuminate\Session\SessionManager;
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
use Override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class FireflySessionProvider
|
* Class FireflySessionProvider
|
||||||
@@ -35,7 +36,7 @@ class FireflySessionProvider extends ServiceProvider
|
|||||||
/**
|
/**
|
||||||
* Register the service provider.
|
* Register the service provider.
|
||||||
*/
|
*/
|
||||||
#[\Override]
|
#[Override]
|
||||||
public function register(): void
|
public function register(): void
|
||||||
{
|
{
|
||||||
$this->registerSessionManager();
|
$this->registerSessionManager();
|
||||||
|
@@ -35,6 +35,7 @@ use FireflyIII\Repositories\TransactionGroup\TransactionGroupRepository;
|
|||||||
use FireflyIII\Repositories\TransactionGroup\TransactionGroupRepositoryInterface;
|
use FireflyIII\Repositories\TransactionGroup\TransactionGroupRepositoryInterface;
|
||||||
use Illuminate\Foundation\Application;
|
use Illuminate\Foundation\Application;
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
use Override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class JournalServiceProvider.
|
* Class JournalServiceProvider.
|
||||||
@@ -49,7 +50,7 @@ class JournalServiceProvider extends ServiceProvider
|
|||||||
/**
|
/**
|
||||||
* Register the application services.
|
* Register the application services.
|
||||||
*/
|
*/
|
||||||
#[\Override]
|
#[Override]
|
||||||
public function register(): void
|
public function register(): void
|
||||||
{
|
{
|
||||||
$this->registerRepository();
|
$this->registerRepository();
|
||||||
|
@@ -27,6 +27,7 @@ use FireflyIII\Repositories\PiggyBank\PiggyBankRepository;
|
|||||||
use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface;
|
use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface;
|
||||||
use Illuminate\Foundation\Application;
|
use Illuminate\Foundation\Application;
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
use Override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class PiggyBankServiceProvider.
|
* Class PiggyBankServiceProvider.
|
||||||
@@ -41,7 +42,7 @@ class PiggyBankServiceProvider extends ServiceProvider
|
|||||||
/**
|
/**
|
||||||
* Register the application services.
|
* Register the application services.
|
||||||
*/
|
*/
|
||||||
#[\Override]
|
#[Override]
|
||||||
public function register(): void
|
public function register(): void
|
||||||
{
|
{
|
||||||
$this->app->bind(
|
$this->app->bind(
|
||||||
|
@@ -27,6 +27,7 @@ use FireflyIII\Repositories\Recurring\RecurringRepository;
|
|||||||
use FireflyIII\Repositories\Recurring\RecurringRepositoryInterface;
|
use FireflyIII\Repositories\Recurring\RecurringRepositoryInterface;
|
||||||
use Illuminate\Foundation\Application;
|
use Illuminate\Foundation\Application;
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
use Override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class RecurringServiceProvider.
|
* Class RecurringServiceProvider.
|
||||||
@@ -41,7 +42,7 @@ class RecurringServiceProvider extends ServiceProvider
|
|||||||
/**
|
/**
|
||||||
* Register the application services.
|
* Register the application services.
|
||||||
*/
|
*/
|
||||||
#[\Override]
|
#[Override]
|
||||||
public function register(): void
|
public function register(): void
|
||||||
{
|
{
|
||||||
$this->app->bind(
|
$this->app->bind(
|
||||||
|
@@ -25,6 +25,7 @@ namespace FireflyIII\Providers;
|
|||||||
|
|
||||||
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
|
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
|
||||||
use Illuminate\Support\Facades\Route;
|
use Illuminate\Support\Facades\Route;
|
||||||
|
use Override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class RouteServiceProvider
|
* Class RouteServiceProvider
|
||||||
@@ -37,7 +38,7 @@ class RouteServiceProvider extends ServiceProvider
|
|||||||
/**
|
/**
|
||||||
* Define the routes for the application.
|
* Define the routes for the application.
|
||||||
*/
|
*/
|
||||||
#[\Override]
|
#[Override]
|
||||||
public function boot(): void
|
public function boot(): void
|
||||||
{
|
{
|
||||||
$this->routes(function (): void {
|
$this->routes(function (): void {
|
||||||
|
@@ -27,6 +27,7 @@ use FireflyIII\Repositories\RuleGroup\RuleGroupRepository;
|
|||||||
use FireflyIII\Repositories\RuleGroup\RuleGroupRepositoryInterface;
|
use FireflyIII\Repositories\RuleGroup\RuleGroupRepositoryInterface;
|
||||||
use Illuminate\Foundation\Application;
|
use Illuminate\Foundation\Application;
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
use Override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class RuleGroupServiceProvider.
|
* Class RuleGroupServiceProvider.
|
||||||
@@ -41,7 +42,7 @@ class RuleGroupServiceProvider extends ServiceProvider
|
|||||||
/**
|
/**
|
||||||
* Register the application services.
|
* Register the application services.
|
||||||
*/
|
*/
|
||||||
#[\Override]
|
#[Override]
|
||||||
public function register(): void
|
public function register(): void
|
||||||
{
|
{
|
||||||
$this->app->bind(
|
$this->app->bind(
|
||||||
|
@@ -27,6 +27,7 @@ use FireflyIII\Repositories\Rule\RuleRepository;
|
|||||||
use FireflyIII\Repositories\Rule\RuleRepositoryInterface;
|
use FireflyIII\Repositories\Rule\RuleRepositoryInterface;
|
||||||
use Illuminate\Foundation\Application;
|
use Illuminate\Foundation\Application;
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
use Override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class RuleServiceProvider.
|
* Class RuleServiceProvider.
|
||||||
@@ -41,7 +42,7 @@ class RuleServiceProvider extends ServiceProvider
|
|||||||
/**
|
/**
|
||||||
* Register the application services.
|
* Register the application services.
|
||||||
*/
|
*/
|
||||||
#[\Override]
|
#[Override]
|
||||||
public function register(): void
|
public function register(): void
|
||||||
{
|
{
|
||||||
$this->app->bind(
|
$this->app->bind(
|
||||||
|
@@ -30,6 +30,7 @@ use FireflyIII\Support\Search\QueryParser\QueryParserInterface;
|
|||||||
use FireflyIII\Support\Search\SearchInterface;
|
use FireflyIII\Support\Search\SearchInterface;
|
||||||
use Illuminate\Foundation\Application;
|
use Illuminate\Foundation\Application;
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
use Override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class SearchServiceProvider.
|
* Class SearchServiceProvider.
|
||||||
@@ -44,7 +45,7 @@ class SearchServiceProvider extends ServiceProvider
|
|||||||
/**
|
/**
|
||||||
* Register the application services.
|
* Register the application services.
|
||||||
*/
|
*/
|
||||||
#[\Override]
|
#[Override]
|
||||||
public function register(): void
|
public function register(): void
|
||||||
{
|
{
|
||||||
$this->app->bind(
|
$this->app->bind(
|
||||||
|
@@ -25,6 +25,7 @@ namespace FireflyIII\Providers;
|
|||||||
|
|
||||||
use FireflyIII\Http\Middleware\StartFireflySession;
|
use FireflyIII\Http\Middleware\StartFireflySession;
|
||||||
use Illuminate\Session\SessionServiceProvider as BaseSessionServiceProvider;
|
use Illuminate\Session\SessionServiceProvider as BaseSessionServiceProvider;
|
||||||
|
use Override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class SessionServiceProvider.
|
* Class SessionServiceProvider.
|
||||||
@@ -34,7 +35,7 @@ class SessionServiceProvider extends BaseSessionServiceProvider
|
|||||||
/**
|
/**
|
||||||
* Register the service provider.
|
* Register the service provider.
|
||||||
*/
|
*/
|
||||||
#[\Override]
|
#[Override]
|
||||||
public function register(): void
|
public function register(): void
|
||||||
{
|
{
|
||||||
$this->registerSessionManager();
|
$this->registerSessionManager();
|
||||||
|
@@ -29,6 +29,7 @@ use FireflyIII\Repositories\Tag\TagRepository;
|
|||||||
use FireflyIII\Repositories\Tag\TagRepositoryInterface;
|
use FireflyIII\Repositories\Tag\TagRepositoryInterface;
|
||||||
use Illuminate\Foundation\Application;
|
use Illuminate\Foundation\Application;
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
use Override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class TagServiceProvider.
|
* Class TagServiceProvider.
|
||||||
@@ -43,7 +44,7 @@ class TagServiceProvider extends ServiceProvider
|
|||||||
/**
|
/**
|
||||||
* Register the application services.
|
* Register the application services.
|
||||||
*/
|
*/
|
||||||
#[\Override]
|
#[Override]
|
||||||
public function register(): void
|
public function register(): void
|
||||||
{
|
{
|
||||||
$this->app->bind(
|
$this->app->bind(
|
||||||
|
@@ -45,6 +45,7 @@ use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
|
|||||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
use Illuminate\Support\Facades\Storage;
|
use Illuminate\Support\Facades\Storage;
|
||||||
|
use Override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class AccountRepository.
|
* Class AccountRepository.
|
||||||
@@ -162,7 +163,7 @@ class AccountRepository implements AccountRepositoryInterface, UserGroupInterfac
|
|||||||
return $account;
|
return $account;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[\Override]
|
#[Override]
|
||||||
public function getAccountBalances(Account $account): Collection
|
public function getAccountBalances(Account $account): Collection
|
||||||
{
|
{
|
||||||
return $account->accountBalances;
|
return $account->accountBalances;
|
||||||
@@ -533,7 +534,7 @@ class AccountRepository implements AccountRepositoryInterface, UserGroupInterfac
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[\Override]
|
#[Override]
|
||||||
public function periodCollection(Account $account, Carbon $start, Carbon $end): array
|
public function periodCollection(Account $account, Carbon $start, Carbon $end): array
|
||||||
{
|
{
|
||||||
return $account->transactions()
|
return $account->transactions()
|
||||||
|
@@ -35,6 +35,8 @@ use Illuminate\Support\Collection;
|
|||||||
use Illuminate\Support\Facades\Crypt;
|
use Illuminate\Support\Facades\Crypt;
|
||||||
use Illuminate\Support\Facades\Storage;
|
use Illuminate\Support\Facades\Storage;
|
||||||
use League\Flysystem\UnableToDeleteFile;
|
use League\Flysystem\UnableToDeleteFile;
|
||||||
|
use Exception;
|
||||||
|
use LogicException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class AttachmentRepository.
|
* Class AttachmentRepository.
|
||||||
@@ -44,7 +46,7 @@ class AttachmentRepository implements AttachmentRepositoryInterface, UserGroupIn
|
|||||||
use UserGroupTrait;
|
use UserGroupTrait;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @throws \Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function destroy(Attachment $attachment): bool
|
public function destroy(Attachment $attachment): bool
|
||||||
{
|
{
|
||||||
@@ -158,7 +160,7 @@ class AttachmentRepository implements AttachmentRepositoryInterface, UserGroupIn
|
|||||||
if (null !== $dbNote) {
|
if (null !== $dbNote) {
|
||||||
try {
|
try {
|
||||||
$dbNote->delete();
|
$dbNote->delete();
|
||||||
} catch (\LogicException $e) {
|
} catch (LogicException $e) {
|
||||||
app('log')->error($e->getMessage());
|
app('log')->error($e->getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -36,6 +36,7 @@ use FireflyIII\Support\Repositories\UserGroup\UserGroupTrait;
|
|||||||
use Illuminate\Database\Eloquent\Builder;
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
|
use Override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class BudgetLimitRepository
|
* Class BudgetLimitRepository
|
||||||
@@ -254,7 +255,7 @@ class BudgetLimitRepository implements BudgetLimitRepositoryInterface, UserGroup
|
|||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[\Override]
|
#[Override]
|
||||||
public function getNoteText(BudgetLimit $budgetLimit): string
|
public function getNoteText(BudgetLimit $budgetLimit): string
|
||||||
{
|
{
|
||||||
return (string) $budgetLimit->notes()->first()?->text;
|
return (string) $budgetLimit->notes()->first()?->text;
|
||||||
@@ -323,7 +324,7 @@ class BudgetLimitRepository implements BudgetLimitRepositoryInterface, UserGroup
|
|||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[\Override]
|
#[Override]
|
||||||
public function setNoteText(BudgetLimit $budgetLimit, string $text): void
|
public function setNoteText(BudgetLimit $budgetLimit, string $text): void
|
||||||
{
|
{
|
||||||
$dbNote = $budgetLimit->notes()->first();
|
$dbNote = $budgetLimit->notes()->first();
|
||||||
|
@@ -39,6 +39,7 @@ use Illuminate\Support\Collection;
|
|||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
use Illuminate\Support\Facades\Storage;
|
use Illuminate\Support\Facades\Storage;
|
||||||
|
use Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class CategoryRepository.
|
* Class CategoryRepository.
|
||||||
@@ -271,7 +272,7 @@ class CategoryRepository implements CategoryRepositoryInterface, UserGroupInterf
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @throws \Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function lastUseDate(Category $category, Collection $accounts): ?Carbon
|
public function lastUseDate(Category $category, Collection $accounts): ?Carbon
|
||||||
{
|
{
|
||||||
@@ -314,7 +315,7 @@ class CategoryRepository implements CategoryRepositoryInterface, UserGroupInterf
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @throws \Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
private function getLastTransactionDate(Category $category, Collection $accounts): ?Carbon
|
private function getLastTransactionDate(Category $category, Collection $accounts): ?Carbon
|
||||||
{
|
{
|
||||||
@@ -347,7 +348,7 @@ class CategoryRepository implements CategoryRepositoryInterface, UserGroupInterf
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @throws \Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function update(Category $category, array $data): Category
|
public function update(Category $category, array $data): Category
|
||||||
{
|
{
|
||||||
|
@@ -42,6 +42,7 @@ use FireflyIII\Support\Repositories\UserGroup\UserGroupInterface;
|
|||||||
use FireflyIII\Support\Repositories\UserGroup\UserGroupTrait;
|
use FireflyIII\Support\Repositories\UserGroup\UserGroupTrait;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
|
use Override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class CurrencyRepository.
|
* Class CurrencyRepository.
|
||||||
@@ -277,7 +278,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface, UserGroupInterf
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[\Override]
|
#[Override]
|
||||||
public function find(int $currencyId): ?TransactionCurrency
|
public function find(int $currencyId): ?TransactionCurrency
|
||||||
{
|
{
|
||||||
return TransactionCurrency::find($currencyId);
|
return TransactionCurrency::find($currencyId);
|
||||||
|
@@ -31,24 +31,25 @@ use FireflyIII\Support\Repositories\UserGroup\UserGroupInterface;
|
|||||||
use FireflyIII\Support\Repositories\UserGroup\UserGroupTrait;
|
use FireflyIII\Support\Repositories\UserGroup\UserGroupTrait;
|
||||||
use Illuminate\Database\Eloquent\Builder;
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
|
use Override;
|
||||||
|
|
||||||
class ExchangeRateRepository implements ExchangeRateRepositoryInterface, UserGroupInterface
|
class ExchangeRateRepository implements ExchangeRateRepositoryInterface, UserGroupInterface
|
||||||
{
|
{
|
||||||
use UserGroupTrait;
|
use UserGroupTrait;
|
||||||
|
|
||||||
#[\Override]
|
#[Override]
|
||||||
public function deleteRate(CurrencyExchangeRate $rate): void
|
public function deleteRate(CurrencyExchangeRate $rate): void
|
||||||
{
|
{
|
||||||
$this->userGroup->currencyExchangeRates()->where('id', $rate->id)->delete();
|
$this->userGroup->currencyExchangeRates()->where('id', $rate->id)->delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
#[\Override]
|
#[Override]
|
||||||
public function getAll(): Collection
|
public function getAll(): Collection
|
||||||
{
|
{
|
||||||
return $this->userGroup->currencyExchangeRates()->orderBy('date', 'ASC')->get();
|
return $this->userGroup->currencyExchangeRates()->orderBy('date', 'ASC')->get();
|
||||||
}
|
}
|
||||||
|
|
||||||
#[\Override]
|
#[Override]
|
||||||
public function getRates(TransactionCurrency $from, TransactionCurrency $to): Collection
|
public function getRates(TransactionCurrency $from, TransactionCurrency $to): Collection
|
||||||
{
|
{
|
||||||
// orderBy('date', 'DESC')->toRawSql();
|
// orderBy('date', 'DESC')->toRawSql();
|
||||||
@@ -71,7 +72,7 @@ class ExchangeRateRepository implements ExchangeRateRepositoryInterface, UserGro
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[\Override]
|
#[Override]
|
||||||
public function getSpecificRateOnDate(TransactionCurrency $from, TransactionCurrency $to, Carbon $date): ?CurrencyExchangeRate
|
public function getSpecificRateOnDate(TransactionCurrency $from, TransactionCurrency $to, Carbon $date): ?CurrencyExchangeRate
|
||||||
{
|
{
|
||||||
/** @var null|CurrencyExchangeRate */
|
/** @var null|CurrencyExchangeRate */
|
||||||
@@ -84,7 +85,7 @@ class ExchangeRateRepository implements ExchangeRateRepositoryInterface, UserGro
|
|||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[\Override]
|
#[Override]
|
||||||
public function storeExchangeRate(TransactionCurrency $from, TransactionCurrency $to, string $rate, Carbon $date): CurrencyExchangeRate
|
public function storeExchangeRate(TransactionCurrency $from, TransactionCurrency $to, string $rate, Carbon $date): CurrencyExchangeRate
|
||||||
{
|
{
|
||||||
$object = new CurrencyExchangeRate();
|
$object = new CurrencyExchangeRate();
|
||||||
@@ -100,7 +101,7 @@ class ExchangeRateRepository implements ExchangeRateRepositoryInterface, UserGro
|
|||||||
return $object;
|
return $object;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[\Override]
|
#[Override]
|
||||||
public function updateExchangeRate(CurrencyExchangeRate $object, string $rate, ?Carbon $date = null): CurrencyExchangeRate
|
public function updateExchangeRate(CurrencyExchangeRate $object, string $rate, ?Carbon $date = null): CurrencyExchangeRate
|
||||||
{
|
{
|
||||||
$object->rate = $rate;
|
$object->rate = $rate;
|
||||||
|
@@ -32,6 +32,7 @@ use FireflyIII\Support\Repositories\UserGroup\UserGroupInterface;
|
|||||||
use FireflyIII\Support\Repositories\UserGroup\UserGroupTrait;
|
use FireflyIII\Support\Repositories\UserGroup\UserGroupTrait;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use stdClass;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class JournalCLIRepository
|
* Class JournalCLIRepository
|
||||||
@@ -184,7 +185,7 @@ class JournalCLIRepository implements JournalCLIRepositoryInterface, UserGroupIn
|
|||||||
$result = $query->get(['transaction_journals.id as id', DB::raw('count(transactions.id) as transaction_count')]); // @phpstan-ignore-line
|
$result = $query->get(['transaction_journals.id as id', DB::raw('count(transactions.id) as transaction_count')]); // @phpstan-ignore-line
|
||||||
$journalIds = [];
|
$journalIds = [];
|
||||||
|
|
||||||
/** @var \stdClass $row */
|
/** @var stdClass $row */
|
||||||
foreach ($result as $row) {
|
foreach ($result as $row) {
|
||||||
if ((int) $row->transaction_count > 2) {
|
if ((int) $row->transaction_count > 2) {
|
||||||
$journalIds[] = (int) $row->id;
|
$journalIds[] = (int) $row->id;
|
||||||
|
@@ -31,6 +31,7 @@ use FireflyIII\Models\TransactionJournalLink;
|
|||||||
use FireflyIII\Support\Repositories\UserGroup\UserGroupInterface;
|
use FireflyIII\Support\Repositories\UserGroup\UserGroupInterface;
|
||||||
use FireflyIII\Support\Repositories\UserGroup\UserGroupTrait;
|
use FireflyIII\Support\Repositories\UserGroup\UserGroupTrait;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
|
use Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class LinkTypeRepository.
|
* Class LinkTypeRepository.
|
||||||
@@ -71,7 +72,7 @@ class LinkTypeRepository implements LinkTypeRepositoryInterface, UserGroupInterf
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @throws \Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function destroyLink(TransactionJournalLink $link): bool
|
public function destroyLink(TransactionJournalLink $link): bool
|
||||||
{
|
{
|
||||||
@@ -170,7 +171,7 @@ class LinkTypeRepository implements LinkTypeRepositoryInterface, UserGroupInterf
|
|||||||
/**
|
/**
|
||||||
* Store link between two journals.
|
* Store link between two journals.
|
||||||
*
|
*
|
||||||
* @throws \Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function storeLink(array $information, TransactionJournal $inward, TransactionJournal $outward): ?TransactionJournalLink
|
public function storeLink(array $information, TransactionJournal $inward, TransactionJournal $outward): ?TransactionJournalLink
|
||||||
{
|
{
|
||||||
@@ -237,7 +238,7 @@ class LinkTypeRepository implements LinkTypeRepositoryInterface, UserGroupInterf
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @throws \Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
private function setNoteText(TransactionJournalLink $link, string $text): void
|
private function setNoteText(TransactionJournalLink $link, string $text): void
|
||||||
{
|
{
|
||||||
@@ -279,7 +280,7 @@ class LinkTypeRepository implements LinkTypeRepositoryInterface, UserGroupInterf
|
|||||||
/**
|
/**
|
||||||
* Update an existing transaction journal link.
|
* Update an existing transaction journal link.
|
||||||
*
|
*
|
||||||
* @throws \Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function updateLink(TransactionJournalLink $journalLink, array $data): TransactionJournalLink
|
public function updateLink(TransactionJournalLink $journalLink, array $data): TransactionJournalLink
|
||||||
{
|
{
|
||||||
|
@@ -36,6 +36,7 @@ use FireflyIII\Models\TransactionJournal;
|
|||||||
use FireflyIII\Repositories\ObjectGroup\CreatesObjectGroups;
|
use FireflyIII\Repositories\ObjectGroup\CreatesObjectGroups;
|
||||||
use FireflyIII\Support\Http\Api\ExchangeRateConverter;
|
use FireflyIII\Support\Http\Api\ExchangeRateConverter;
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
|
use Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Trait ModifiesPiggyBanks
|
* Trait ModifiesPiggyBanks
|
||||||
@@ -142,7 +143,7 @@ trait ModifiesPiggyBanks
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @throws \Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function destroy(PiggyBank $piggyBank): bool
|
public function destroy(PiggyBank $piggyBank): bool
|
||||||
{
|
{
|
||||||
|
@@ -41,6 +41,7 @@ use FireflyIII\Support\Repositories\UserGroup\UserGroupTrait;
|
|||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
use Illuminate\Support\Facades\Storage;
|
use Illuminate\Support\Facades\Storage;
|
||||||
|
use Override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class PiggyBankRepository.
|
* Class PiggyBankRepository.
|
||||||
@@ -390,7 +391,7 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface, UserGroupInte
|
|||||||
return $balance;
|
return $balance;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[\Override]
|
#[Override]
|
||||||
public function purgeAll(): void
|
public function purgeAll(): void
|
||||||
{
|
{
|
||||||
PiggyBank::withTrashed()
|
PiggyBank::withTrashed()
|
||||||
@@ -407,7 +408,7 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface, UserGroupInte
|
|||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[\Override]
|
#[Override]
|
||||||
public function resetOrder(): void
|
public function resetOrder(): void
|
||||||
{
|
{
|
||||||
$factory = new PiggyBankFactory();
|
$factory = new PiggyBankFactory();
|
||||||
|
@@ -33,6 +33,7 @@ use FireflyIII\Support\Repositories\UserGroup\UserGroupInterface;
|
|||||||
use FireflyIII\Support\Repositories\UserGroup\UserGroupTrait;
|
use FireflyIII\Support\Repositories\UserGroup\UserGroupTrait;
|
||||||
use FireflyIII\Support\Search\OperatorQuerySearch;
|
use FireflyIII\Support\Search\OperatorQuerySearch;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
|
use Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class RuleRepository.
|
* Class RuleRepository.
|
||||||
@@ -42,7 +43,7 @@ class RuleRepository implements RuleRepositoryInterface, UserGroupInterface
|
|||||||
use UserGroupTrait;
|
use UserGroupTrait;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @throws \Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function destroy(Rule $rule): bool
|
public function destroy(Rule $rule): bool
|
||||||
{
|
{
|
||||||
|
@@ -32,6 +32,7 @@ use FireflyIII\Support\Repositories\UserGroup\UserGroupTrait;
|
|||||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
|
use Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class RuleGroupRepository.
|
* Class RuleGroupRepository.
|
||||||
@@ -72,7 +73,7 @@ class RuleGroupRepository implements RuleGroupRepositoryInterface, UserGroupInte
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @throws \Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function destroy(RuleGroup $ruleGroup, ?RuleGroup $moveTo): bool
|
public function destroy(RuleGroup $ruleGroup, ?RuleGroup $moveTo): bool
|
||||||
{
|
{
|
||||||
|
@@ -37,6 +37,7 @@ use Illuminate\Support\Collection;
|
|||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
use Illuminate\Support\Facades\Storage;
|
use Illuminate\Support\Facades\Storage;
|
||||||
|
use Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class TagRepository.
|
* Class TagRepository.
|
||||||
@@ -51,7 +52,7 @@ class TagRepository implements TagRepositoryInterface, UserGroupInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @throws \Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function destroy(Tag $tag): bool
|
public function destroy(Tag $tag): bool
|
||||||
{
|
{
|
||||||
|
@@ -48,6 +48,7 @@ use FireflyIII\Support\Repositories\UserGroup\UserGroupTrait;
|
|||||||
use Illuminate\Database\Eloquent\Builder;
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class TransactionGroupRepository
|
* Class TransactionGroupRepository
|
||||||
@@ -291,7 +292,7 @@ class TransactionGroupRepository implements TransactionGroupRepositoryInterface,
|
|||||||
/**
|
/**
|
||||||
* Return object with all found meta field things as Carbon objects.
|
* Return object with all found meta field things as Carbon objects.
|
||||||
*
|
*
|
||||||
* @throws \Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function getMetaDateFields(int $journalId, array $fields): NullArrayObject
|
public function getMetaDateFields(int $journalId, array $fields): NullArrayObject
|
||||||
{
|
{
|
||||||
|
@@ -34,6 +34,8 @@ use Illuminate\Contracts\Auth\Authenticatable;
|
|||||||
use Illuminate\Database\QueryException;
|
use Illuminate\Database\QueryException;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
|
use Exception;
|
||||||
|
use Override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class UserRepository.
|
* Class UserRepository.
|
||||||
@@ -44,7 +46,7 @@ class UserRepository implements UserRepositoryInterface
|
|||||||
* This updates the users email address and records some things so it can be confirmed or undone later.
|
* This updates the users email address and records some things so it can be confirmed or undone later.
|
||||||
* The user is blocked until the change is confirmed.
|
* The user is blocked until the change is confirmed.
|
||||||
*
|
*
|
||||||
* @throws \Exception
|
* @throws Exception
|
||||||
*
|
*
|
||||||
* @see updateEmail
|
* @see updateEmail
|
||||||
*/
|
*/
|
||||||
@@ -99,7 +101,7 @@ class UserRepository implements UserRepositoryInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @throws \Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function destroy(User $user): bool
|
public function destroy(User $user): bool
|
||||||
{
|
{
|
||||||
@@ -243,7 +245,7 @@ class UserRepository implements UserRepositoryInterface
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[\Override]
|
#[Override]
|
||||||
public function getUserGroups(User $user): Collection
|
public function getUserGroups(User $user): Collection
|
||||||
{
|
{
|
||||||
$memberships = $user->groupMemberships()->get();
|
$memberships = $user->groupMemberships()->get();
|
||||||
|
@@ -35,6 +35,8 @@ use FireflyIII\Support\Repositories\UserGroup\UserGroupInterface;
|
|||||||
use FireflyIII\Support\Repositories\UserGroup\UserGroupTrait;
|
use FireflyIII\Support\Repositories\UserGroup\UserGroupTrait;
|
||||||
use FireflyIII\User;
|
use FireflyIII\User;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
|
use Override;
|
||||||
|
use ValueError;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class UserGroupRepository
|
* Class UserGroupRepository
|
||||||
@@ -176,13 +178,13 @@ class UserGroupRepository implements UserGroupRepositoryInterface, UserGroupInte
|
|||||||
return UserGroup::all();
|
return UserGroup::all();
|
||||||
}
|
}
|
||||||
|
|
||||||
#[\Override]
|
#[Override]
|
||||||
public function getById(int $id): ?UserGroup
|
public function getById(int $id): ?UserGroup
|
||||||
{
|
{
|
||||||
return UserGroup::find($id);
|
return UserGroup::find($id);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[\Override]
|
#[Override]
|
||||||
public function getMembershipsFromGroupId(int $groupId): Collection
|
public function getMembershipsFromGroupId(int $groupId): Collection
|
||||||
{
|
{
|
||||||
return $this->user->groupMemberships()->where('user_group_id', $groupId)->get();
|
return $this->user->groupMemberships()->where('user_group_id', $groupId)->get();
|
||||||
@@ -286,7 +288,7 @@ class UserGroupRepository implements UserGroupRepositoryInterface, UserGroupInte
|
|||||||
foreach ($rolesSimplified as $role) {
|
foreach ($rolesSimplified as $role) {
|
||||||
try {
|
try {
|
||||||
$enum = UserRoleEnum::from($role);
|
$enum = UserRoleEnum::from($role);
|
||||||
} catch (\ValueError) {
|
} catch (ValueError) {
|
||||||
// TODO error message
|
// TODO error message
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -313,7 +315,7 @@ class UserGroupRepository implements UserGroupRepositoryInterface, UserGroupInte
|
|||||||
return $roles;
|
return $roles;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[\Override]
|
#[Override]
|
||||||
public function useUserGroup(UserGroup $userGroup): void
|
public function useUserGroup(UserGroup $userGroup): void
|
||||||
{
|
{
|
||||||
$this->user->user_group_id = $userGroup->id;
|
$this->user->user_group_id = $userGroup->id;
|
||||||
|
@@ -37,6 +37,8 @@ use FireflyIII\Support\Repositories\UserGroup\UserGroupTrait;
|
|||||||
use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
|
use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use Override;
|
||||||
|
use stdClass;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class AccountRepository
|
* Class AccountRepository
|
||||||
@@ -47,7 +49,7 @@ class AccountRepository implements AccountRepositoryInterface
|
|||||||
{
|
{
|
||||||
use UserGroupTrait;
|
use UserGroupTrait;
|
||||||
|
|
||||||
#[\Override]
|
#[Override]
|
||||||
public function countAccounts(array $types): int
|
public function countAccounts(array $types): int
|
||||||
{
|
{
|
||||||
$query = $this->userGroup->accounts();
|
$query = $this->userGroup->accounts();
|
||||||
@@ -120,7 +122,7 @@ class AccountRepository implements AccountRepositoryInterface
|
|||||||
return $account;
|
return $account;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[\Override]
|
#[Override]
|
||||||
public function getAccountBalances(Account $account): Collection
|
public function getAccountBalances(Account $account): Collection
|
||||||
{
|
{
|
||||||
return $account->accountBalances;
|
return $account->accountBalances;
|
||||||
@@ -172,7 +174,7 @@ class AccountRepository implements AccountRepositoryInterface
|
|||||||
return $account;
|
return $account;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[\Override]
|
#[Override]
|
||||||
public function getAccountTypes(Collection $accounts): Collection
|
public function getAccountTypes(Collection $accounts): Collection
|
||||||
{
|
{
|
||||||
return AccountType::leftJoin('accounts', 'accounts.account_type_id', '=', 'account_types.id')
|
return AccountType::leftJoin('accounts', 'accounts.account_type_id', '=', 'account_types.id')
|
||||||
@@ -195,7 +197,7 @@ class AccountRepository implements AccountRepositoryInterface
|
|||||||
return $query->get(['accounts.*']);
|
return $query->get(['accounts.*']);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[\Override]
|
#[Override]
|
||||||
public function getAccountsInOrder(array $types, array $sort, int $startRow, int $endRow): Collection
|
public function getAccountsInOrder(array $types, array $sort, int $startRow, int $endRow): Collection
|
||||||
{
|
{
|
||||||
$query = $this->userGroup->accounts();
|
$query = $this->userGroup->accounts();
|
||||||
@@ -235,7 +237,7 @@ class AccountRepository implements AccountRepositoryInterface
|
|||||||
return $query->get(['accounts.*']);
|
return $query->get(['accounts.*']);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[\Override]
|
#[Override]
|
||||||
public function getLastActivity(Collection $accounts): array
|
public function getLastActivity(Collection $accounts): array
|
||||||
{
|
{
|
||||||
return Transaction::whereIn('account_id', $accounts->pluck('id')->toArray())
|
return Transaction::whereIn('account_id', $accounts->pluck('id')->toArray())
|
||||||
@@ -245,7 +247,7 @@ class AccountRepository implements AccountRepositoryInterface
|
|||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[\Override]
|
#[Override]
|
||||||
public function getMetaValues(Collection $accounts, array $fields): Collection
|
public function getMetaValues(Collection $accounts, array $fields): Collection
|
||||||
{
|
{
|
||||||
$query = AccountMeta::whereIn('account_id', $accounts->pluck('id')->toArray());
|
$query = AccountMeta::whereIn('account_id', $accounts->pluck('id')->toArray());
|
||||||
@@ -256,7 +258,7 @@ class AccountRepository implements AccountRepositoryInterface
|
|||||||
return $query->get(['account_meta.id', 'account_meta.account_id', 'account_meta.name', 'account_meta.data']);
|
return $query->get(['account_meta.id', 'account_meta.account_id', 'account_meta.name', 'account_meta.data']);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[\Override]
|
#[Override]
|
||||||
public function getObjectGroups(Collection $accounts): array
|
public function getObjectGroups(Collection $accounts): array
|
||||||
{
|
{
|
||||||
$groupIds = [];
|
$groupIds = [];
|
||||||
@@ -265,14 +267,14 @@ class AccountRepository implements AccountRepositoryInterface
|
|||||||
->whereIn('object_groupable_id', $accounts->pluck('id')->toArray())->get()
|
->whereIn('object_groupable_id', $accounts->pluck('id')->toArray())->get()
|
||||||
;
|
;
|
||||||
|
|
||||||
/** @var \stdClass $row */
|
/** @var stdClass $row */
|
||||||
foreach ($set as $row) {
|
foreach ($set as $row) {
|
||||||
$groupIds[] = $row->object_group_id;
|
$groupIds[] = $row->object_group_id;
|
||||||
}
|
}
|
||||||
$groupIds = array_unique($groupIds);
|
$groupIds = array_unique($groupIds);
|
||||||
$groups = ObjectGroup::whereIn('id', $groupIds)->get();
|
$groups = ObjectGroup::whereIn('id', $groupIds)->get();
|
||||||
|
|
||||||
/** @var \stdClass $row */
|
/** @var stdClass $row */
|
||||||
foreach ($set as $row) {
|
foreach ($set as $row) {
|
||||||
if (!array_key_exists($row->object_groupable_id, $return)) {
|
if (!array_key_exists($row->object_groupable_id, $return)) {
|
||||||
/** @var null|ObjectGroup $group */
|
/** @var null|ObjectGroup $group */
|
||||||
@@ -368,7 +370,7 @@ class AccountRepository implements AccountRepositoryInterface
|
|||||||
return $query->get(['accounts.*']);
|
return $query->get(['accounts.*']);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[\Override]
|
#[Override]
|
||||||
public function update(Account $account, array $data): Account
|
public function update(Account $account, array $data): Account
|
||||||
{
|
{
|
||||||
/** @var AccountUpdateService $service */
|
/** @var AccountUpdateService $service */
|
||||||
|
@@ -30,6 +30,7 @@ use FireflyIII\Models\TransactionCurrency;
|
|||||||
use FireflyIII\Support\Repositories\UserGroup\UserGroupTrait;
|
use FireflyIII\Support\Repositories\UserGroup\UserGroupTrait;
|
||||||
use Illuminate\Database\Eloquent\Builder;
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
|
use Override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class ExchangeRateRepository
|
* Class ExchangeRateRepository
|
||||||
@@ -40,19 +41,19 @@ class ExchangeRateRepository implements ExchangeRateRepositoryInterface
|
|||||||
{
|
{
|
||||||
use UserGroupTrait;
|
use UserGroupTrait;
|
||||||
|
|
||||||
#[\Override]
|
#[Override]
|
||||||
public function deleteRate(CurrencyExchangeRate $rate): void
|
public function deleteRate(CurrencyExchangeRate $rate): void
|
||||||
{
|
{
|
||||||
$this->userGroup->currencyExchangeRates()->where('id', $rate->id)->delete();
|
$this->userGroup->currencyExchangeRates()->where('id', $rate->id)->delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
#[\Override]
|
#[Override]
|
||||||
public function getAll(): Collection
|
public function getAll(): Collection
|
||||||
{
|
{
|
||||||
return $this->userGroup->currencyExchangeRates()->orderBy('date', 'ASC')->get();
|
return $this->userGroup->currencyExchangeRates()->orderBy('date', 'ASC')->get();
|
||||||
}
|
}
|
||||||
|
|
||||||
#[\Override]
|
#[Override]
|
||||||
public function getRates(TransactionCurrency $from, TransactionCurrency $to): Collection
|
public function getRates(TransactionCurrency $from, TransactionCurrency $to): Collection
|
||||||
{
|
{
|
||||||
// orderBy('date', 'DESC')->toRawSql();
|
// orderBy('date', 'DESC')->toRawSql();
|
||||||
@@ -75,7 +76,7 @@ class ExchangeRateRepository implements ExchangeRateRepositoryInterface
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[\Override]
|
#[Override]
|
||||||
public function getSpecificRateOnDate(TransactionCurrency $from, TransactionCurrency $to, Carbon $date): ?CurrencyExchangeRate
|
public function getSpecificRateOnDate(TransactionCurrency $from, TransactionCurrency $to, Carbon $date): ?CurrencyExchangeRate
|
||||||
{
|
{
|
||||||
/** @var null|CurrencyExchangeRate */
|
/** @var null|CurrencyExchangeRate */
|
||||||
@@ -88,7 +89,7 @@ class ExchangeRateRepository implements ExchangeRateRepositoryInterface
|
|||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[\Override]
|
#[Override]
|
||||||
public function storeExchangeRate(TransactionCurrency $from, TransactionCurrency $to, string $rate, Carbon $date): CurrencyExchangeRate
|
public function storeExchangeRate(TransactionCurrency $from, TransactionCurrency $to, string $rate, Carbon $date): CurrencyExchangeRate
|
||||||
{
|
{
|
||||||
$object = new CurrencyExchangeRate();
|
$object = new CurrencyExchangeRate();
|
||||||
@@ -104,7 +105,7 @@ class ExchangeRateRepository implements ExchangeRateRepositoryInterface
|
|||||||
return $object;
|
return $object;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[\Override]
|
#[Override]
|
||||||
public function updateExchangeRate(CurrencyExchangeRate $object, string $rate, ?Carbon $date = null): CurrencyExchangeRate
|
public function updateExchangeRate(CurrencyExchangeRate $object, string $rate, ?Carbon $date = null): CurrencyExchangeRate
|
||||||
{
|
{
|
||||||
$object->rate = $rate;
|
$object->rate = $rate;
|
||||||
|
@@ -26,13 +26,15 @@ namespace FireflyIII\Rules\Account;
|
|||||||
|
|
||||||
use FireflyIII\Support\Http\Api\AccountFilter;
|
use FireflyIII\Support\Http\Api\AccountFilter;
|
||||||
use Illuminate\Contracts\Validation\ValidationRule;
|
use Illuminate\Contracts\Validation\ValidationRule;
|
||||||
|
use Closure;
|
||||||
|
use Override;
|
||||||
|
|
||||||
class IsValidAccountType implements ValidationRule
|
class IsValidAccountType implements ValidationRule
|
||||||
{
|
{
|
||||||
use AccountFilter;
|
use AccountFilter;
|
||||||
|
|
||||||
#[\Override]
|
#[Override]
|
||||||
public function validate(string $attribute, mixed $value, \Closure $fail): void
|
public function validate(string $attribute, mixed $value, Closure $fail): void
|
||||||
{
|
{
|
||||||
// only check the type.
|
// only check the type.
|
||||||
if (array_key_exists('type', $value)) {
|
if (array_key_exists('type', $value)) {
|
||||||
|
@@ -28,6 +28,7 @@ namespace FireflyIII\Rules\Admin;
|
|||||||
use FireflyIII\Support\Validation\ValidatesAmountsTrait;
|
use FireflyIII\Support\Validation\ValidatesAmountsTrait;
|
||||||
use Illuminate\Contracts\Validation\ValidationRule;
|
use Illuminate\Contracts\Validation\ValidationRule;
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
|
use Closure;
|
||||||
|
|
||||||
class IsValidDiscordUrl implements ValidationRule
|
class IsValidDiscordUrl implements ValidationRule
|
||||||
{
|
{
|
||||||
@@ -36,7 +37,7 @@ class IsValidDiscordUrl implements ValidationRule
|
|||||||
/**
|
/**
|
||||||
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
|
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
|
||||||
*/
|
*/
|
||||||
public function validate(string $attribute, mixed $value, \Closure $fail): void
|
public function validate(string $attribute, mixed $value, Closure $fail): void
|
||||||
{
|
{
|
||||||
$value = (string) $value;
|
$value = (string) $value;
|
||||||
if ('' === $value) {
|
if ('' === $value) {
|
||||||
|
@@ -28,6 +28,7 @@ namespace FireflyIII\Rules\Admin;
|
|||||||
use FireflyIII\Support\Validation\ValidatesAmountsTrait;
|
use FireflyIII\Support\Validation\ValidatesAmountsTrait;
|
||||||
use Illuminate\Contracts\Validation\ValidationRule;
|
use Illuminate\Contracts\Validation\ValidationRule;
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
|
use Closure;
|
||||||
|
|
||||||
class IsValidSlackOrDiscordUrl implements ValidationRule
|
class IsValidSlackOrDiscordUrl implements ValidationRule
|
||||||
{
|
{
|
||||||
@@ -36,7 +37,7 @@ class IsValidSlackOrDiscordUrl implements ValidationRule
|
|||||||
/**
|
/**
|
||||||
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
|
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
|
||||||
*/
|
*/
|
||||||
public function validate(string $attribute, mixed $value, \Closure $fail): void
|
public function validate(string $attribute, mixed $value, Closure $fail): void
|
||||||
{
|
{
|
||||||
$value = (string) $value;
|
$value = (string) $value;
|
||||||
if ('' === $value) {
|
if ('' === $value) {
|
||||||
|
@@ -28,6 +28,7 @@ namespace FireflyIII\Rules\Admin;
|
|||||||
use FireflyIII\Support\Validation\ValidatesAmountsTrait;
|
use FireflyIII\Support\Validation\ValidatesAmountsTrait;
|
||||||
use Illuminate\Contracts\Validation\ValidationRule;
|
use Illuminate\Contracts\Validation\ValidationRule;
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
|
use Closure;
|
||||||
|
|
||||||
class IsValidSlackUrl implements ValidationRule
|
class IsValidSlackUrl implements ValidationRule
|
||||||
{
|
{
|
||||||
@@ -36,7 +37,7 @@ class IsValidSlackUrl implements ValidationRule
|
|||||||
/**
|
/**
|
||||||
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
|
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
|
||||||
*/
|
*/
|
||||||
public function validate(string $attribute, mixed $value, \Closure $fail): void
|
public function validate(string $attribute, mixed $value, Closure $fail): void
|
||||||
{
|
{
|
||||||
$value = (string) $value;
|
$value = (string) $value;
|
||||||
if ('' === $value) {
|
if ('' === $value) {
|
||||||
|
@@ -32,13 +32,14 @@ use FireflyIII\Models\Category;
|
|||||||
use FireflyIII\Models\PiggyBank;
|
use FireflyIII\Models\PiggyBank;
|
||||||
use FireflyIII\Models\TransactionJournal;
|
use FireflyIII\Models\TransactionJournal;
|
||||||
use Illuminate\Contracts\Validation\ValidationRule;
|
use Illuminate\Contracts\Validation\ValidationRule;
|
||||||
|
use Closure;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class BelongsUser
|
* Class BelongsUser
|
||||||
*/
|
*/
|
||||||
class BelongsUser implements ValidationRule
|
class BelongsUser implements ValidationRule
|
||||||
{
|
{
|
||||||
public function validate(string $attribute, mixed $value, \Closure $fail): void
|
public function validate(string $attribute, mixed $value, Closure $fail): void
|
||||||
{
|
{
|
||||||
$attribute = $this->parseAttribute($attribute);
|
$attribute = $this->parseAttribute($attribute);
|
||||||
if (!auth()->check()) {
|
if (!auth()->check()) {
|
||||||
|
@@ -33,6 +33,7 @@ use FireflyIII\Models\PiggyBank;
|
|||||||
use FireflyIII\Models\TransactionJournal;
|
use FireflyIII\Models\TransactionJournal;
|
||||||
use FireflyIII\Models\UserGroup;
|
use FireflyIII\Models\UserGroup;
|
||||||
use Illuminate\Contracts\Validation\ValidationRule;
|
use Illuminate\Contracts\Validation\ValidationRule;
|
||||||
|
use Closure;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class BelongsUserGroup
|
* Class BelongsUserGroup
|
||||||
@@ -47,7 +48,7 @@ class BelongsUserGroup implements ValidationRule
|
|||||||
*/
|
*/
|
||||||
public function __construct(private readonly UserGroup $userGroup) {}
|
public function __construct(private readonly UserGroup $userGroup) {}
|
||||||
|
|
||||||
public function validate(string $attribute, mixed $value, \Closure $fail): void
|
public function validate(string $attribute, mixed $value, Closure $fail): void
|
||||||
{
|
{
|
||||||
$attribute = $this->parseAttribute($attribute);
|
$attribute = $this->parseAttribute($attribute);
|
||||||
if (!auth()->check()) {
|
if (!auth()->check()) {
|
||||||
|
@@ -31,6 +31,8 @@ use FireflyIII\User;
|
|||||||
use Illuminate\Auth\Access\AuthorizationException;
|
use Illuminate\Auth\Access\AuthorizationException;
|
||||||
use Illuminate\Contracts\Validation\ValidationRule;
|
use Illuminate\Contracts\Validation\ValidationRule;
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
|
use Closure;
|
||||||
|
use Override;
|
||||||
|
|
||||||
class IsAllowedGroupAction implements ValidationRule
|
class IsAllowedGroupAction implements ValidationRule
|
||||||
{
|
{
|
||||||
@@ -47,8 +49,8 @@ class IsAllowedGroupAction implements ValidationRule
|
|||||||
/**
|
/**
|
||||||
* @throws AuthorizationException
|
* @throws AuthorizationException
|
||||||
*/
|
*/
|
||||||
#[\Override]
|
#[Override]
|
||||||
public function validate(string $attribute, mixed $value, \Closure $fail): void
|
public function validate(string $attribute, mixed $value, Closure $fail): void
|
||||||
{
|
{
|
||||||
if ('GET' === $this->methodName) {
|
if ('GET' === $this->methodName) {
|
||||||
// need at least "read only rights".
|
// need at least "read only rights".
|
||||||
@@ -69,7 +71,7 @@ class IsAllowedGroupAction implements ValidationRule
|
|||||||
$this->validateUserGroup((int) $value, $fail);
|
$this->validateUserGroup((int) $value, $fail);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function validateUserGroup(int $userGroupId, \Closure $fail): void
|
private function validateUserGroup(int $userGroupId, Closure $fail): void
|
||||||
{
|
{
|
||||||
Log::debug(sprintf('validateUserGroup: %s', static::class));
|
Log::debug(sprintf('validateUserGroup: %s', static::class));
|
||||||
if (!auth()->check()) {
|
if (!auth()->check()) {
|
||||||
|
@@ -26,6 +26,7 @@ namespace FireflyIII\Rules;
|
|||||||
use FireflyIII\Enums\AccountTypeEnum;
|
use FireflyIII\Enums\AccountTypeEnum;
|
||||||
use FireflyIII\Models\Account;
|
use FireflyIII\Models\Account;
|
||||||
use Illuminate\Contracts\Validation\ValidationRule;
|
use Illuminate\Contracts\Validation\ValidationRule;
|
||||||
|
use Closure;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class IsAssetAccountId
|
* Class IsAssetAccountId
|
||||||
@@ -35,7 +36,7 @@ class IsAssetAccountId implements ValidationRule
|
|||||||
/**
|
/**
|
||||||
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
|
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
|
||||||
*/
|
*/
|
||||||
public function validate(string $attribute, mixed $value, \Closure $fail): void
|
public function validate(string $attribute, mixed $value, Closure $fail): void
|
||||||
{
|
{
|
||||||
$accountId = (int) $value;
|
$accountId = (int) $value;
|
||||||
|
|
||||||
|
@@ -25,6 +25,7 @@ declare(strict_types=1);
|
|||||||
namespace FireflyIII\Rules;
|
namespace FireflyIII\Rules;
|
||||||
|
|
||||||
use Illuminate\Contracts\Validation\ValidationRule;
|
use Illuminate\Contracts\Validation\ValidationRule;
|
||||||
|
use Closure;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class IsBoolean
|
* Class IsBoolean
|
||||||
@@ -34,7 +35,7 @@ class IsBoolean implements ValidationRule
|
|||||||
/**
|
/**
|
||||||
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
|
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
|
||||||
*/
|
*/
|
||||||
public function validate(string $attribute, mixed $value, \Closure $fail): void
|
public function validate(string $attribute, mixed $value, Closure $fail): void
|
||||||
{
|
{
|
||||||
if (is_bool($value)) {
|
if (is_bool($value)) {
|
||||||
return;
|
return;
|
||||||
|
@@ -28,6 +28,7 @@ use Carbon\Carbon;
|
|||||||
use Carbon\Exceptions\InvalidDateException;
|
use Carbon\Exceptions\InvalidDateException;
|
||||||
use Carbon\Exceptions\InvalidFormatException;
|
use Carbon\Exceptions\InvalidFormatException;
|
||||||
use Illuminate\Contracts\Validation\ValidationRule;
|
use Illuminate\Contracts\Validation\ValidationRule;
|
||||||
|
use Closure;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class IsDateOrTime
|
* Class IsDateOrTime
|
||||||
@@ -37,7 +38,7 @@ class IsDateOrTime implements ValidationRule
|
|||||||
/**
|
/**
|
||||||
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
|
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
|
||||||
*/
|
*/
|
||||||
public function validate(string $attribute, mixed $value, \Closure $fail): void
|
public function validate(string $attribute, mixed $value, Closure $fail): void
|
||||||
{
|
{
|
||||||
$value = (string) $value;
|
$value = (string) $value;
|
||||||
if ('' === $value) {
|
if ('' === $value) {
|
||||||
|
@@ -28,6 +28,7 @@ use FireflyIII\Models\UserGroup;
|
|||||||
use FireflyIII\Repositories\User\UserRepositoryInterface;
|
use FireflyIII\Repositories\User\UserRepositoryInterface;
|
||||||
use FireflyIII\User;
|
use FireflyIII\User;
|
||||||
use Illuminate\Contracts\Validation\ValidationRule;
|
use Illuminate\Contracts\Validation\ValidationRule;
|
||||||
|
use Closure;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class IsDefaultUserGroupName
|
* Class IsDefaultUserGroupName
|
||||||
@@ -39,7 +40,7 @@ class IsDefaultUserGroupName implements ValidationRule
|
|||||||
/**
|
/**
|
||||||
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
|
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
|
||||||
*/
|
*/
|
||||||
public function validate(string $attribute, mixed $value, \Closure $fail): void
|
public function validate(string $attribute, mixed $value, Closure $fail): void
|
||||||
{
|
{
|
||||||
app('log')->debug(sprintf('Now in %s(%s)', __METHOD__, $value));
|
app('log')->debug(sprintf('Now in %s(%s)', __METHOD__, $value));
|
||||||
|
|
||||||
|
@@ -25,6 +25,7 @@ declare(strict_types=1);
|
|||||||
namespace FireflyIII\Rules;
|
namespace FireflyIII\Rules;
|
||||||
|
|
||||||
use Illuminate\Contracts\Validation\ValidationRule;
|
use Illuminate\Contracts\Validation\ValidationRule;
|
||||||
|
use Closure;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO not sure where this is used.
|
* TODO not sure where this is used.
|
||||||
@@ -38,7 +39,7 @@ class IsDuplicateTransaction implements ValidationRule
|
|||||||
/**
|
/**
|
||||||
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
|
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
|
||||||
*/
|
*/
|
||||||
public function validate(string $attribute, mixed $value, \Closure $fail): void
|
public function validate(string $attribute, mixed $value, Closure $fail): void
|
||||||
{
|
{
|
||||||
$this->value = $value;
|
$this->value = $value;
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user