mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-26 13:36:15 +00:00
fix phpstan issues.
This commit is contained in:
@@ -217,7 +217,7 @@ class BillTransformer extends AbstractTransformer
|
||||
'end_date' => $bill->end_date?->toAtomString(),
|
||||
'extension_date' => $bill->extension_date?->toAtomString(),
|
||||
'repeat_freq' => $bill->repeat_freq,
|
||||
'skip' => (int)$bill->skip,
|
||||
'skip' => $bill->skip,
|
||||
'active' => $bill->active,
|
||||
'order' => $bill->order,
|
||||
'notes' => $this->notes[$bill->id] ?? null,
|
||||
|
||||
@@ -301,16 +301,28 @@ class TransactionGroupTransformer extends AbstractTransformer
|
||||
}
|
||||
// app('log')->debug(sprintf('Now in date("%s")', $string));
|
||||
if (10 === strlen($string)) {
|
||||
return Carbon::createFromFormat('Y-m-d', $string, config('app.timezone'));
|
||||
$res = Carbon::createFromFormat('Y-m-d', $string, config('app.timezone'));
|
||||
if(false === $res) {
|
||||
return null;
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
if (25 === strlen($string)) {
|
||||
return Carbon::parse($string, config('app.timezone'));
|
||||
}
|
||||
if (19 === strlen($string) && str_contains($string, 'T')) {
|
||||
return Carbon::createFromFormat('Y-m-d\TH:i:s', substr($string, 0, 19), config('app.timezone'));
|
||||
$res = Carbon::createFromFormat('Y-m-d\TH:i:s', substr($string, 0, 19), config('app.timezone'));
|
||||
if(false === $res) {
|
||||
return null;
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
|
||||
// 2022-01-01 01:01:01
|
||||
return Carbon::createFromFormat('Y-m-d H:i:s', substr($string, 0, 19), config('app.timezone'));
|
||||
$res = Carbon::createFromFormat('Y-m-d H:i:s', substr($string, 0, 19), config('app.timezone'));
|
||||
if(false === $res) {
|
||||
return null;
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user