| Total Complexity | 9 |
| Total Lines | 38 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | class ProcessorConfig |
||
| 12 | { |
||
| 13 | protected bool $createThumb = true; |
||
| 14 | protected bool $wantLimitSize = false; |
||
| 15 | protected bool $wantLimitExt = false; |
||
| 16 | protected string $defaultExt = 'jpg'; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @param array<string, string|int> $params |
||
| 20 | * @return $this |
||
| 21 | */ |
||
| 22 | 7 | public function setData(array $params = []): self |
|
| 23 | { |
||
| 24 | 7 | $this->createThumb = isset($params['create_thumb']) ? boolval(intval(strval($params['create_thumb']))) : $this->createThumb; |
|
| 25 | 7 | $this->wantLimitSize = isset($params['want_limit_size']) ? boolval(intval(strval($params['want_limit_size']))) : $this->wantLimitSize; |
|
| 26 | 7 | $this->wantLimitExt = isset($params['want_limit_ext']) ? boolval(intval(strval($params['want_limit_ext']))) : $this->wantLimitExt; |
|
| 27 | 7 | $this->defaultExt = !empty($params['default_ext']) ? strval($params['default_ext']) : $this->defaultExt; |
|
| 28 | 7 | return $this; |
|
| 29 | } |
||
| 30 | |||
| 31 | 3 | public function getDefaultExt(): string |
|
| 32 | { |
||
| 33 | 3 | return $this->defaultExt; |
|
| 34 | } |
||
| 35 | |||
| 36 | 3 | public function canLimitExt(): bool |
|
| 37 | { |
||
| 38 | 3 | return $this->wantLimitExt; |
|
| 39 | } |
||
| 40 | |||
| 41 | 3 | public function canLimitSize(): bool |
|
| 44 | } |
||
| 45 | |||
| 46 | 3 | public function hasThumb(): bool |
|
| 47 | { |
||
| 51 |