33namespace Github \HttpClient ;
44
55use Buzz \Client \ClientInterface ;
6- use Buzz \Message \MessageInterface ;
7- use Buzz \Message \RequestInterface ;
8- use Buzz \Listener \ListenerInterface ;
96
10- use Github \Exception \ErrorException ;
11- use Github \Exception \RuntimeException ;
12- use Github \HttpClient \Listener \ErrorListener ;
13- use Github \HttpClient \Message \Request ;
14- use Github \HttpClient \Message \Response ;
157use Github \HttpClient \Cache \CacheInterface ;
168use Github \HttpClient \Cache \FilesystemCache ;
179
2416 */
2517class CachedHttpClient extends HttpClient
2618{
19+ /**
20+ * @var CacheInterface
21+ */
2722 protected $ cache ;
2823
24+ /**
25+ * @param array $options
26+ * @param null|ClientInterface $client
27+ * @param null|CacheInterface $cache
28+ */
2929 public function __construct (array $ options = array (), ClientInterface $ client = null , CacheInterface $ cache = null )
3030 {
3131 parent ::__construct ($ options , $ client );
3232
33- $ this ->cache = $ cache ?: new FilesystemCache ;
33+ $ this ->cache = $ cache ?: new FilesystemCache ( $ this -> options [ ' cache_dir ' ] ?: sys_get_temp_dir (). DIRECTORY_SEPARATOR . ' php-github-api-cache ' ) ;
3434 }
3535
36+ /**
37+ * {@inheritdoc}
38+ */
3639 public function request ($ path , array $ parameters = array (), $ httpMethod = 'GET ' , array $ headers = array ())
3740 {
3841 $ response = parent ::request ($ path , $ parameters , $ httpMethod , $ headers );
@@ -50,10 +53,7 @@ public function request($path, array $parameters = array(), $httpMethod = 'GET',
5053 /**
5154 * Create requests with If-Modified-Since headers
5255 *
53- * @param string $httpMethod
54- * @param string $url
55- *
56- * @return Request
56+ * {@inheritdoc}
5757 */
5858 protected function createRequest ($ httpMethod , $ url )
5959 {
0 commit comments