Fix phpstan issues

This commit is contained in:
James Cole
2025-09-07 07:31:00 +02:00
parent b87b99a755
commit 296a64e284
103 changed files with 605 additions and 617 deletions

View File

@@ -33,6 +33,7 @@ use FireflyIII\Support\Singleton\PreferencesSingleton;
use FireflyIII\User;
use Illuminate\Support\Collection;
use NumberFormatter;
use FireflyIII\Support\Facades\Steam;
/**
* Class Amount.
@@ -58,8 +59,8 @@ class Amount
*/
public function formatFlat(string $symbol, int $decimalPlaces, string $amount, ?bool $coloured = null): string
{
$locale = app('steam')->getLocale();
$rounded = app('steam')->bcround($amount, $decimalPlaces);
$locale = Steam::getLocale();
$rounded = Steam::bcround($amount, $decimalPlaces);
$coloured ??= true;
$fmt = new NumberFormatter($locale, NumberFormatter::CURRENCY);
@@ -69,10 +70,10 @@ class Amount
$result = (string)$fmt->format((float)$rounded); // intentional float
if (true === $coloured) {
if (1 === bccomp((string)$rounded, '0')) {
if (1 === bccomp($rounded, '0')) {
return sprintf('<span class="text-success money-positive">%s</span>', $result);
}
if (-1 === bccomp((string)$rounded, '0')) {
if (-1 === bccomp($rounded, '0')) {
return sprintf('<span class="text-danger money-negative">%s</span>', $result);
}
@@ -242,8 +243,8 @@ class Amount
private function getLocaleInfo(): array
{
// get config from preference, not from translation:
$locale = app('steam')->getLocale();
$array = app('steam')->getLocaleArray($locale);
$locale = Steam::getLocale();
$array = Steam::getLocaleArray($locale);
setlocale(LC_MONETARY, $array);
$info = localeconv();