Conditions | 1 |
Paths | 1 |
Total Lines | 12 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
29 | public function __construct(Collection $ivs) |
||
30 | { |
||
31 | $this->ivs = $ivs->map(function (IV $iv) { |
||
32 | $iv->perfection = $this->calculatePerfection($iv); |
||
33 | |||
34 | return $iv; |
||
35 | })->sortBy('perfection'); |
||
36 | |||
37 | $this->max = $this->ivs->first()->perfection; |
||
38 | $this->min = $this->ivs->last()->perfection; |
||
39 | $this->avg = round($this->ivs->average('perfection'), 2); |
||
40 | } |
||
41 | |||
86 |