| Total Complexity | 5 |
| Total Lines | 35 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | class EncodedMap implements EncodedMapInterface |
||
| 12 | { |
||
| 13 | private StuConfigInterface $stuConfig; |
||
| 14 | |||
| 15 | private ?string $key = null; |
||
| 16 | |||
| 17 | 2 | public function __construct(StuConfigInterface $stuConfig) |
|
| 20 | } |
||
| 21 | |||
| 22 | 2 | public function getEncodedMapPath(int $mapFieldType, LayerInterface $layer): string |
|
| 23 | { |
||
| 24 | 2 | $key = $this->getKey(); |
|
| 25 | |||
| 26 | 1 | return sprintf( |
|
| 27 | 1 | '%d/encoded/%s.png', |
|
| 28 | 1 | $layer->getId(), |
|
| 29 | 1 | implode("/", str_split(bin2hex(base64_encode(crypt((string)$mapFieldType, $key))), 8)) |
|
|
|
|||
| 30 | 1 | ); |
|
| 31 | } |
||
| 32 | |||
| 33 | 2 | private function getKey(): string |
|
| 46 | } |
||
| 47 | } |
||
| 48 |