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