| Conditions | 6 |
| Paths | 7 |
| Total Lines | 17 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 6 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 26 | 13 | public function __construct() |
|
| 27 | { |
||
| 28 | 13 | parent::__construct(); |
|
| 29 | |||
| 30 | 13 | foreach ($this->labels as $label) { |
|
| 31 | 11 | if (preg_match('/^quantile$/', $label)) { |
|
| 32 | 1 | throw new LabelException('The label `quantile` is used internally to designate summary quantiles.'); |
|
| 33 | } |
||
| 34 | } |
||
| 35 | |||
| 36 | 12 | foreach ($this->quantiles as $quantile) { |
|
| 37 | 12 | if ($quantile < 0 || $quantile > 1) { |
|
| 38 | 1 | throw new PrometheusException('Quantiles have to be in the range between 0 and 1.'); |
|
| 39 | } |
||
| 40 | } |
||
| 41 | |||
| 42 | 11 | sort($this->quantiles); |
|
| 43 | 11 | } |
|
| 81 |