Skip to content

Commit

Permalink
Resolved #40, clean
Browse files Browse the repository at this point in the history
  • Loading branch information
dusta committed Sep 7, 2022
1 parent 8faca0d commit 67d9d99
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions src/Storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,8 @@ public function getConfig($key = null)
*/
public function drop($adapter, $file)
{

$get = $this->driver->get($adapter, $file, true);
if(empty($get['file_path'])){
if (empty($get['file_path'])) {
throw new FileNotFoundException(FileNotFoundException::FILE_NOT_FOUND_MESSAGE);
}

Expand Down Expand Up @@ -197,18 +196,6 @@ public function put($adapter, $tmpName, $pathImage, $forced = false)
return ['fileId' => $get['file_id']];
}

/**
* Get $filename mine
*/
public function getFileMine($file)
{
$finfo = finfo_open(FILEINFO_MIME_TYPE);
$mime = finfo_file($finfo, $file['tmp_name']); //Walidacja Mine
finfo_close($finfo);

return $mime;
}

/**
* @param $file
* @param $extensions
Expand All @@ -233,4 +220,16 @@ public function isAllowedFile($file, array $allowedTypes, array $allowedExtensio

return true;
}

/**
* Get $filename mine
*/
public function getFileMine($file)
{
$finfo = finfo_open(FILEINFO_MIME_TYPE);
$mime = finfo_file($finfo, $file['tmp_name']); //Walidacja Mine
finfo_close($finfo);

return $mime;
}
}

0 comments on commit 67d9d99

Please sign in to comment.