mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-25 13:10:35 +00:00
Fix various phpstan issues.
This commit is contained in:
@@ -123,10 +123,15 @@ class UpdateRequest implements UpdateRequestInterface
|
||||
}
|
||||
|
||||
// parse response a bit. No message yet.
|
||||
$response = $json['firefly_iii'][$channel];
|
||||
$response = $json['firefly_iii'][$channel];
|
||||
$date = Carbon::createFromFormat('Y-m-d', $response['date']);
|
||||
if (false === $date) {
|
||||
$date = today(config('app.timezone'));
|
||||
}
|
||||
$return['version'] = $response['version'];
|
||||
$return['level'] = 'success';
|
||||
$return['date'] = Carbon::createFromFormat('Y-m-d', $response['date'])->startOfDay();
|
||||
$return['date'] = $date->startOfDay();
|
||||
|
||||
app('log')->info('Response from update server', $response);
|
||||
|
||||
return $return;
|
||||
|
||||
@@ -118,7 +118,7 @@ class AccountDestroyService
|
||||
|
||||
$collection = Transaction::groupBy('transaction_journal_id', 'account_id')
|
||||
->where('account_id', $moveTo->id)
|
||||
->get(['transaction_journal_id', 'account_id', DB::raw('count(*) as the_count')]);
|
||||
->get(['transaction_journal_id', 'account_id', DB::raw('count(*) as the_count')]); // @phpstan-ignore-line
|
||||
if (0 === $collection->count()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -224,7 +224,11 @@ trait AccountServiceTrait
|
||||
protected function createOBGroup(Account $account, array $data): 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;
|
||||
$sourceId = null;
|
||||
$sourceName = null;
|
||||
$destId = null;
|
||||
@@ -478,6 +482,10 @@ trait AccountServiceTrait
|
||||
}
|
||||
|
||||
$language = app('preferences')->getForUser($account->user, 'language', 'en_US')->data;
|
||||
if (is_array($language)) {
|
||||
$language = 'en_US';
|
||||
}
|
||||
$language = (string)$language;
|
||||
|
||||
// set source and/or destination based on whether the amount is positive or negative.
|
||||
// first, assume the amount is positive and go from there:
|
||||
@@ -686,6 +694,10 @@ trait AccountServiceTrait
|
||||
{
|
||||
app('log')->debug('Now going to create an OB group.');
|
||||
$language = app('preferences')->getForUser($account->user, 'language', 'en_US')->data;
|
||||
if (is_array($language)) {
|
||||
$language = 'en_US';
|
||||
}
|
||||
$language= (string)$language;
|
||||
$sourceId = null;
|
||||
$sourceName = null;
|
||||
$destId = null;
|
||||
|
||||
@@ -338,6 +338,9 @@ class AccountUpdateService
|
||||
return;
|
||||
}
|
||||
$array = $preference->data;
|
||||
if(!is_array($array)) {
|
||||
$array = [$array];
|
||||
}
|
||||
app('log')->debug('Old array is: ', $array);
|
||||
app('log')->debug(sprintf('Must remove : %d', $account->id));
|
||||
$removeAccountId = $account->id;
|
||||
|
||||
Reference in New Issue
Block a user