CallbackInterface.php 811 B

123456789101112131415161718192021222324252627282930
  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\Contracts\Cache;
  11. use Psr\Cache\CacheItemInterface;
  12. /**
  13. * Computes and returns the cached value of an item.
  14. *
  15. * @author Nicolas Grekas <p@tchwork.com>
  16. */
  17. interface CallbackInterface
  18. {
  19. /**
  20. * @param CacheItemInterface|ItemInterface $item The item to compute the value for
  21. * @param bool &$save Should be set to false when the value should not be saved in the pool
  22. *
  23. * @return mixed The computed value for the passed item
  24. */
  25. public function __invoke(CacheItemInterface $item, bool &$save);
  26. }