Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.x is supported too.
   1  <?php
   2  
   3  namespace Kevinrob\GuzzleCache\Strategy;
   4  
   5  use Kevinrob\GuzzleCache\CacheEntry;
   6  use Psr\Http\Message\RequestInterface;
   7  use Psr\Http\Message\ResponseInterface;
   8  
   9  interface CacheStrategyInterface
  10  {
  11      /**
  12       * Return a CacheEntry or null if no cache.
  13       *
  14       * @param RequestInterface $request
  15       *
  16       * @return CacheEntry|null
  17       */
  18      public function fetch(RequestInterface $request);
  19  
  20      /**
  21       * @param RequestInterface  $request
  22       * @param ResponseInterface $response
  23       *
  24       * @return bool true if success
  25       */
  26      public function cache(RequestInterface $request, ResponseInterface $response);
  27  
  28      /**
  29       * @param RequestInterface $request
  30       * @param ResponseInterface $response
  31       *
  32       * @return bool true if success
  33       */
  34      public function update(RequestInterface $request, ResponseInterface $response);
  35  
  36      /**
  37       * @param RequestInterface $request
  38       *
  39       * @return bool
  40       */
  41      public function delete(RequestInterface $request);
  42  }