File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33namespace TraderInteractive \Memoize ;
44
5- use \ Predis \Client ;
5+ use Predis \ClientInterface ;
66
77/**
88 * A memoizer that caches the results in a redis cache.
@@ -12,7 +12,7 @@ class Predis implements Memoize
1212 /**
1313 * The predis client
1414 *
15- * @var \Predis\Client
15+ * @var ClientInterface
1616 */
1717 private $ client ;
1818
@@ -26,10 +26,10 @@ class Predis implements Memoize
2626 /**
2727 * Sets the predis client.
2828 *
29- * @param \Predis\Client $client The predis client to use
30- * @param boolean $refresh If true we will always overwrite cache even if it is already set
29+ * @param ClientInterface $client The predis client to use
30+ * @param boolean $refresh If true we will always overwrite cache even if it is already set
3131 */
32- public function __construct (Client $ client , bool $ refresh = false )
32+ public function __construct (ClientInterface $ client , bool $ refresh = false )
3333 {
3434 $ this ->client = $ client ;
3535 $ this ->refresh = $ refresh ;
Original file line number Diff line number Diff line change 55use PHPUnit \Framework \TestCase ;
66use PHPUnit_Framework_MockObject_MockObject ;
77use Predis \Client ;
8+ use Predis \ClientInterface ;
89
910/**
1011 * @coversDefaultClass \TraderInteractive\Memoize\Predis
@@ -129,10 +130,7 @@ public function memoizeCallableWithUncachedKeyWithExceptionOnSet()
129130 $ this ->assertSame (1 , $ count );
130131 }
131132
132- /**
133- * @return PHPUnit_Framework_MockObject_MockObject|Client
134- */
135- private function getPredisMock () : PHPUnit_Framework_MockObject_MockObject
133+ private function getPredisMock () : ClientInterface
136134 {
137135 return $ this ->getMockBuilder ('\Predis\Client ' )->setMethods (['get ' , 'set ' , 'expire ' ])->getMock ();
138136 }
You can’t perform that action at this time.
0 commit comments