Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
| Total | |
0.00% |
0 / 1 |
|
66.67% |
2 / 3 |
CRAP | |
66.67% |
2 / 3 |
| THistogram | |
0.00% |
0 / 1 |
|
66.67% |
2 / 3 |
3.33 | |
66.67% |
2 / 3 |
| getHistogramSequence | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
|||
| getHistogramMin | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
|||
| getHistogramMax | |
0.00% |
0 / 1 |
2.00 | |
0.00% |
0 / 1 |
|||
| <?php | |
| namespace Rasb14\T100; | |
| /** | |
| * Histogram trait implementing IHistogram. | |
| */ | |
| trait THistogram | |
| { | |
| /** | |
| * @var array $sequence The numbers stored in sequence. | |
| */ | |
| private $sequence = []; | |
| /** | |
| * Get the sequence. | |
| * | |
| * @return array as the sequence. | |
| */ | |
| public function getHistogramSequence() | |
| { | |
| return $this->sequence; | |
| } | |
| /** | |
| * Gets the minimum value for the histogram. | |
| * | |
| * @return int as the minimum value. | |
| */ | |
| public function getHistogramMin() | |
| { | |
| return 1; | |
| } | |
| /** | |
| * Gets the maximum value for the histogram. | |
| * | |
| * @return int as the maximum value. | |
| */ | |
| public function getHistogramMax() | |
| { | |
| return max($this->sequence); | |
| } | |
| } |