Conditions | 4 |
Paths | 6 |
Total Lines | 16 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 20 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
23 | public function setBody($body) |
||
24 | { |
||
25 | switch ($this->type) { |
||
26 | case self::TYPE_INT: |
||
27 | $error = !is_numeric($body); |
||
28 | break; |
||
29 | case self::TYPE_STRING: |
||
30 | default: |
||
31 | $error = !is_string($body); |
||
32 | break; |
||
33 | } |
||
34 | if ($error) { |
||
35 | throw new InvalidResponseException($this->command, $body); |
||
36 | } |
||
37 | parent::setBody($body); |
||
38 | } |
||
39 | } |