diff --git a/src/flextype/app/Foundation/Media/MediaFiles.php b/src/flextype/app/Foundation/Media/MediaFiles.php index a83f06e7..e98c8e26 100644 --- a/src/flextype/app/Foundation/Media/MediaFiles.php +++ b/src/flextype/app/Foundation/Media/MediaFiles.php @@ -269,7 +269,6 @@ class MediaFiles $result = []; if (Filesystem::has($this->flextype['media_files_meta']->getFileMetaLocation($path))) { - $result = $this->flextype['yaml']->decode(Filesystem::read($this->flextype['media_files_meta']->getFileMetaLocation($path))); $result['filename'] = pathinfo(str_replace('/.meta', '', $this->flextype['media_files_meta']->getFileMetaLocation($path)))['filename']; @@ -354,12 +353,8 @@ class MediaFiles */ public function delete(string $id) : bool { - if (Filesystem::delete($this->getFileLocation($id)) && - Filesystem::delete($this->flextype['media_files_meta']->getFileMetaLocation($id))) { - return true; - } - - return false; + return Filesystem::delete($this->getFileLocation($id)) && + Filesystem::delete($this->flextype['media_files_meta']->getFileMetaLocation($id)); } /** @@ -373,12 +368,8 @@ class MediaFiles */ public function has(string $id) : bool { - if (Filesystem::has($this->getFileLocation($id)) && - Filesystem::has($this->flextype['media_files_meta']->getFileMetaLocation($id))) { - return true; - } - - return false; + return Filesystem::has($this->getFileLocation($id)) && + Filesystem::has($this->flextype['media_files_meta']->getFileMetaLocation($id)); } /** diff --git a/src/flextype/app/Foundation/Media/MediaFolders.php b/src/flextype/app/Foundation/Media/MediaFolders.php index 3ba29715..be16bab2 100644 --- a/src/flextype/app/Foundation/Media/MediaFolders.php +++ b/src/flextype/app/Foundation/Media/MediaFolders.php @@ -37,7 +37,7 @@ class MediaFolders /** * Fetch folders(s) * - * @param string $path The path of directory to list. + * @param string $path The path of directory to list. * @param bool $collection Set `true` if collection of folders need to be fetched. * * @return array A list of file(s) metadata. @@ -149,12 +149,8 @@ class MediaFolders */ public function delete(string $id) : bool { - if (Filesystem::deleteDir($this->getDirLocation($id)) && - Filesystem::deleteDir($this->flextype['media_folders_meta']->getDirMetaLocation($id))) { - return true; - } - - return false; + return Filesystem::deleteDir($this->getDirLocation($id)) && + Filesystem::deleteDir($this->flextype['media_folders_meta']->getDirMetaLocation($id)); } /**