| Conditions | 7 |
| Paths | 6 |
| Total Lines | 20 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | public function scale(SplFileInfo $sourceFile, Image $imageObject) : array { |
||
| 18 | $width = $imageObject->getWidth(); |
||
| 19 | $height = $imageObject->getHeight(); |
||
| 20 | $sizes = []; |
||
| 21 | |||
| 22 | if ($this->includeSource && (!$this->maxWidth || $width <= $this->maxWidth)) { |
||
| 23 | $sizes[$width] = $height; |
||
| 24 | } |
||
| 25 | |||
| 26 | while ($width >= $this->minWidth) { |
||
| 27 | $width = floor($width * $this->stepModifier); |
||
| 28 | $height = floor($height * $this->stepModifier); |
||
| 29 | |||
| 30 | if (!$this->maxWidth || $width <= $this->maxWidth) { |
||
| 31 | $sizes[(int) $width] = $height; |
||
| 32 | } |
||
| 33 | } |
||
| 34 | |||
| 35 | return $sizes; |
||
| 36 | } |
||
| 37 | } |
||
| 38 |