| Total Complexity | 7 |
| Total Lines | 62 |
| Duplicated Lines | 0 % |
| Changes | 5 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 7 | class ImageTransformation implements ArrayAccess |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * @var |
||
| 11 | */ |
||
| 12 | private array $transformation; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * @param array $transformation |
||
| 16 | */ |
||
| 17 | public function __construct(array $transformation) { |
||
| 18 | $this->transformation = $transformation; |
||
| 19 | } |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @param $offset |
||
| 23 | * @return bool |
||
| 24 | */ |
||
| 25 | public function offsetExists($offset) |
||
| 26 | { |
||
| 27 | return isset($this->$transformation[$offset]); |
||
|
|
|||
| 28 | } |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @param $offset |
||
| 32 | * @return mixed|null |
||
| 33 | */ |
||
| 34 | public function offsetGet($offset) |
||
| 35 | { |
||
| 36 | return $this->transformation[$offset] ?? null; |
||
| 37 | } |
||
| 38 | |||
| 39 | /** |
||
| 40 | * @param $offset |
||
| 41 | * @param $value |
||
| 42 | * @return void |
||
| 43 | */ |
||
| 44 | public function offsetSet($offset, $value) |
||
| 45 | { |
||
| 46 | if (is_null($offset)) { |
||
| 47 | $this->transformation[] = $value; |
||
| 48 | } else { |
||
| 49 | $this->transformation[$offset] = $value; |
||
| 50 | } |
||
| 51 | } |
||
| 52 | |||
| 53 | /** |
||
| 54 | * @param $offset |
||
| 55 | * @return void |
||
| 56 | */ |
||
| 57 | public function offsetUnset($offset) |
||
| 60 | } |
||
| 61 | |||
| 62 | /** |
||
| 63 | * Allows direct access to the Image Transformer object and it’s __toString |
||
| 64 | * |
||
| 65 | * @return string |
||
| 66 | */ |
||
| 67 | public function __toString() { |
||
| 69 | } |
||
| 70 | } |