Skip to content

Commit 3d7a957

Browse files
committed
Add docblock
1 parent ef33028 commit 3d7a957

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

src/Test/HttpClient/MockHttpAdapter.php

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,16 @@
77
use GuzzleHttp\Psr7\Response;
88
use Psr\Http\Message\RequestInterface;
99

10+
/**
11+
* HTTP adapter mock
12+
*
13+
* This mock is most useful in tests. It does not send requests but stores them
14+
* for later retrieval. Additionally, you can set an exception to test
15+
* exception handling.
16+
*/
1017
class MockHttpAdapter implements HttpAdapter
1118
{
12-
private $requests = array();
19+
private $requests = [];
1320
private $exception;
1421

1522
/**
@@ -18,11 +25,11 @@ class MockHttpAdapter implements HttpAdapter
1825
public function sendRequest(RequestInterface $request, array $options = [])
1926
{
2027
$this->requests[] = $request;
21-
28+
2229
if ($this->exception) {
2330
throw $this->exception;
2431
}
25-
32+
2633
return new Response();
2734
}
2835

@@ -33,19 +40,19 @@ public function sendRequests(array $requests, array $options = [])
3340
{
3441
$responses = [];
3542
$exceptions = new MultiHttpAdapterException();
36-
43+
3744
foreach ($requests as $request) {
3845
try {
3946
$responses[] = $this->sendRequest($request);
4047
} catch (\Exception $e) {
4148
$exceptions->addException($e);
4249
}
4350
}
44-
51+
4552
if ($exceptions->hasExceptions()) {
4653
throw $exceptions;
4754
}
48-
55+
4956
return $responses;
5057
}
5158

@@ -63,12 +70,12 @@ public function getName()
6370
{
6471
return 'mock';
6572
}
66-
73+
6774
public function getRequests()
6875
{
6976
return $this->requests;
7077
}
71-
78+
7279
public function clear()
7380
{
7481
$this->exception = null;

src/Test/PHPUnit/AbstractCacheConstraint.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ protected function matches($other)
5353
)
5454
);
5555
}
56-
56+
5757
return $this->getValue() === (string) $other->getHeaderLine($this->header);
5858
}
5959

0 commit comments

Comments
 (0)