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