Skip to content

Commit c353bab

Browse files
authored
Merge pull request #480 from solariumphp/develop
Merge develop to master for new release
2 parents 06e957a + e30bf0d commit c353bab

File tree

4 files changed

+55
-55
lines changed

4 files changed

+55
-55
lines changed

library/Solarium/Core/Client/Adapter/Guzzle3.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,10 @@ public function execute($request, $endpoint)
7474
$endpoint->getBaseUri() . $request->getUri(),
7575
$this->getRequestHeaders($request),
7676
$this->getRequestBody($request),
77-
[
77+
array(
7878
'timeout' => $endpoint->getTimeout(),
7979
'connecttimeout' => $endpoint->getTimeout(),
80-
]
80+
)
8181
);
8282

8383
// Try endpoint authentication first, fallback to request for backwards compatibility
@@ -96,7 +96,7 @@ public function execute($request, $endpoint)
9696
$guzzleResponse = $guzzleRequest->getResponse();
9797

9898
$responseHeaders = array_merge(
99-
["HTTP/1.1 {$guzzleResponse->getStatusCode()} {$guzzleResponse->getReasonPhrase()}"],
99+
array("HTTP/1.1 {$guzzleResponse->getStatusCode()} {$guzzleResponse->getReasonPhrase()}"),
100100
$guzzleResponse->getHeaderLines()
101101
);
102102

@@ -155,7 +155,7 @@ private function getRequestBody(Request $request)
155155
*/
156156
private function getRequestHeaders(Request $request)
157157
{
158-
$headers = [];
158+
$headers = array();
159159
foreach ($request->getHeaders() as $headerLine) {
160160
list($header, $value) = explode(':', $headerLine);
161161
if ($header = trim($header)) {

library/Solarium/QueryType/Select/ResponseParser/Component/Grouping.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function parse($query, $grouping, $data)
8282
$matches = (isset($result['matches'])) ? $result['matches'] : null;
8383
$groupCount = (isset($result['ngroups'])) ? $result['ngroups'] : null;
8484
if ($grouping->getFormat() === GroupingComponent::FORMAT_SIMPLE) {
85-
$valueGroups = [$this->extractValueGroup($valueResultClass, $documentClass, $result, $query)];
85+
$valueGroups = array($this->extractValueGroup($valueResultClass, $documentClass, $result, $query));
8686
$groups[$field] = new FieldGroup($matches, $groupCount, $valueGroups);
8787
continue;
8888
}

tests/Solarium/Tests/Core/Client/Adapter/Guzzle3Test.php

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,11 @@ public function executeGet()
9191
$this->assertSame('OK', $response->getStatusMessage());
9292
$this->assertSame('200', $response->getStatusCode());
9393
$this->assertSame(
94-
[
94+
array(
9595
'HTTP/1.1 200 OK',
9696
'Content-Type: application/json',
9797
'X-PHPUnit: response value',
98-
],
98+
),
9999
$response->getHeaders()
100100
);
101101
$this->assertSame($guzzleResponse->getBody(true), $response->getBody());
@@ -138,11 +138,11 @@ public function executePostWithFile()
138138
$this->assertSame('OK', $response->getStatusMessage());
139139
$this->assertSame('200', $response->getStatusCode());
140140
$this->assertSame(
141-
[
141+
array(
142142
'HTTP/1.1 200 OK',
143143
'Content-Type: application/json',
144144
'X-PHPUnit: response value',
145-
],
145+
),
146146
$response->getHeaders()
147147
);
148148
$this->assertSame($guzzleResponse->getBody(true), $response->getBody());
@@ -187,11 +187,11 @@ public function executePostWithRawBody()
187187
$this->assertSame('OK', $response->getStatusMessage());
188188
$this->assertSame('200', $response->getStatusCode());
189189
$this->assertSame(
190-
[
190+
array(
191191
'HTTP/1.1 200 OK',
192192
'Content-Type: application/json',
193193
'X-PHPUnit: response value',
194-
],
194+
),
195195
$response->getHeaders()
196196
);
197197
$this->assertSame($guzzleResponse->getBody(true), $response->getBody());
@@ -239,11 +239,11 @@ public function executeGetWithAuthentication()
239239
$this->assertSame('OK', $response->getStatusMessage());
240240
$this->assertSame('200', $response->getStatusCode());
241241
$this->assertSame(
242-
[
242+
array(
243243
'HTTP/1.1 200 OK',
244244
'Content-Type: application/json',
245245
'X-PHPUnit: response value',
246-
],
246+
),
247247
$response->getHeaders()
248248
);
249249
$this->assertSame($guzzleResponse->getBody(true), $response->getBody());
@@ -280,9 +280,9 @@ public function executeRequestException()
280280
$request->setMethod(Request::METHOD_GET);
281281

282282
$endpoint = new Endpoint(
283-
[
283+
array(
284284
'scheme' => 'silly', //invalid protocol
285-
]
285+
)
286286
);
287287

288288
$this->adapter->execute($request, $endpoint);
@@ -296,26 +296,26 @@ public function executeRequestException()
296296
private function getValidResponse()
297297
{
298298
$body = json_encode(
299-
[
300-
'response' => [
299+
array(
300+
'response' => array(
301301
'numFound' => 10,
302302
'start' => 0,
303-
'docs' => [
304-
[
303+
'docs' => array(
304+
array(
305305
'id' => '58339e95d5200',
306306
'author' => 'Gambardella, Matthew',
307307
'title' => "XML Developer's Guide",
308308
'genre' => 'Computer',
309309
'price' => 44.95,
310310
'published' => 970372800,
311311
'description' => 'An in-depth look at creating applications with XML.',
312-
],
313-
],
314-
],
315-
]
312+
),
313+
),
314+
),
315+
)
316316
);
317317

318-
$headers = ['Content-Type' => 'application/json', 'X-PHPUnit' => 'response value'];
318+
$headers = array('Content-Type' => 'application/json', 'X-PHPUnit' => 'response value');
319319
return new Response(200, $headers, $body);
320320
}
321321
}

tests/Solarium/Tests/Core/Client/Adapter/GuzzleTest.php

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,15 @@ public function setUp()
7575
public function executeGet()
7676
{
7777
$guzzleResponse = $this->getValidResponse();
78-
$mockHandler = new MockHandler([$guzzleResponse]);
78+
$mockHandler = new MockHandler(array($guzzleResponse));
7979

80-
$container = [];
80+
$container = array();
8181
$history = Middleware::history($container);
8282

8383
$stack = HandlerStack::create($mockHandler);
8484
$stack->push($history);
8585

86-
$adapter = new GuzzleAdapter(['handler' => $stack]);
86+
$adapter = new GuzzleAdapter(array('handler' => $stack));
8787

8888
$request = new Request();
8989
$request->setMethod(Request::METHOD_GET);
@@ -96,11 +96,11 @@ public function executeGet()
9696
$this->assertSame('OK', $response->getStatusMessage());
9797
$this->assertSame('200', $response->getStatusCode());
9898
$this->assertSame(
99-
[
99+
array(
100100
'HTTP/1.1 200 OK',
101101
'Content-Type: application/json',
102102
'X-PHPUnit: response value',
103-
],
103+
),
104104
$response->getHeaders()
105105
);
106106
$this->assertSame((string)$guzzleResponse->getBody(), $response->getBody());
@@ -121,15 +121,15 @@ public function executeGet()
121121
public function executePostWithFile()
122122
{
123123
$guzzleResponse = $this->getValidResponse();
124-
$mockHandler = new MockHandler([$guzzleResponse]);
124+
$mockHandler = new MockHandler(array($guzzleResponse));
125125

126-
$container = [];
126+
$container = array();
127127
$history = Middleware::history($container);
128128

129129
$stack = HandlerStack::create($mockHandler);
130130
$stack->push($history);
131131

132-
$adapter = new GuzzleAdapter(['handler' => $stack]);
132+
$adapter = new GuzzleAdapter(array('handler' => $stack));
133133

134134
$request = new Request();
135135
$request->setMethod(Request::METHOD_POST);
@@ -143,11 +143,11 @@ public function executePostWithFile()
143143
$this->assertSame('OK', $response->getStatusMessage());
144144
$this->assertSame('200', $response->getStatusCode());
145145
$this->assertSame(
146-
[
146+
array(
147147
'HTTP/1.1 200 OK',
148148
'Content-Type: application/json',
149149
'X-PHPUnit: response value',
150-
],
150+
),
151151
$response->getHeaders()
152152
);
153153
$this->assertSame((string)$guzzleResponse->getBody(), $response->getBody());
@@ -169,15 +169,15 @@ public function executePostWithFile()
169169
public function executePostWithRawBody()
170170
{
171171
$guzzleResponse = $this->getValidResponse();
172-
$mockHandler = new MockHandler([$guzzleResponse]);
172+
$mockHandler = new MockHandler(array($guzzleResponse));
173173

174-
$container = [];
174+
$container = array();
175175
$history = Middleware::history($container);
176176

177177
$stack = HandlerStack::create($mockHandler);
178178
$stack->push($history);
179179

180-
$adapter = new GuzzleAdapter(['handler' => $stack]);
180+
$adapter = new GuzzleAdapter(array('handler' => $stack));
181181

182182
$request = new Request();
183183
$request->setMethod(Request::METHOD_POST);
@@ -192,11 +192,11 @@ public function executePostWithRawBody()
192192
$this->assertSame('OK', $response->getStatusMessage());
193193
$this->assertSame('200', $response->getStatusCode());
194194
$this->assertSame(
195-
[
195+
array(
196196
'HTTP/1.1 200 OK',
197197
'Content-Type: application/json',
198198
'X-PHPUnit: response value',
199-
],
199+
),
200200
$response->getHeaders()
201201
);
202202
$this->assertSame((string)$guzzleResponse->getBody(), $response->getBody());
@@ -219,15 +219,15 @@ public function executePostWithRawBody()
219219
public function executeGetWithAuthentication()
220220
{
221221
$guzzleResponse = $this->getValidResponse();
222-
$mockHandler = new MockHandler([$guzzleResponse]);
222+
$mockHandler = new MockHandler(array($guzzleResponse));
223223

224-
$container = [];
224+
$container = array();
225225
$history = Middleware::history($container);
226226

227227
$stack = HandlerStack::create($mockHandler);
228228
$stack->push($history);
229229

230-
$adapter = new GuzzleAdapter(['handler' => $stack]);
230+
$adapter = new GuzzleAdapter(array('handler' => $stack));
231231

232232
$request = new Request();
233233
$request->setMethod(Request::METHOD_GET);
@@ -241,11 +241,11 @@ public function executeGetWithAuthentication()
241241
$this->assertSame('OK', $response->getStatusMessage());
242242
$this->assertSame('200', $response->getStatusCode());
243243
$this->assertSame(
244-
[
244+
array(
245245
'HTTP/1.1 200 OK',
246246
'Content-Type: application/json',
247247
'X-PHPUnit: response value',
248-
],
248+
),
249249
$response->getHeaders()
250250
);
251251
$this->assertSame((string)$guzzleResponse->getBody(), $response->getBody());
@@ -277,9 +277,9 @@ public function executeRequestException()
277277
$request->setMethod(Request::METHOD_GET);
278278

279279
$endpoint = new Endpoint(
280-
[
280+
array(
281281
'scheme' => 'silly', //invalid protocol
282-
]
282+
)
283283
);
284284
$endpoint->setTimeout(10);
285285

@@ -294,26 +294,26 @@ public function executeRequestException()
294294
private function getValidResponse()
295295
{
296296
$body = json_encode(
297-
[
298-
'response' => [
297+
array(
298+
'response' => array(
299299
'numFound' => 10,
300300
'start' => 0,
301-
'docs' => [
302-
[
301+
'docs' => array(
302+
array(
303303
'id' => '58339e95d5200',
304304
'author' => 'Gambardella, Matthew',
305305
'title' => "XML Developer's Guide",
306306
'genre' => 'Computer',
307307
'price' => 44.95,
308308
'published' => 970372800,
309309
'description' => 'An in-depth look at creating applications with XML.',
310-
],
311-
],
312-
],
313-
]
310+
),
311+
),
312+
),
313+
)
314314
);
315315

316-
$headers = ['Content-Type' => 'application/json', 'X-PHPUnit' => 'response value'];
316+
$headers = array('Content-Type' => 'application/json', 'X-PHPUnit' => 'response value');
317317
return new Response(200, $headers, $body);
318318
}
319319
}

0 commit comments

Comments
 (0)