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