mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Import statements and update configuration.
This commit is contained in:
@@ -42,6 +42,7 @@ use FireflyIII\Support\Facades\Amount;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use ValueError;
|
||||
|
||||
class CorrectsAmounts extends Command
|
||||
{
|
||||
@@ -234,7 +235,7 @@ class CorrectsAmounts extends Command
|
||||
{
|
||||
try {
|
||||
$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));
|
||||
$item->rule->active = false;
|
||||
$item->rule->save();
|
||||
|
@@ -34,6 +34,8 @@ use FireflyIII\Support\Models\AccountBalanceCalculator;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use ValueError;
|
||||
use stdClass;
|
||||
|
||||
class CorrectsUnevenAmount extends Command
|
||||
{
|
||||
@@ -135,7 +137,7 @@ class CorrectsUnevenAmount extends Command
|
||||
->get(['transaction_journal_id', DB::raw('SUM(amount) AS the_sum')])
|
||||
;
|
||||
|
||||
/** @var \stdClass $entry */
|
||||
/** @var stdClass $entry */
|
||||
foreach ($journals as $entry) {
|
||||
$sum = (string) $entry->the_sum;
|
||||
if (!is_numeric($sum)
|
||||
@@ -157,7 +159,7 @@ class CorrectsUnevenAmount extends Command
|
||||
|
||||
try {
|
||||
$res = bccomp($sum, '0');
|
||||
} catch (\ValueError $e) {
|
||||
} catch (ValueError $e) {
|
||||
$this->friendlyError(sprintf('Could not bccomp("%s", "0").', $sum));
|
||||
Log::error($e->getMessage());
|
||||
Log::error($e->getTraceAsString());
|
||||
|
@@ -28,6 +28,7 @@ use FireflyIII\Console\Commands\ShowsFriendlyMessages;
|
||||
use FireflyIII\Repositories\User\UserRepositoryInterface;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Console\Command;
|
||||
use Exception;
|
||||
|
||||
class CreatesAccessTokens extends Command
|
||||
{
|
||||
@@ -40,7 +41,7 @@ class CreatesAccessTokens extends Command
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @throws \Exception
|
||||
* @throws Exception
|
||||
*/
|
||||
public function handle(): int
|
||||
{
|
||||
|
@@ -27,6 +27,7 @@ namespace FireflyIII\Console\Commands\Correction;
|
||||
use FireflyIII\Console\Commands\ShowsFriendlyMessages;
|
||||
use FireflyIII\Models\TransactionGroup;
|
||||
use Illuminate\Console\Command;
|
||||
use Exception;
|
||||
|
||||
class RemovesEmptyGroups extends Command
|
||||
{
|
||||
@@ -38,7 +39,7 @@ class RemovesEmptyGroups extends Command
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @throws \Exception
|
||||
* @throws Exception
|
||||
*/
|
||||
public function handle(): int
|
||||
{
|
||||
|
@@ -28,6 +28,8 @@ use FireflyIII\Console\Commands\ShowsFriendlyMessages;
|
||||
use FireflyIII\Models\Transaction;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use Illuminate\Console\Command;
|
||||
use Exception;
|
||||
use stdClass;
|
||||
|
||||
/**
|
||||
* Deletes transactions where the journal has been deleted.
|
||||
@@ -43,7 +45,7 @@ class RemovesOrphanedTransactions extends Command
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @throws \Exception
|
||||
* @throws Exception
|
||||
*/
|
||||
public function handle(): int
|
||||
{
|
||||
@@ -85,7 +87,7 @@ class RemovesOrphanedTransactions extends Command
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws \Exception
|
||||
* @throws Exception
|
||||
*/
|
||||
private function deleteOrphanedTransactions(): void
|
||||
{
|
||||
@@ -102,7 +104,7 @@ class RemovesOrphanedTransactions extends Command
|
||||
)
|
||||
;
|
||||
|
||||
/** @var \stdClass $entry */
|
||||
/** @var stdClass $entry */
|
||||
foreach ($set as $entry) {
|
||||
$transaction = Transaction::find((int) $entry->transaction_id);
|
||||
if (null !== $transaction) {
|
||||
|
Reference in New Issue
Block a user