* get array object from string * * @NoAdminRequired * @param $array * @param $path * @return array|string|null */
($array, $path)
| 292 | * @return array|string|null |
| 293 | */ |
| 294 | private function get_nested_array_value($array, $path) { |
| 295 | $pathParts = explode('/', $path); |
| 296 | $current = $array; |
| 297 | foreach ($pathParts as $key) { |
| 298 | if (!is_array($current) || !array_key_exists($key, $current)) { |
| 299 | return null; |
| 300 | } |
| 301 | $current = $current[$key]; |
| 302 | } |
| 303 | return $current; |
| 304 | } |
| 305 | } |
no outgoing calls
no test coverage detected