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