mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-01 14:04:30 +02:00
Fixed some inspection issues.
This commit is contained in:
parent
6caf605fe2
commit
e01b06fb85
80 changed files with 173 additions and 218 deletions
|
@ -111,7 +111,7 @@ class AppExtension extends AbstractExtension
|
|||
public function getTests()
|
||||
{
|
||||
return [
|
||||
new TwigTest('instanceof', function ($var, $instance) {
|
||||
new TwigTest('instanceof', static function ($var, $instance) {
|
||||
return $var instanceof $instance;
|
||||
}),
|
||||
];
|
||||
|
@ -150,7 +150,7 @@ class AppExtension extends AbstractExtension
|
|||
return $this->entityURLGenerator->getURL($entity, $method);
|
||||
}
|
||||
|
||||
public function formatCurrency($amount, ?Currency $currency = null, int $decimals = 5)
|
||||
public function formatCurrency($amount, ?Currency $currency = null, int $decimals = 5): string
|
||||
{
|
||||
if ($amount instanceof BigDecimal) {
|
||||
$amount = (string) $amount;
|
||||
|
@ -159,12 +159,12 @@ class AppExtension extends AbstractExtension
|
|||
return $this->moneyFormatter->format($amount, $currency, $decimals);
|
||||
}
|
||||
|
||||
public function siFormat($value, $unit, $decimals = 2, bool $show_all_digits = false)
|
||||
public function siFormat($value, $unit, $decimals = 2, bool $show_all_digits = false): string
|
||||
{
|
||||
return $this->siformatter->format($value, $unit, $decimals, $show_all_digits);
|
||||
return $this->siformatter->format($value, $unit, $decimals);
|
||||
}
|
||||
|
||||
public function amountFormat($value, ?MeasurementUnit $unit, array $options = [])
|
||||
public function amountFormat($value, ?MeasurementUnit $unit, array $options = []): string
|
||||
{
|
||||
return $this->amountFormatter->format($value, $unit, $options);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue