| Conditions | 4 |
| Paths | 4 |
| Total Lines | 15 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 51 | protected function parseResponseBody($body) |
||
| 52 | { |
||
| 53 | if(empty($body)){ |
||
| 54 | throw new \Exception("No response recieved"); |
||
| 55 | } |
||
| 56 | |||
| 57 | if( \is_string($body)){ |
||
| 58 | $this->status = 'success'; |
||
| 59 | $this->statusCode = '200'; |
||
|
|
|||
| 60 | $this->shorturl = $url; |
||
|
1 ignored issue
–
show
|
|||
| 61 | return; |
||
| 62 | } |
||
| 63 | |||
| 64 | foreach( (array) $body as $key => $value){ |
||
| 65 | $this->{$key} = $value; |
||
| 66 | } |
||
| 71 |
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.