| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 2 |
| Changes | 2 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 27 | 5 | public function __construct(Dialogue $dialogue) |
|
| 28 | { |
||
| 29 | 5 | $this->dialogue = $dialogue; |
|
| 30 | |||
| 31 | 5 | $response = explode("\n", $dialogue->getLog()); |
|
| 32 | 5 | $response = array_shift($response); |
|
| 33 | 5 | if (preg_match('/^(\d{3})(.+)/', $response, $match)) { |
|
| 34 | 3 | parent::__construct(trim($match[2]), (int) $match[1]); |
|
| 35 | } else { |
||
| 36 | 2 | parent::__construct(trim($response), 500); |
|
| 37 | } |
||
| 38 | 5 | } |
|
| 39 | |||
| 48 |