mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-11 17:39:41 +00:00
Fix phpstan level 3!
This commit is contained in:
@@ -55,23 +55,9 @@ class ConvertsDatesToUTC extends Command
|
||||
{
|
||||
use ShowsFriendlyMessages;
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Convert stored dates to UTC.';
|
||||
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'correction:convert-to-utc';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*/
|
||||
public function handle(): int
|
||||
{
|
||||
$this->friendlyWarning('Please do not use this command right now.');
|
||||
|
||||
@@ -67,7 +67,7 @@ class CorrectsOpeningBalanceCurrencies extends Command
|
||||
|
||||
private function getJournals(): Collection
|
||||
{
|
||||
// @var Collection
|
||||
/** @var Collection */
|
||||
return TransactionJournal::leftJoin('transaction_types', 'transaction_types.id', '=', 'transaction_journals.transaction_type_id')
|
||||
->whereNull('transaction_journals.deleted_at')
|
||||
->where('transaction_types.type', TransactionTypeEnum::OPENING_BALANCE->value)->get(['transaction_journals.*'])
|
||||
|
||||
@@ -81,18 +81,7 @@ class CorrectsTimezoneInformation extends Command
|
||||
TransactionJournal::class => ['date'],
|
||||
];
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Make sure all dates have a timezone.';
|
||||
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'correction:timezones';
|
||||
|
||||
/**
|
||||
|
||||
@@ -138,11 +138,13 @@ class UpgradesLiabilities extends Command
|
||||
|
||||
private function getSourceTransaction(TransactionJournal $journal): ?Transaction
|
||||
{
|
||||
/** @var Transaction|null */
|
||||
return $journal->transactions()->where('amount', '<', 0)->first();
|
||||
}
|
||||
|
||||
private function getDestinationTransaction(TransactionJournal $journal): ?Transaction
|
||||
{
|
||||
/** @var Transaction|null */
|
||||
return $journal->transactions()->where('amount', '>', 0)->first();
|
||||
}
|
||||
|
||||
|
||||
@@ -208,6 +208,7 @@ class UpgradesTransferCurrencies extends Command
|
||||
|
||||
private function getSourceTransaction(TransactionJournal $transfer): ?Transaction
|
||||
{
|
||||
/** @var Transaction|null */
|
||||
return $transfer->transactions()->where('amount', '<', 0)->first();
|
||||
}
|
||||
|
||||
@@ -243,6 +244,7 @@ class UpgradesTransferCurrencies extends Command
|
||||
|
||||
private function getDestinationTransaction(TransactionJournal $transfer): ?Transaction
|
||||
{
|
||||
/** @var Transaction|null */
|
||||
return $transfer->transactions()->where('amount', '>', 0)->first();
|
||||
}
|
||||
|
||||
|
||||
@@ -175,7 +175,7 @@ class UpgradesVariousCurrencyInformation extends Command
|
||||
*/
|
||||
private function getLeadTransaction(TransactionJournal $journal): ?Transaction
|
||||
{
|
||||
/** @var Transaction $lead */
|
||||
/** @var Transaction|null $lead */
|
||||
$lead = null;
|
||||
|
||||
switch ($journal->transactionType->type) {
|
||||
@@ -214,7 +214,7 @@ class UpgradesVariousCurrencyInformation extends Command
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
/** @var Transaction|null */
|
||||
return $lead;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user