private function removeBrokenFiles(array $files)
    {
        // Recursive logic to replace broken arrays with empty ones (which to be removed later)
        if (isset($files['error'])) {
            return $files['error'] == 4 ? array() : $files;
        }

        foreach ($files as $key => $value) {
            // Recursive call
            $files[$key] = call_user_func(array($this, __FUNCTION__), $value);
        }

        // Now remove empty arrays
        return array_filter($files);
    }
private function removeBrokenFiles(array $files)
    {
        // Recursive logic to replace broken arrays with empty ones (which to be removed later)
        if (isset($files['error'])) {
            return $files['error'] == 4 ? array() : $files;
        }

        foreach ($files as $key => $value) {
            // Recursive call
            $files[$key] = call_user_func(array($this, __FUNCTION__), $value);
        }

        // Now remove empty arrays
        return array_filter($files);
    }
private function removeBrokenFiles ( array $ files ) { // Recursive logic to replace broken arrays with empty ones (which to be removed later) if ( isset ( $ files [ 'error' ] ) ) { return $ files [ 'error' ] == 4 ? array ( ) : $ files ; } foreach ( $ files as $ key => $ value ) { // Recursive call $ files [ $ key ] = call_user_func ( array ( $ this , __FUNCTION__ ) , $ value ) ; } // Now remove empty arrays return array_filter ( $ files ) ; }
Remove broken ones from target array
A broken file is empty one

@param array $files Remapped files array
@return array
Remove broken ones from target array A broken file is empty one