@@ -170,7 +170,7 @@ class Response extends AbstractMessage implements ResponseInterface
170
170
public static function fromString ($ string )
171
171
{
172
172
$ lines = explode ("\r\n" , $ string );
173
- if (!is_array ($ lines ) || count ($ lines ) == 1 ) {
173
+ if (!is_array ($ lines ) || count ($ lines ) === 1 ) {
174
174
$ lines = explode ("\n" , $ string );
175
175
}
176
176
@@ -190,15 +190,15 @@ public static function fromString($string)
190
190
$ response ->setStatusCode ($ matches ['status ' ]);
191
191
$ response ->setReasonPhrase ((isset ($ matches ['reason ' ]) ? $ matches ['reason ' ] : '' ));
192
192
193
- if (count ($ lines ) == 0 ) {
193
+ if (count ($ lines ) === 0 ) {
194
194
return $ response ;
195
195
}
196
196
197
197
$ isHeader = true ;
198
198
$ headers = $ content = [];
199
199
200
200
foreach ($ lines as $ line ) {
201
- if ($ isHeader && $ line == '' ) {
201
+ if ($ isHeader && $ line === '' ) {
202
202
$ isHeader = false ;
203
203
continue ;
204
204
}
@@ -338,7 +338,7 @@ public function getBody()
338
338
$ transferEncoding = $ this ->getHeaders ()->get ('Transfer-Encoding ' );
339
339
340
340
if (!empty ($ transferEncoding )) {
341
- if (strtolower ($ transferEncoding ->getFieldValue ()) == 'chunked ' ) {
341
+ if (strtolower ($ transferEncoding ->getFieldValue ()) === 'chunked ' ) {
342
342
$ body = $ this ->decodeChunkedBody ($ body );
343
343
}
344
344
}
@@ -347,9 +347,9 @@ public function getBody()
347
347
348
348
if (!empty ($ contentEncoding )) {
349
349
$ contentEncoding = $ contentEncoding ->getFieldValue ();
350
- if ($ contentEncoding =='gzip ' ) {
350
+ if ($ contentEncoding === 'gzip ' ) {
351
351
$ body = $ this ->decodeGzip ($ body );
352
- } elseif ($ contentEncoding == 'deflate ' ) {
352
+ } elseif ($ contentEncoding === 'deflate ' ) {
353
353
$ body = $ this ->decodeDeflate ($ body );
354
354
}
355
355
}
@@ -375,7 +375,7 @@ public function isClientError()
375
375
*/
376
376
public function isForbidden ()
377
377
{
378
- return (403 == $ this ->getStatusCode ());
378
+ return (403 === $ this ->getStatusCode ());
379
379
}
380
380
381
381
/**
@@ -559,7 +559,7 @@ protected function decodeDeflate($body)
559
559
*/
560
560
$ zlibHeader = unpack ('n ' , substr ($ body , 0 , 2 ));
561
561
562
- if ($ zlibHeader [1 ] % 31 == 0 ) {
562
+ if ($ zlibHeader [1 ] % 31 === 0 ) {
563
563
return gzuncompress ($ body );
564
564
}
565
565
return gzinflate ($ body );
0 commit comments