Total Complexity | 3 |
Total Lines | 25 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
18 | class ArrayDirKey implements IKey |
||
19 | { |
||
20 | use TLang; |
||
21 | |||
22 | /** @var string */ |
||
23 | protected $prefix = ''; |
||
24 | |||
25 | /** |
||
26 | * @param string[] $prefix |
||
27 | * @param IStTranslations|null $lang |
||
28 | * @throws StorageException |
||
29 | */ |
||
30 | 2 | public function __construct(array $prefix, ?IStTranslations $lang = null) |
|
31 | { |
||
32 | 2 | $this->setStLang($lang); |
|
33 | 2 | if ($pt = realpath(implode(DIRECTORY_SEPARATOR, $prefix))) { |
|
34 | 1 | $this->prefix = strval($pt); |
|
35 | } else { |
||
36 | 1 | throw new StorageException($this->getStLang()->stPathNotFound()); |
|
37 | } |
||
38 | 1 | } |
|
39 | |||
40 | 1 | public function fromSharedKey(string $key): string |
|
43 | } |
||
44 | } |
||
45 |