Clean up code.

This commit is contained in:
James Cole
2023-12-10 06:51:59 +01:00
parent c2b22a2bac
commit 46e130fdfe
195 changed files with 973 additions and 984 deletions

View File

@@ -693,11 +693,11 @@ trait AccountServiceTrait
protected function createOBGroupV2(Account $account, string $openingBalance, Carbon $openingBalanceDate): TransactionGroup
{
app('log')->debug('Now going to create an OB group.');
$language = app('preferences')->getForUser($account->user, 'language', 'en_US')->data;
$language = app('preferences')->getForUser($account->user, 'language', 'en_US')->data;
if (is_array($language)) {
$language = 'en_US';
}
$language= (string)$language;
$language = (string)$language;
$sourceId = null;
$sourceName = null;
$destId = null;

View File

@@ -338,7 +338,7 @@ class AccountUpdateService
return;
}
$array = $preference->data;
if(!is_array($array)) {
if (!is_array($array)) {
$array = [$array];
}
app('log')->debug('Old array is: ', $array);

View File

@@ -47,7 +47,7 @@ class CategoryUpdateService
{
if (auth()->check()) {
/** @var User $user */
$user = auth()->user();
$user = auth()->user();
$this->user = $user;
}
}

View File

@@ -135,7 +135,8 @@ class GroupUpdateService
TransactionGroup $transactionGroup,
TransactionJournal $journal,
array $data
): void {
): void
{
app('log')->debug(sprintf('Now in %s', __METHOD__));
if (0 === count($data)) {
return;

View File

@@ -497,9 +497,9 @@ class JournalUpdateService
{
$type = $this->transactionJournal->transactionType->type;
if ((
array_key_exists('bill_id', $this->data)
array_key_exists('bill_id', $this->data)
|| array_key_exists('bill_name', $this->data)
)
)
&& TransactionType::WITHDRAWAL === $type
) {
$billId = (int)($this->data['bill_id'] ?? 0);