protected function find(array $array, string $key)
    {
        $item = $array;

        foreach (explode('.', $key) as $segment) {
            if (is_array($item) && array_key_exists($segment, $item)) {
                $item = $item[$segment];
            } else {
                throw new \Exception();
            }
        }

        $this->cache[$key] = &$item;

        return $item;
    }
protected function find(array $array, string $key)
    {
        $item = $array;

        foreach (explode('.', $key) as $segment) {
            if (is_array($item) && array_key_exists($segment, $item)) {
                $item = $item[$segment];
            } else {
                throw new \Exception();
            }
        }

        $this->cache[$key] = &$item;

        return $item;
    }
protected function find ( array $ array , string $ key ) { $ item = $ array ; foreach ( explode ( '.' , $ key ) as $ segment ) { if ( is_array ( $ item ) && array_key_exists ( $ segment , $ item ) ) { $ item = $ item [ $ segment ] ; } else { throw new \ Exception ( ) ; } } $ this -> cache [ $ key ] = & $ item ; return $ item ; }
Find a value with its dotted key in an array
@param  array $array
@param  string $key
@return mixed
@throws \Exception if the key is not found
Find a value with its dotted key in an array