@@ -170,7 +170,7 @@ class Response extends AbstractMessage implements ResponseInterface
170170 public static function fromString ($ string )
171171 {
172172 $ lines = explode ("\r\n" , $ string );
173- if (!is_array ($ lines ) || count ($ lines ) == 1 ) {
173+ if (!is_array ($ lines ) || count ($ lines ) === 1 ) {
174174 $ lines = explode ("\n" , $ string );
175175 }
176176
@@ -190,15 +190,15 @@ public static function fromString($string)
190190 $ response ->setStatusCode ($ matches ['status ' ]);
191191 $ response ->setReasonPhrase ((isset ($ matches ['reason ' ]) ? $ matches ['reason ' ] : '' ));
192192
193- if (count ($ lines ) == 0 ) {
193+ if (count ($ lines ) === 0 ) {
194194 return $ response ;
195195 }
196196
197197 $ isHeader = true ;
198198 $ headers = $ content = [];
199199
200200 foreach ($ lines as $ line ) {
201- if ($ isHeader && $ line == '' ) {
201+ if ($ isHeader && $ line === '' ) {
202202 $ isHeader = false ;
203203 continue ;
204204 }
@@ -338,7 +338,7 @@ public function getBody()
338338 $ transferEncoding = $ this ->getHeaders ()->get ('Transfer-Encoding ' );
339339
340340 if (!empty ($ transferEncoding )) {
341- if (strtolower ($ transferEncoding ->getFieldValue ()) == 'chunked ' ) {
341+ if (strtolower ($ transferEncoding ->getFieldValue ()) === 'chunked ' ) {
342342 $ body = $ this ->decodeChunkedBody ($ body );
343343 }
344344 }
@@ -347,9 +347,9 @@ public function getBody()
347347
348348 if (!empty ($ contentEncoding )) {
349349 $ contentEncoding = $ contentEncoding ->getFieldValue ();
350- if ($ contentEncoding =='gzip ' ) {
350+ if ($ contentEncoding === 'gzip ' ) {
351351 $ body = $ this ->decodeGzip ($ body );
352- } elseif ($ contentEncoding == 'deflate ' ) {
352+ } elseif ($ contentEncoding === 'deflate ' ) {
353353 $ body = $ this ->decodeDeflate ($ body );
354354 }
355355 }
@@ -375,7 +375,7 @@ public function isClientError()
375375 */
376376 public function isForbidden ()
377377 {
378- return (403 == $ this ->getStatusCode ());
378+ return (403 === $ this ->getStatusCode ());
379379 }
380380
381381 /**
@@ -559,7 +559,7 @@ protected function decodeDeflate($body)
559559 */
560560 $ zlibHeader = unpack ('n ' , substr ($ body , 0 , 2 ));
561561
562- if ($ zlibHeader [1 ] % 31 == 0 ) {
562+ if ($ zlibHeader [1 ] % 31 === 0 ) {
563563 return gzuncompress ($ body );
564564 }
565565 return gzinflate ($ body );
0 commit comments