Skip to content

Commit ec56535

Browse files
authored
Merge pull request KnpLabs#428 from GrahamCampbell/patch-1
Support passing through config when enabling caching
2 parents 8dcee8f + 1d93776 commit ec56535

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)