public function flatten(?string $key = null) : array
    {
        $array = new \RecursiveIteratorIterator(
            new \RecursiveArrayIterator((array) $this->get($key))
        );

        $tmp = [];
        foreach ($array as $value) {
            $tmp[] = $value;
        }

        return $tmp;
    }
public function flatten(?string $key = null) : array
    {
        $array = new \RecursiveIteratorIterator(
            new \RecursiveArrayIterator((array) $this->get($key))
        );

        $tmp = [];
        foreach ($array as $value) {
            $tmp[] = $value;
        }

        return $tmp;
    }
public function flatten ( ? string $ key = null ) : array { $ array = new \ RecursiveIteratorIterator ( new \ RecursiveArrayIterator ( ( array ) $ this -> get ( $ key ) ) ) ; $ tmp = [ ] ; foreach ( $ array as $ value ) { $ tmp [ ] = $ value ; } return $ tmp ; }
Flattens multi-dimensional array.

@param string|null $key

@return array
Flattens multi - dimensional array .