@@ -184,7 +184,7 @@ |
||
184 | 184 | $item = array_shift($this->queue); |
185 | 185 | if ($item instanceof Response) { |
186 | 186 | if ($this->readBodies && $request instanceof EntityEnclosingRequestInterface) { |
187 | - $request->getEventDispatcher()->addListener('request.sent', $f = function (Event $event) use (&$f) { |
|
187 | + $request->getEventDispatcher()->addListener('request.sent', $f = function(Event $event) use (&$f) { |
|
188 | 188 | while ($data = $event['request']->getBody()->read(8096)); |
189 | 189 | // Remove the listener after one-time use |
190 | 190 | $event['request']->getEventDispatcher()->removeListener('request.sent', $f); |
@@ -104,7 +104,7 @@ |
||
104 | 104 | public function getIterator() |
105 | 105 | { |
106 | 106 | // Return an iterator just like the old iteration of the HistoryPlugin for BC compatibility (use getAll()) |
107 | - return new \ArrayIterator(array_map(function ($entry) { |
|
107 | + return new \ArrayIterator(array_map(function($entry) { |
|
108 | 108 | $entry['request']->getParams()->set('actual_response', $entry['response']); |
109 | 109 | return $entry['request']; |
110 | 110 | }, $this->transactions)); |
@@ -62,7 +62,7 @@ |
||
62 | 62 | } |
63 | 63 | } |
64 | 64 | |
65 | - return new self(new ClosureLogAdapter(function ($m) use ($stream) { |
|
65 | + return new self(new ClosureLogAdapter(function($m) use ($stream) { |
|
66 | 66 | fwrite($stream, $m . PHP_EOL); |
67 | 67 | }), "# Request:\n{request}\n\n# Response:\n{response}\n\n# Errors: {curl_code} {curl_error}", $wireBodies); |
68 | 68 | } |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | public function remove($domain = null, $path = null, $name = null) |
43 | 43 | { |
44 | 44 | $cookies = $this->all($domain, $path, $name, false, false); |
45 | - $this->cookies = array_filter($this->cookies, function (Cookie $cookie) use ($cookies) { |
|
45 | + $this->cookies = array_filter($this->cookies, function(Cookie $cookie) use ($cookies) { |
|
46 | 46 | return !in_array($cookie, $cookies, true); |
47 | 47 | }); |
48 | 48 | |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | |
52 | 52 | public function removeTemporary() |
53 | 53 | { |
54 | - $this->cookies = array_filter($this->cookies, function (Cookie $cookie) { |
|
54 | + $this->cookies = array_filter($this->cookies, function(Cookie $cookie) { |
|
55 | 55 | return !$cookie->getDiscard() && $cookie->getExpires(); |
56 | 56 | }); |
57 | 57 | |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | public function removeExpired() |
62 | 62 | { |
63 | 63 | $currentTime = time(); |
64 | - $this->cookies = array_filter($this->cookies, function (Cookie $cookie) use ($currentTime) { |
|
64 | + $this->cookies = array_filter($this->cookies, function(Cookie $cookie) use ($currentTime) { |
|
65 | 65 | return !$cookie->getExpires() || $currentTime < $cookie->getExpires(); |
66 | 66 | }); |
67 | 67 | |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | |
71 | 71 | public function all($domain = null, $path = null, $name = null, $skipDiscardable = false, $skipExpired = true) |
72 | 72 | { |
73 | - return array_values(array_filter($this->cookies, function (Cookie $cookie) use ( |
|
73 | + return array_values(array_filter($this->cookies, function(Cookie $cookie) use ( |
|
74 | 74 | $domain, |
75 | 75 | $path, |
76 | 76 | $name, |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | public function serialize() |
146 | 146 | { |
147 | 147 | // Only serialize long term cookies and unexpired cookies |
148 | - return json_encode(array_map(function (Cookie $cookie) { |
|
148 | + return json_encode(array_map(function(Cookie $cookie) { |
|
149 | 149 | return $cookie->toArray(); |
150 | 150 | }, $this->all(null, null, null, true, true))); |
151 | 151 | } |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | if (empty($data)) { |
160 | 160 | $this->cookies = array(); |
161 | 161 | } else { |
162 | - $this->cookies = array_map(function (array $cookie) { |
|
162 | + $this->cookies = array_map(function(array $cookie) { |
|
163 | 163 | return new Cookie($cookie); |
164 | 164 | }, $data); |
165 | 165 | } |
@@ -46,7 +46,7 @@ |
||
46 | 46 | */ |
47 | 47 | protected function getErrorClosure(RequestInterface $request, CommandInterface $command, Operation $operation) |
48 | 48 | { |
49 | - return function (Event $event) use ($request, $command, $operation) { |
|
49 | + return function(Event $event) use ($request, $command, $operation) { |
|
50 | 50 | $response = $event['response']; |
51 | 51 | foreach ($operation->getErrorResponses() as $error) { |
52 | 52 | if (!isset($error['class'])) { |
@@ -16,7 +16,7 @@ |
||
16 | 16 | Response $response, |
17 | 17 | Parameter $param, |
18 | 18 | &$value, |
19 | - $context = null |
|
19 | + $context = null |
|
20 | 20 | ) { |
21 | 21 | $value[$param->getName()] = $param->filter($response->getBody()); |
22 | 22 | } |
@@ -16,7 +16,7 @@ |
||
16 | 16 | Response $response, |
17 | 17 | Parameter $param, |
18 | 18 | &$value, |
19 | - $context = null |
|
19 | + $context = null |
|
20 | 20 | ) { |
21 | 21 | $value[$param->getName()] = $param->filter($response->getBody()); |
22 | 22 | } |
@@ -16,7 +16,7 @@ |
||
16 | 16 | Response $response, |
17 | 17 | Parameter $param, |
18 | 18 | &$value, |
19 | - $context = null |
|
19 | + $context = null |
|
20 | 20 | ) { |
21 | 21 | $value[$param->getName()] = $param->filter($response->getBody()); |
22 | 22 | } |
@@ -16,7 +16,7 @@ |
||
16 | 16 | Response $response, |
17 | 17 | Parameter $param, |
18 | 18 | &$value, |
19 | - $context = null |
|
19 | + $context = null |
|
20 | 20 | ) { |
21 | 21 | $value[$param->getName()] = $param->filter($response->getBody()); |
22 | 22 | } |