Arithmetic.php 1.0 KB

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