* get array object from string * * @NoAdminRequired * @param $array * @param $path * @return array|string|null */
($array, $path)
| 257 | * @return array|string|null |
| 258 | */ |
| 259 | private function get_nested_array_value($array, $path) { |
| 260 | $pathParts = explode('/', $path); |
| 261 | $current = $array; |
| 262 | foreach ($pathParts as $key) { |
| 263 | if (!is_array($current) || !array_key_exists($key, $current)) { |
| 264 | return null; |
| 265 | } |
| 266 | $current = $current[$key]; |
| 267 | } |
| 268 | return $current; |
| 269 | } |
| 270 | } |
no outgoing calls
no test coverage detected