Various code cleanup [skip ci]

This commit is contained in:
James Cole
2018-03-10 22:38:20 +01:00
parent a55d18709c
commit aad0864018
59 changed files with 118 additions and 120 deletions

View File

@@ -63,7 +63,7 @@ class AccountDestroyService
try {
$account->delete();
} catch (Exception $e) { // @codeCoverageIgnore
Log::error(sprintf('Could not delete account: %s',$e->getMessage())); // @codeCoverageIgnore
Log::error(sprintf('Could not delete account: %s', $e->getMessage())); // @codeCoverageIgnore
}
return true;

View File

@@ -26,6 +26,7 @@ namespace FireflyIII\Services\Internal\Destroy;
use Exception;
use FireflyIII\Models\Bill;
use Log;
/**
* @codeCoverageIgnore
* Class BillDestroyService
@@ -40,7 +41,7 @@ class BillDestroyService
try {
$bill->delete();
} catch (Exception $e) { // @codeCoverageIgnore
Log::error(sprintf('Could not delete bill: %s',$e->getMessage())); // @codeCoverageIgnore
Log::error(sprintf('Could not delete bill: %s', $e->getMessage())); // @codeCoverageIgnore
}
}

View File

@@ -56,7 +56,7 @@ class JournalDestroyService
}
$journal->delete();
} catch (Exception $e) {
Log::error(sprintf('Could not delete bill: %s',$e->getMessage())); // @codeCoverageIgnore
Log::error(sprintf('Could not delete bill: %s', $e->getMessage())); // @codeCoverageIgnore
}
return;

View File

@@ -23,7 +23,6 @@ declare(strict_types=1);
namespace FireflyIII\Services\Internal\Support;
use Exception;
use FireflyIII\Factory\AccountFactory;
use FireflyIII\Factory\AccountMetaFactory;
use FireflyIII\Factory\TransactionFactory;
@@ -255,6 +254,7 @@ trait AccountServiceTrait
return true;
}
return true; // @codeCoverageIgnore
}

View File

@@ -22,6 +22,7 @@
declare(strict_types=1);
namespace FireflyIII\Services\Internal\Support;
use FireflyIII\Models\Bill;
use FireflyIII\Models\Note;

View File

@@ -217,6 +217,7 @@ trait TransactionServiceTrait
{
if (is_null($budget)) {
$transaction->budgets()->sync([]);
return;
}
$transaction->budgets()->sync([$budget->id]);
@@ -233,6 +234,7 @@ trait TransactionServiceTrait
{
if (is_null($category)) {
$transaction->categories()->sync([]);
return;
}
$transaction->categories()->sync([$category->id]);
@@ -260,6 +262,7 @@ trait TransactionServiceTrait
if (is_null($currency)) {
$transaction->foreign_currency_id = null;
$transaction->save();
return;
}
$transaction->foreign_currency_id = $currency->id;

View File

@@ -23,14 +23,8 @@ declare(strict_types=1);
namespace FireflyIII\Services\Internal\Update;
use Exception;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Factory\AccountMetaFactory;
use FireflyIII\Models\Account;
use FireflyIII\Models\AccountMeta;
use FireflyIII\Models\AccountType;
use FireflyIII\Services\Internal\Support\AccountServiceTrait;
use Log;
/**
* Class AccountUpdateService
@@ -40,7 +34,6 @@ class AccountUpdateService
use AccountServiceTrait;
/**
* Update account data.
*