| Conditions | 4 |
| Paths | 4 |
| Total Lines | 16 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 3 | ||
| 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 | |||
| 62 | return; |
||
| 63 | } |
||
| 64 | |||
| 65 | foreach ((array) $body as $key => $value) { |
||
| 66 | $this->{$key} = $value; |
||
| 67 | } |
||
| 72 |
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.