Conditions | 4 |
Paths | 4 |
Total Lines | 21 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
24 | public function __construct($response) |
||
25 | { |
||
26 | $response = explode('|', $response); |
||
27 | |||
28 | $this->matched = $response[0] === 'Y'; |
||
29 | $this->type = $response[1]; |
||
30 | |||
31 | if ($this->type === 'ALL') { |
||
32 | $this->all = (int) $response[2]; |
||
33 | $this->evaluation = $response[3]; |
||
34 | } elseif ($this->type === 'MULTI') { |
||
35 | $response = array_slice($response, 2); |
||
36 | $count = count($response); |
||
37 | |||
38 | for ($index = 0; $index < $count; $index += 2) { |
||
39 | $this->{strtolower($response[$index])} = (int) $response[$index + 1]; |
||
40 | } |
||
41 | } else { |
||
42 | $this->{strtolower($this->type)} = (int) $response[2]; |
||
43 | } |
||
44 | } |
||
45 | |||
86 |