Skip to content

Commit d5575db

Browse files
authored
Merge pull request #34 from php-http/analysis-Xp1k0L
Apply fixes from StyleCI
2 parents ca59f01 + f700dae commit d5575db

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

src/HttpAsyncClientTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public function testSuccessiveInvalidCallMustUseException()
9595
*/
9696
public function testAsyncSendRequest($method, $uri, array $headers, $body)
9797
{
98-
if ($body != null) {
98+
if (null != $body) {
9999
$headers['Content-Length'] = (string) strlen($body);
100100
}
101101

@@ -120,7 +120,7 @@ public function testAsyncSendRequest($method, $uri, array $headers, $body)
120120
$this->assertResponse(
121121
$response,
122122
[
123-
'body' => $method === 'HEAD' ? null : 'Ok',
123+
'body' => 'HEAD' === $method ? null : 'Ok',
124124
]
125125
);
126126
$this->assertRequest($method, $headers, $body, '1.1');
@@ -164,11 +164,11 @@ public function testSendAsyncWithInvalidUri()
164164
*/
165165
public function testSendAsyncRequestWithOutcome($uriAndOutcome, $protocolVersion, array $headers, $body)
166166
{
167-
if ($protocolVersion === '1.0') {
167+
if ('1.0' === $protocolVersion) {
168168
$body = null;
169169
}
170170

171-
if ($body != null) {
171+
if (null != $body) {
172172
$headers['Content-Length'] = (string) strlen($body);
173173
}
174174

src/HttpBaseTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function requestProvider()
7777

7878
// Filter all TRACE requests with a body, as they're not HTTP spec compliant
7979
return array_filter($cases, function ($case) {
80-
if ($case[0] === 'TRACE' && $case[3] !== null) {
80+
if ('TRACE' === $case[0] && null !== $case[3]) {
8181
return false;
8282
}
8383

@@ -232,7 +232,7 @@ protected function assertResponse($response, array $options = [])
232232
$this->assertStringStartsWith($value, $response->getHeaderLine($name));
233233
}
234234

235-
if ($options['body'] === null) {
235+
if (null === $options['body']) {
236236
$this->assertEmpty($response->getBody()->getContents());
237237
} else {
238238
$this->assertContains($options['body'], $response->getBody()->getContents());
@@ -270,7 +270,7 @@ protected function assertRequest(
270270

271271
$name = strtoupper(str_replace('-', '_', 'http-'.$name));
272272

273-
if ($method === 'TRACE' && $name === 'HTTP_CONTENT_LENGTH' && !isset($request['SERVER'][$name])) {
273+
if ('TRACE' === $method && 'HTTP_CONTENT_LENGTH' === $name && !isset($request['SERVER'][$name])) {
274274
continue;
275275
}
276276

src/HttpClientTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ abstract protected function createHttpAdapter();
4141
*/
4242
public function testSendRequest($method, $uri, array $headers, $body)
4343
{
44-
if ($body != null) {
44+
if (null != $body) {
4545
$headers['Content-Length'] = (string) strlen($body);
4646
}
4747

@@ -57,7 +57,7 @@ public function testSendRequest($method, $uri, array $headers, $body)
5757
$this->assertResponse(
5858
$response,
5959
[
60-
'body' => $method === 'HEAD' ? null : 'Ok',
60+
'body' => 'HEAD' === $method ? null : 'Ok',
6161
]
6262
);
6363
$this->assertRequest($method, $headers, $body, '1.1');
@@ -69,11 +69,11 @@ public function testSendRequest($method, $uri, array $headers, $body)
6969
*/
7070
public function testSendRequestWithOutcome($uriAndOutcome, $protocolVersion, array $headers, $body)
7171
{
72-
if ($protocolVersion === '1.0') {
72+
if ('1.0' === $protocolVersion) {
7373
$body = null;
7474
}
7575

76-
if ($body != null) {
76+
if (null != $body) {
7777
$headers['Content-Length'] = (string) strlen($body);
7878
}
7979

src/PHPUnitUtility.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ public static function getUri()
2929
*/
3030
public static function getFile($tmp = true, $name = null)
3131
{
32-
return ($tmp ? realpath(sys_get_temp_dir()) : '').'/'.($name === null ? uniqid() : $name);
32+
return ($tmp ? realpath(sys_get_temp_dir()) : '').'/'.(null === $name ? uniqid() : $name);
3333
}
3434
}

0 commit comments

Comments
 (0)