public function listContents($directory = '', $recursive = false)
    {
        $files = [];
        foreach($this->listDirContents($directory) as $k => $file) {
            $pathInfo = pathinfo($file['key']);
            $files[] = array_merge($pathInfo, $this->normalizeData($file), [
                'type' => isset($pathInfo['extension']) ? 'file' : 'dir',
            ]);
        }
        return $files;
    }
public function listContents($directory = '', $recursive = false)
    {
        $files = [];
        foreach($this->listDirContents($directory) as $k => $file) {
            $pathInfo = pathinfo($file['key']);
            $files[] = array_merge($pathInfo, $this->normalizeData($file), [
                'type' => isset($pathInfo['extension']) ? 'file' : 'dir',
            ]);
        }
        return $files;
    }
public function listContents ( $ directory = '' , $ recursive = false ) { $ files = [ ] ; foreach ( $ this -> listDirContents ( $ directory ) as $ k => $ file ) { $ pathInfo = pathinfo ( $ file [ 'key' ] ) ; $ files [ ] = array_merge ( $ pathInfo , $ this -> normalizeData ( $ file ) , [ 'type' => isset ( $ pathInfo [ 'extension' ] ) ? 'file' : 'dir' , ] ) ; } return $ files ; }
List contents of a directory

@param string $directory
@param bool $recursive
@return array
List contents of a directory