Skip to content

Commit 91ce6a9

Browse files
author
James Galecki
committed
scrutinizer changes
1 parent b5eb7c2 commit 91ce6a9

2 files changed

Lines changed: 7 additions & 9 deletions

File tree

src/Predis.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace 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;

tests/PredisTest.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use PHPUnit\Framework\TestCase;
66
use PHPUnit_Framework_MockObject_MockObject;
77
use 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
}

0 commit comments

Comments
 (0)