Lines 100.00% 3 / 3
Methods 100.00% 1 / 1
Classes 100.00% 1 / 1
Covered by tests of size
Name Lines Methods CRAP
 getCategoryName 100.00% 3 / 3 100.00% 1 / 1 1
28class CategoryNameTwigExtension extends AbstractExtension
29{
30    #[AsTwigFilter(name: 'categoryName')]
31    #[AsTwigFunction(name: 'categoryName')]
32    public static function getCategoryName(int $categoryId): string
33    {
34        $category = new Category(Configuration::getConfigurationInstance());
35
36        $categoryEntity = $category->getCategoryData($categoryId);
37        return $categoryEntity->getName();
38    }
39}