| Total Complexity | 7 |
| Total Lines | 68 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | final class ArrayTyposStorage implements ITyposStorage |
||
| 16 | { |
||
| 17 | /** |
||
| 18 | * @var array |
||
| 19 | */ |
||
| 20 | private $list; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @var string |
||
| 24 | */ |
||
| 25 | private $originalWord; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @return string |
||
| 29 | */ |
||
| 30 | public function getOriginalWord(): string |
||
| 33 | } |
||
| 34 | |||
| 35 | public function __construct(string $originalWord) |
||
| 36 | { |
||
| 37 | $this->originalWord = $originalWord; |
||
| 38 | $this->list = []; |
||
| 39 | } |
||
| 40 | |||
| 41 | /** |
||
| 42 | * Add new typos to list |
||
| 43 | * @param string $typos |
||
| 44 | */ |
||
| 45 | public function addTypos(string $typos) |
||
| 46 | { |
||
| 47 | $this->list[] = $typos; |
||
| 48 | $this->list = array_unique($this->list); |
||
| 49 | } |
||
| 50 | |||
| 51 | /** |
||
| 52 | * Add list of typos to storage |
||
| 53 | * @param array $typos |
||
| 54 | */ |
||
| 55 | public function addList(array $typos) { |
||
| 58 | } |
||
| 59 | |||
| 60 | /** |
||
| 61 | * Return list of typos in collection |
||
| 62 | * @return array |
||
| 63 | */ |
||
| 64 | public function getList(): array |
||
| 65 | { |
||
| 66 | return $this->list; |
||
| 67 | } |
||
| 68 | |||
| 69 | /** |
||
| 70 | * Return count of typos in collection |
||
| 71 | * @return int |
||
| 72 | */ |
||
| 73 | public function getCount(): int |
||
| 74 | { |
||
| 75 | return count($this->list); |
||
| 76 | } |
||
| 77 | |||
| 78 | /** |
||
| 79 | * Remove storage from memory |
||
| 80 | */ |
||
| 81 | public function remove() |
||
| 83 | /** Not needed in this storage */ |
||
| 84 | } |
||
| 85 | } |