@@ -50,7 +50,7 @@ |
||
50 | 50 | * @param RpcRequestInterface[] $requests |
51 | 51 | * @param RpcResponseInterface[] $responses |
52 | 52 | * |
53 | - * @return \PHPUnit_Framework_MockObject_MockObject|RpcClientInterface |
|
53 | + * @return RpcClientInterface |
|
54 | 54 | */ |
55 | 55 | protected function getClientMock(array $requests = [], array $responses = []) |
56 | 56 | { |
@@ -58,7 +58,7 @@ |
||
58 | 58 | |
59 | 59 | $client = $this->prophesize(RpcClientInterface::class); |
60 | 60 | $that = $this; |
61 | - $client->invoke(Argument::type('array'))->will(function ($args) use ($that, $requests, $responses) { |
|
61 | + $client->invoke(Argument::type('array'))->will(function($args) use ($that, $requests, $responses) { |
|
62 | 62 | $collection = $that->prophesize(ResponseCollectionInterface::class); |
63 | 63 | foreach ($requests as $key => $request) { |
64 | 64 | if (in_array($request, $args[0], true)) { |
@@ -121,6 +121,10 @@ |
||
121 | 121 | return $mock->reveal(); |
122 | 122 | } |
123 | 123 | |
124 | + /** |
|
125 | + * @param integer $code |
|
126 | + * @param string $message |
|
127 | + */ |
|
124 | 128 | private function createErrorMock($code, $message) |
125 | 129 | { |
126 | 130 | $mock = $this->prophesize(RpcErrorInterface::class); |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | $client = new RpcMockClient(); |
30 | 30 | $client->push( |
31 | 31 | $this->creatResponseMock(true, 5), |
32 | - function (RpcRequestInterface $request) { |
|
32 | + function(RpcRequestInterface $request) { |
|
33 | 33 | return $request->getMethod() === 'entity'; |
34 | 34 | } |
35 | 35 | ); |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | $client->push($this->creatResponseMock(false, null, $this->createErrorMock(-1, 'invalid'))); |
45 | 45 | $client->push( |
46 | 46 | $this->creatResponseMock(true, []), |
47 | - function (RpcRequestInterface $request) { |
|
47 | + function(RpcRequestInterface $request) { |
|
48 | 48 | return $request->getMethod() === 'entity'; |
49 | 49 | } |
50 | 50 | ); |
@@ -67,14 +67,14 @@ discard block |
||
67 | 67 | static $items = []; |
68 | 68 | $cache = $this->prophesize(CacheItemPoolInterface::class); |
69 | 69 | $that = $this; |
70 | - $cache->getItem(Argument::type('string'))->will(function ($args) use (&$items, $that) { |
|
70 | + $cache->getItem(Argument::type('string'))->will(function($args) use (&$items, $that) { |
|
71 | 71 | $key = $args[0]; |
72 | 72 | if (!array_key_exists($key, $items)) { |
73 | 73 | $item = $that->prophesize(CacheItemInterface::class); |
74 | 74 | |
75 | 75 | $item->getKey()->willReturn($key); |
76 | 76 | $item->isHit()->willReturn(false); |
77 | - $item->set(Argument::any())->will(function ($args) use ($item) { |
|
77 | + $item->set(Argument::any())->will(function($args) use ($item) { |
|
78 | 78 | $item->get()->willReturn($args[0]); |
79 | 79 | }); |
80 | 80 | $item->expiresAfter(Argument::type('int'))->willReturn($item); |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | |
87 | 87 | return $items[$key]->reveal(); |
88 | 88 | }); |
89 | - $cache->save(Argument::type(CacheItemInterface::class))->will(function ($args) use (&$items) { |
|
89 | + $cache->save(Argument::type(CacheItemInterface::class))->will(function($args) use (&$items) { |
|
90 | 90 | $item = $args[0]; |
91 | 91 | $items[$item->getKey()]->isHit()->willReturn(true); |
92 | 92 | }); |