Arithmetic.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /**
  3. * Kohana Cache Arithmetic Interface, for basic cache integer based
  4. * arithmetic, addition and subtraction
  5. *
  6. * @package Kohana/Cache
  7. * @category Base
  8. * @author Kohana Team
  9. * @copyright (c) Kohana Team
  10. * @license https://koseven.ga/LICENSE.md
  11. * @since 3.2.0
  12. */
  13. interface Kohana_Cache_Arithmetic {
  14. /**
  15. * Increments a given value by the step value supplied.
  16. * Useful for shared counters and other persistent integer based
  17. * tracking.
  18. *
  19. * @param string id of cache entry to increment
  20. * @param int step value to increment by
  21. * @return integer
  22. * @return boolean
  23. */
  24. public function increment($id, $step = 1);
  25. /**
  26. * Decrements a given value by the step value supplied.
  27. * Useful for shared counters and other persistent integer based
  28. * tracking.
  29. *
  30. * @param string id of cache entry to decrement
  31. * @param int step value to decrement by
  32. * @return integer
  33. * @return boolean
  34. */
  35. public function decrement($id, $step = 1);
  36. } // End Kohana_Cache_Arithmetic