Conditions | 4 |
Paths | 4 |
Total Lines | 16 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 3 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
49 | protected function parseResponseBody($body) |
||
50 | { |
||
51 | if (empty($body)) { |
||
52 | throw new \Exception('No response recieved'); |
||
53 | } |
||
54 | |||
55 | if (\is_string($body)) { |
||
56 | $this->status = 'success'; |
||
57 | $this->statusCode = '200'; |
||
|
|||
58 | $this->shorturl = $url; |
||
1 ignored issue
–
show
|
|||
59 | |||
60 | return; |
||
61 | } |
||
62 | |||
63 | foreach ((array) $body as $key => $value) { |
||
64 | $this->{$key} = $value; |
||
65 | } |
||
68 |
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.