Various code cleanup.

This commit is contained in:
James Cole
2023-11-04 17:41:28 +01:00
parent 1059da8a2a
commit fe0a205a05
7 changed files with 37 additions and 13 deletions

View File

@@ -76,7 +76,7 @@ class TransactionController extends Controller
// this deserves better code, but for now a loop of basic if-statements
// to respond to what is in the $query.
// this is OK because only one thing can be in the query at the moment.
if ($this->updatesTransactionAccount($params)) {
if ($this->isUpdateTransactionAccount($params)) {
$original = $this->repository->find((int)$params['where']['account_id']);
$destination = $this->repository->find((int)$params['update']['account_id']);
@@ -93,7 +93,7 @@ class TransactionController extends Controller
*
* @return bool
*/
private function updatesTransactionAccount(array $params): bool
private function isUpdateTransactionAccount(array $params): bool
{
return array_key_exists('account_id', $params['where']) && array_key_exists('account_id', $params['update']);
}