mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-04 11:48:05 +00:00
Refactor findNull to find
This commit is contained in:
@@ -38,8 +38,8 @@ class AccountController extends Controller
|
||||
public function moveTransactions(MoveTransactionsRequest $request): JsonResponse
|
||||
{
|
||||
$accountIds = $request->getAll();
|
||||
$original = $this->repository->findNull($accountIds['original_account']);
|
||||
$destination = $this->repository->findNull($accountIds['destination_account']);
|
||||
$original = $this->repository->find($accountIds['original_account']);
|
||||
$destination = $this->repository->find($accountIds['destination_account']);
|
||||
|
||||
/** @var AccountDestroyService $service */
|
||||
$service = app(AccountDestroyService::class);
|
||||
|
@@ -38,7 +38,7 @@ use Illuminate\Http\JsonResponse;
|
||||
*
|
||||
* Shows income information grouped or limited by date.
|
||||
* Ie. all income grouped by account + currency.
|
||||
* See reference nr. 75
|
||||
* See reference nr. 75
|
||||
*/
|
||||
class AccountController extends Controller
|
||||
{
|
||||
@@ -74,8 +74,9 @@ class AccountController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* See reference nr. 76
|
||||
* See reference nr. 77
|
||||
* See reference nr. 76
|
||||
* See reference nr. 77
|
||||
*
|
||||
* @param GenericRequest $request
|
||||
*
|
||||
* @return JsonResponse
|
||||
@@ -103,7 +104,7 @@ class AccountController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* See reference nr. 78
|
||||
* See reference nr. 78
|
||||
*
|
||||
* @param GenericRequest $request
|
||||
*
|
||||
|
@@ -78,8 +78,8 @@ class StoreController extends Controller
|
||||
{
|
||||
$manager = $this->getManager();
|
||||
$data = $request->getAll();
|
||||
$inward = $this->journalRepository->findNull($data['inward_id'] ?? 0);
|
||||
$outward = $this->journalRepository->findNull($data['outward_id'] ?? 0);
|
||||
$inward = $this->journalRepository->find($data['inward_id'] ?? 0);
|
||||
$outward = $this->journalRepository->find($data['outward_id'] ?? 0);
|
||||
if (null === $inward || null === $outward) {
|
||||
throw new FireflyException('200024: Source or destination does not exist.');
|
||||
}
|
||||
|
@@ -175,7 +175,7 @@ class BasicController extends Controller
|
||||
// format amounts:
|
||||
$keys = array_keys($sums);
|
||||
foreach ($keys as $currencyId) {
|
||||
$currency = $this->currencyRepos->findNull($currencyId);
|
||||
$currency = $this->currencyRepos->find($currencyId);
|
||||
if (null === $currency) {
|
||||
continue;
|
||||
}
|
||||
@@ -239,7 +239,7 @@ class BasicController extends Controller
|
||||
$return = [];
|
||||
foreach ($paidAmount as $currencyId => $amount) {
|
||||
$amount = bcmul($amount, '-1');
|
||||
$currency = $this->currencyRepos->findNull((int)$currencyId);
|
||||
$currency = $this->currencyRepos->find((int)$currencyId);
|
||||
if (null === $currency) {
|
||||
continue;
|
||||
}
|
||||
@@ -259,7 +259,7 @@ class BasicController extends Controller
|
||||
|
||||
foreach ($unpaidAmount as $currencyId => $amount) {
|
||||
$amount = bcmul($amount, '-1');
|
||||
$currency = $this->currencyRepos->findNull((int)$currencyId);
|
||||
$currency = $this->currencyRepos->find((int)$currencyId);
|
||||
if (null === $currency) {
|
||||
continue;
|
||||
}
|
||||
|
Reference in New Issue
Block a user