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