Maybe it would make more sense to have $folder being either a string (the path) or the id.
Because if you pass $fileId the $folder argument is useless.

Either this or make another method "getFolderContentsById($fileId)" which is called by "getFolderContents($folder)