Skip to content

Commit cbdb176

Browse files
committed
Style fixes
1 parent b40ab7a commit cbdb176

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/Client.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public function sendRequest(RequestInterface $request)
7676
}
7777

7878
if (null === $useSsl) {
79-
$useSsl = ($request->getUri()->getScheme() === 'https');
79+
$useSsl = ('https' === $request->getUri()->getScheme());
8080
}
8181

8282
$socket = $this->createSocket($request, $remote, $useSsl);
@@ -169,12 +169,12 @@ protected function configure(array $config = [])
169169
*/
170170
private function determineRemoteFromRequest(RequestInterface $request)
171171
{
172-
if (!$request->hasHeader('Host') && $request->getUri()->getHost() === '') {
172+
if (!$request->hasHeader('Host') && '' === $request->getUri()->getHost()) {
173173
throw new InvalidRequestException('Remote is not defined and we cannot determine a connection endpoint for this request (no Host header)', $request);
174174
}
175175

176176
$host = $request->getUri()->getHost();
177-
$port = $request->getUri()->getPort() ?: ($request->getUri()->getScheme() === 'https' ? 443 : 80);
177+
$port = $request->getUri()->getPort() ?: ('https' === $request->getUri()->getScheme() ? 443 : 80);
178178
$endpoint = sprintf('%s:%s', $host, $port);
179179

180180
// If use the host header if present for the endpoint

src/RequestWriter.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ private function fwrite($stream, $bytes)
100100
return 0;
101101
}
102102
$result = @fwrite($stream, $bytes);
103-
if ($result !== 0) {
103+
if (0 !== $result) {
104104
// In cases where some bytes are witten (`$result > 0`) or
105105
// an error occurs (`$result === false`), the behavior of fwrite() is
106106
// correct. We can return the value as-is.
@@ -124,7 +124,7 @@ private function fwrite($stream, $bytes)
124124
// perform a write. If the write also fails, conclude that these failures are
125125
// EPIPE or some other permanent failure.
126126
$result = @fwrite($stream, $bytes);
127-
if ($result !== 0) {
127+
if (0 !== $result) {
128128
// The write worked or failed explicitly. This value is fine to return.
129129
return $result;
130130
}

src/ResponseReader.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ protected function readResponse(RequestInterface $request, $socket)
3838
$headers = [];
3939
$reason = null;
4040

41-
while (($line = fgets($socket)) !== false) {
42-
if (rtrim($line) === '') {
41+
while (false !== ($line = fgets($socket))) {
42+
if ('' === rtrim($line)) {
4343
break;
4444
}
4545
$headers[] = trim($line);

0 commit comments

Comments
 (0)