private function narrowArray(array $array, string $key = null)
    {
        if ($key) {
            $key .= '--';
        }

        $result = [];

        foreach ($array as $index => $value) {
            if (is_array($value)) {
                $result = array_merge($result, $this->narrowArray($value, $key . $index));
            } else {
                $result[$key . $index] = $value;
            }
        }

        return $result;
    }
private function narrowArray(array $array, string $key = null)
    {
        if ($key) {
            $key .= '--';
        }

        $result = [];

        foreach ($array as $index => $value) {
            if (is_array($value)) {
                $result = array_merge($result, $this->narrowArray($value, $key . $index));
            } else {
                $result[$key . $index] = $value;
            }
        }

        return $result;
    }
private function narrowArray ( array $ array , string $ key = null ) { if ( $ key ) { $ key .= '--' ; } $ result = [ ] ; foreach ( $ array as $ index => $ value ) { if ( is_array ( $ value ) ) { $ result = array_merge ( $ result , $ this -> narrowArray ( $ value , $ key . $ index ) ) ; } else { $ result [ $ key . $ index ] = $ value ; } } return $ result ; }
Narrows PHP's native nested map into a non-nested map.

@param mixed[] $array
The nested map to narrow.
@param string|null $key
The parent key.
@return string[] Narrowed map.
Narrows PHP s native nested map into a non - nested map .