| Total Complexity | 9 |
| Total Lines | 44 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | final class ActiveRelation |
||
| 12 | { |
||
| 13 | public function __construct(public array $data = []) |
||
| 14 | { |
||
| 15 | } |
||
| 16 | |||
| 17 | public function add(string $key, mixed $value): void |
||
| 20 | } |
||
| 21 | |||
| 22 | public function clear(): void |
||
| 23 | { |
||
| 24 | $this->data = []; |
||
| 25 | } |
||
| 26 | |||
| 27 | public function get(string $key): mixed |
||
| 28 | { |
||
| 29 | return DbArrayHelper::getValueByPath($this->data, $key); |
||
| 30 | } |
||
| 31 | |||
| 32 | public function has(string $key): bool |
||
| 33 | { |
||
| 34 | return array_key_exists($key, $this->data); |
||
| 35 | } |
||
| 36 | |||
| 37 | public function keys(): array |
||
| 38 | { |
||
| 39 | return array_keys($this->data); |
||
| 40 | } |
||
| 41 | |||
| 42 | public function set(string $key, mixed $value): void |
||
| 43 | { |
||
| 44 | ActiveArrayHelper::set($this->data, $key, $value); |
||
| 45 | } |
||
| 46 | |||
| 47 | public function remove(string $key): void |
||
| 48 | { |
||
| 49 | ActiveArrayHelper::remove($this->data, $key); |
||
| 50 | } |
||
| 51 | |||
| 52 | public function toArray(): array |
||
| 55 | } |
||
| 56 | } |
||
| 57 |