| Total Complexity | 5 |
| Total Lines | 33 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | trait TStorage |
||
| 11 | { |
||
| 12 | protected ?Storage $storage = null; |
||
| 13 | |||
| 14 | 2 | public function setStorage(?ITarget $storage = null): self |
|
| 15 | { |
||
| 16 | 2 | $this->storage = new Storage($storage); |
|
| 17 | 2 | $this->storage->setAlias(strval($this->getAlias())); |
|
| 18 | 2 | return $this; |
|
| 19 | } |
||
| 20 | |||
| 21 | /** |
||
| 22 | * Check if data is set inside storage |
||
| 23 | * @throws StorageException |
||
| 24 | * @return bool |
||
| 25 | */ |
||
| 26 | 1 | public function isStored(): bool |
|
| 29 | } |
||
| 30 | |||
| 31 | /** |
||
| 32 | * Delete form data in storage |
||
| 33 | * @throws StorageException |
||
| 34 | */ |
||
| 35 | 1 | public function deleteStored(): void |
|
| 39 | } |
||
| 40 | 1 | } |
|
| 41 | |||
| 42 | abstract public function getAlias(): ?string; |
||
| 43 | } |
||
| 44 |