Skip to content

Commit 1d93776

Browse files
Support passing through config when enabling caching
1 parent 8dcee8f commit 1d93776

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/Github/Client.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,12 +402,14 @@ public function addHeaders(array $headers)
402402

403403
/**
404404
* Add a cache plugin to cache responses locally.
405+
*
405406
* @param CacheItemPoolInterface $cache
407+
* @param array $config
406408
*/
407-
public function addCache(CacheItemPoolInterface $cachePool)
409+
public function addCache(CacheItemPoolInterface $cachePool, array $config = [])
408410
{
409411
$this->removeCache();
410-
$this->addPlugin(new Plugin\CachePlugin($cachePool, $this->streamFactory));
412+
$this->addPlugin(new Plugin\CachePlugin($cachePool, $this->streamFactory, $config));
411413
}
412414

413415
/**

0 commit comments

Comments
 (0)