@@ -80,7 +80,9 @@ public function getSensiolabVulnerabilties($fileLock)
8080 $ colorTag = $ this ->getColorTagForStatusCode ($ e ->getResponse ()->getStatusCode ());
8181 $ this ->command ->line ("HTTP StatusCode: < {$ colorTag }> " . $ e ->getResponse ()->getStatusCode () . "< {$ colorTag }> " );
8282 $ resp = $ e ->getResponse ();
83- $ this ->printMessage ($ resp === null ? '' : $ resp );
83+ if ($ resp != null ) {
84+ $ this ->printMessage ($ resp );
85+ }
8486 $ this ->printMessage ($ e ->getRequest ());
8587 } catch (\GuzzleHttp \Exception \RequestException $ e ) {
8688 $ this ->command ->error ("RequestException! \nMessage: " . $ e ->getMessage ());
@@ -89,7 +91,9 @@ public function getSensiolabVulnerabilties($fileLock)
8991 $ colorTag = $ this ->getColorTagForStatusCode ($ e ->getResponse ()->getStatusCode ());
9092 $ this ->command ->line ("HTTP StatusCode: < {$ colorTag }> " . $ e ->getResponse ()->getStatusCode () . "< {$ colorTag }> " );
9193 $ resp = $ e ->getResponse ();
92- $ this ->printMessage ($ resp === null ? '' : $ resp );
94+ if ($ resp != null ) {
95+ $ this ->printMessage ($ resp );
96+ }
9397 }
9498 }
9599 return $ response ;
@@ -131,7 +135,7 @@ public function parseVulnerability($name, $vulnerability)
131135 /**
132136 * @param $key
133137 * @param $vulnerability
134- * @param $tuttoOk
138+ * @param bool $tuttoOk
135139 * @return array
136140 */
137141 public function checkResponse ($ key , $ vulnerability , $ tuttoOk )
@@ -146,7 +150,7 @@ public function checkResponse($key, $vulnerability, $tuttoOk)
146150 }
147151
148152 /**
149- * @param $msg
153+ * @param string $msg
150154 * @param bool|false $error
151155 */
152156 private function addVerboseLog ($ msg , $ error = false )
@@ -169,14 +173,13 @@ private function addVerboseLog($msg, $error = false)
169173 private function printMessage (\Psr \Http \Message \MessageInterface $ message )
170174 {
171175 $ type = '' ;
176+ $ body = '' ;
172177 if (is_a ($ message , '\Psr\Http\Message\RequestInterface ' )) {
173178 $ type = 'REQUEST ' ;
174179 $ body = $ message ->getBody ();
175- } else {
176- if (is_a ($ message , '\Psr\Http\Message\ResponseInterface ' )) {
177- $ type = 'RESPONSE ' ;
178- $ body = $ message ->getBody ()->getContents ();
179- }
180+ } elseif (is_a ($ message , '\Psr\Http\Message\ResponseInterface ' )) {
181+ $ type = 'RESPONSE ' ;
182+ $ body = $ message ->getBody ()->getContents ();
180183 }
181184 $ this ->command ->info ("$ type: " );
182185 $ headers = '' ;
@@ -186,10 +189,8 @@ private function printMessage(\Psr\Http\Message\MessageInterface $message)
186189 $ this ->command ->comment ($ headers );
187190 if ($ type == 'REQUEST ' ) {
188191 $ this ->command ->comment ($ body );
189- } else {
190- if ($ type == 'RESPONSE ' ) {
191- $ this ->command ->comment ($ body );
192- }
192+ } elseif ($ type == 'RESPONSE ' ) {
193+ $ this ->command ->comment ($ body );
193194 }
194195 }
195196
0 commit comments