Open Journal Systems  3.3.0
Guzzle\Plugin\Cache\CallbackCanCacheStrategy Class Reference
Inheritance diagram for Guzzle\Plugin\Cache\CallbackCanCacheStrategy:
Guzzle\Plugin\Cache\DefaultCanCacheStrategy Guzzle\Plugin\Cache\CanCacheStrategyInterface

Public Member Functions

 __construct ($requestCallback=null, $responseCallback=null)
 
 canCacheRequest (RequestInterface $request)
 
 canCacheResponse (Response $response)
 

Protected Attributes

 $requestCallback
 
 $responseCallback
 

Detailed Description

Determines if a request can be cached using a callback

Definition at line 12 of file CallbackCanCacheStrategy.php.

Constructor & Destructor Documentation

◆ __construct()

Guzzle\Plugin\Cache\CallbackCanCacheStrategy::__construct (   $requestCallback = null,
  $responseCallback = null 
)
Parameters
\Closure | array | mixed$requestCallbackCallable method to invoke for requests
\Closure | array | mixed$responseCallbackCallable method to invoke for responses
Exceptions
InvalidArgumentException

Definition at line 32 of file CallbackCanCacheStrategy.php.

References Guzzle\Plugin\Cache\CallbackCanCacheStrategy\$requestCallback, and Guzzle\Plugin\Cache\CallbackCanCacheStrategy\$responseCallback.

Member Function Documentation

◆ canCacheRequest()

Guzzle\Plugin\Cache\CallbackCanCacheStrategy::canCacheRequest ( RequestInterface  $request)

Determine if a request can be cached

Parameters
RequestInterface$requestRequest to determine
Returns
bool

Reimplemented from Guzzle\Plugin\Cache\DefaultCanCacheStrategy.

Definition at line 46 of file CallbackCanCacheStrategy.php.

◆ canCacheResponse()

Guzzle\Plugin\Cache\CallbackCanCacheStrategy::canCacheResponse ( Response  $response)

Determine if a response can be cached

Parameters
Response$responseResponse to determine
Returns
bool

Reimplemented from Guzzle\Plugin\Cache\DefaultCanCacheStrategy.

Definition at line 53 of file CallbackCanCacheStrategy.php.

Field Documentation

◆ $requestCallback

callable Guzzle\Plugin\Cache\CallbackCanCacheStrategy::$requestCallback
protected

Callback for request

Definition at line 18 of file CallbackCanCacheStrategy.php.

Referenced by Guzzle\Plugin\Cache\CallbackCanCacheStrategy\__construct().

◆ $responseCallback

callable Guzzle\Plugin\Cache\CallbackCanCacheStrategy::$responseCallback
protected

Callback for response

Definition at line 24 of file CallbackCanCacheStrategy.php.

Referenced by Guzzle\Plugin\Cache\CallbackCanCacheStrategy\__construct().


The documentation for this class was generated from the following file: