mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-25 13:10:35 +00:00
Clean up code.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -47,7 +47,7 @@ class CategoryUpdateService
|
||||
{
|
||||
if (auth()->check()) {
|
||||
/** @var User $user */
|
||||
$user = auth()->user();
|
||||
$user = auth()->user();
|
||||
$this->user = $user;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user