TestProvider.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\ExpressionLanguage\Tests\Fixtures;
  11. use Symfony\Component\ExpressionLanguage\ExpressionFunction;
  12. use Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface;
  13. use Symfony\Component\ExpressionLanguage\ExpressionPhpFunction;
  14. class TestProvider implements ExpressionFunctionProviderInterface
  15. {
  16. public function getFunctions()
  17. {
  18. return [
  19. new ExpressionFunction('identity', function ($input) {
  20. return $input;
  21. }, function (array $values, $input) {
  22. return $input;
  23. }),
  24. ExpressionFunction::fromPhp('strtoupper'),
  25. ExpressionFunction::fromPhp('\strtolower'),
  26. ExpressionFunction::fromPhp('Symfony\Component\ExpressionLanguage\Tests\Fixtures\fn_namespaced', 'fn_namespaced'),
  27. ];
  28. }
  29. }
  30. function fn_namespaced()
  31. {
  32. return true;
  33. }