ParserCacheInterface.php 915 B

12345678910111213141516171819202122232425262728293031323334353637
  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\ParserCache;
  11. use Symfony\Component\ExpressionLanguage\ParsedExpression;
  12. /**
  13. * @author Adrien Brault <adrien.brault@gmail.com>
  14. */
  15. interface ParserCacheInterface
  16. {
  17. /**
  18. * Saves an expression in the cache.
  19. *
  20. * @param string $key The cache key
  21. * @param ParsedExpression $expression A ParsedExpression instance to store in the cache
  22. */
  23. public function save($key, ParsedExpression $expression);
  24. /**
  25. * Fetches an expression from the cache.
  26. *
  27. * @param string $key The cache key
  28. *
  29. * @return ParsedExpression|null
  30. */
  31. public function fetch($key);
  32. }