TransformationsExtension.php 829 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. declare(strict_types=1);
  3. namespace PhpMyAdmin\Twig;
  4. use PhpMyAdmin\Transformations;
  5. use Twig\Extension\AbstractExtension;
  6. use Twig\TwigFunction;
  7. class TransformationsExtension extends AbstractExtension
  8. {
  9. /**
  10. * Returns a list of functions to add to the existing list.
  11. *
  12. * @return TwigFunction[]
  13. */
  14. public function getFunctions()
  15. {
  16. $transformations = new Transformations();
  17. return [
  18. new TwigFunction(
  19. 'get_description',
  20. [
  21. $transformations,
  22. 'getDescription',
  23. ]
  24. ),
  25. new TwigFunction(
  26. 'get_name',
  27. [
  28. $transformations,
  29. 'getName',
  30. ]
  31. ),
  32. ];
  33. }
  34. }