| Total Complexity | 11 |
| Total Lines | 41 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 5 | class TwicPicsParamsProcessor extends AbstractParamsProcessor |
||
| 6 | { |
||
| 7 | protected $cropFit; |
||
| 8 | |||
| 9 | public function finalizeParams() |
||
| 10 | { |
||
| 11 | if ($this->format) { |
||
| 12 | $this->params['output'] = $this->format; |
||
| 13 | } |
||
| 14 | |||
| 15 | if ($this->quality) { |
||
| 16 | $this->params['quality'] = $this->quality; |
||
| 17 | } |
||
| 18 | |||
| 19 | if ($this->width || $this->height) { |
||
| 20 | $this->width = $this->width ?: '-'; |
||
| 21 | $this->height = $this->height ?: '-'; |
||
| 22 | |||
| 23 | if ($this->cropFit) { |
||
| 24 | $this->params['crop'] = "{$this->width}x{$this->height}"; |
||
| 25 | } else { |
||
| 26 | $this->params['resize'] = "{$this->width}x{$this->height}"; |
||
| 27 | } |
||
| 28 | } |
||
| 29 | |||
| 30 | return $this->params; |
||
| 31 | } |
||
| 32 | |||
| 33 | protected function handleParamFit($key, $value) |
||
| 46 | } |
||
| 47 | } |
||
| 48 |