Conditions | 2 |
Paths | 2 |
Total Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
21 | 4 | public function getVariations(ScaleableImage $scaleableImage): array |
|
22 | { |
||
23 | 4 | $width = $scaleableImage->getWidth(); |
|
24 | 4 | $height = $scaleableImage->getHeight(); |
|
25 | 4 | $ratio = $width / $height; |
|
26 | 4 | $variations = []; |
|
27 | |||
28 | 4 | foreach ($this->fixedWidths as $fixedWidth) { |
|
29 | 4 | $variations[$fixedWidth] = round($fixedWidth * $ratio); |
|
30 | } |
||
31 | |||
32 | 4 | return $variations; |
|
33 | } |
||
34 | } |
||
35 |