| Total Complexity | 3 |
| Total Lines | 24 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | class KVs extends ArrayObject |
||
| 15 | { |
||
| 16 | use SVersions; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * KVs constructor. |
||
| 20 | * @param string $path |
||
| 21 | * @param array $data |
||
| 22 | */ |
||
| 23 | public function __construct(string $path, array $data) |
||
| 24 | { |
||
| 25 | foreach ($data as $kv) { |
||
| 26 | $this->offsetSet($this->withoutPath($path, $kv['Key']), base64_decode($kv['Value'])); |
||
| 27 | } |
||
| 28 | } |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @param string $path |
||
| 32 | * @param string $key |
||
| 33 | * @return string |
||
| 34 | */ |
||
| 35 | private function withoutPath(string $path, string $key) : string |
||
| 38 | } |
||
| 39 | } |
||
| 40 |