diff --git a/src/Twig/AppExtension.php b/src/Twig/AppExtension.php index 3ab0a78..fc36ee4 100644 --- a/src/Twig/AppExtension.php +++ b/src/Twig/AppExtension.php @@ -131,7 +131,7 @@ class AppExtension extends AbstractExtension return sprintf( '%s %s', $round, - $this->plural( + $this->_plural( $round, $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( string $namespace ): string @@ -227,4 +220,11 @@ class AppExtension extends AbstractExtension // Return original hash if no success 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)]]; + } } \ No newline at end of file