SimpleCacheInterface.php 867 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace Consolidation\AnnotatedCommand\Cache;
  3. /**
  4. * Documentation interface.
  5. *
  6. * Clients that use AnnotatedCommandFactory::setDataStore()
  7. * are encouraged to provide a data store that implements
  8. * this interface.
  9. *
  10. * This is not currently required to allow clients to use a generic cache
  11. * store that does not itself depend on the annotated-command library.
  12. * This might be required in a future version.
  13. */
  14. interface SimpleCacheInterface
  15. {
  16. /**
  17. * Test for an entry from the cache
  18. * @param string $key
  19. * @return boolean
  20. */
  21. public function has($key);
  22. /**
  23. * Get an entry from the cache
  24. * @param string $key
  25. * @return array
  26. */
  27. public function get($key);
  28. /**
  29. * Store an entry in the cache
  30. * @param string $key
  31. * @param array $data
  32. */
  33. public function set($key, $data);
  34. }