protected function formatFileInfo($fileInfo)
    {
        if(empty($fileInfo) || !is_array($fileInfo) || isset($fileInfo[0])){
            return $fileInfo;
        }

        $file = [];
        foreach ($fileInfo as $key => $value){
            if(is_array($value)){
                foreach ($value as $k => $v){
                    $file[$k][$key] = $v;
                }
            } else {
                $file[$key] = $value;
            }
        }

        return $file;
    }
protected function formatFileInfo($fileInfo)
    {
        if(empty($fileInfo) || !is_array($fileInfo) || isset($fileInfo[0])){
            return $fileInfo;
        }

        $file = [];
        foreach ($fileInfo as $key => $value){
            if(is_array($value)){
                foreach ($value as $k => $v){
                    $file[$k][$key] = $v;
                }
            } else {
                $file[$key] = $value;
            }
        }

        return $file;
    }
protected function formatFileInfo ( $ fileInfo ) { if ( empty ( $ fileInfo ) || ! is_array ( $ fileInfo ) || isset ( $ fileInfo [ 0 ] ) ) { return $ fileInfo ; } $ file = [ ] ; foreach ( $ fileInfo as $ key => $ value ) { if ( is_array ( $ value ) ) { foreach ( $ value as $ k => $ v ) { $ file [ $ k ] [ $ key ] = $ v ; } } else { $ file [ $ key ] = $ value ; } } return $ file ; }
Format file data for ease of use

@param array|null $fileInfo

@return array
Format file data for ease of use