fix private method call

This commit is contained in:
ghost 2023-12-10 07:54:18 +02:00
parent 238c008738
commit 13506cf44c

View File

@ -131,7 +131,7 @@ class AppExtension extends AbstractExtension
return sprintf( return sprintf(
'%s %s', '%s %s',
$round, $round,
$this->plural( $this->_plural(
$round, $round,
$value $value
) )
@ -192,13 +192,6 @@ class AppExtension extends AbstractExtension
); );
} }
private function plural(int $number, array $texts)
{
$cases = [2, 0, 1, 1, 1, 2];
return $texts[(($number % 100) > 4 && ($number % 100) < 20) ? 2 : $cases[min($number % 10, 5)]];
}
public function kevaNamespaceValue( public function kevaNamespaceValue(
string $namespace string $namespace
): string ): string
@ -227,4 +220,11 @@ class AppExtension extends AbstractExtension
// Return original hash if no success // Return original hash if no success
return $namespace; return $namespace;
} }
private function _plural(int $number, array $texts)
{
$cases = [2, 0, 1, 1, 1, 2];
return $texts[(($number % 100) > 4 && ($number % 100) < 20) ? 2 : $cases[min($number % 10, 5)]];
}
} }