Conditions | 7 |
Paths | 7 |
Total Lines | 27 |
Code Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Tests | 17 |
CRAP Score | 7 |
Changes | 0 |
1 | <?php |
||
39 | 6 | public function __construct(array $histogram = []) |
|
40 | { |
||
41 | 6 | foreach ($histogram as $key => $value) { |
|
42 | switch ($key) { |
||
43 | 5 | case '75thPercentile': |
|
44 | 5 | $this->percentile75th = $value; |
|
45 | 5 | break; |
|
46 | |||
47 | 5 | case '95thPercentile': |
|
48 | 5 | $this->percentile95th = $value; |
|
49 | 5 | break; |
|
50 | |||
51 | 5 | case '98thPercentile': |
|
52 | 5 | $this->percentile98th = $value; |
|
53 | 5 | break; |
|
54 | |||
55 | 5 | case '99thPercentile': |
|
56 | 5 | $this->percentile99th = $value; |
|
57 | 5 | break; |
|
58 | |||
59 | default: |
||
60 | 5 | if (property_exists($this, $key)) { |
|
61 | 5 | $this->{$key} = $value; |
|
62 | } |
||
63 | } |
||
64 | } |
||
65 | 6 | } |
|
66 | } |
||
67 |