mirror of
https://github.com/linuxserver/Heimdall.git
synced 2025-12-02 21:19:58 +09:00
Update composer dependencies
This commit is contained in:
22
vendor/symfony/http-foundation/File/File.php
vendored
22
vendor/symfony/http-foundation/File/File.php
vendored
@@ -13,8 +13,7 @@ namespace Symfony\Component\HttpFoundation\File;
|
||||
|
||||
use Symfony\Component\HttpFoundation\File\Exception\FileException;
|
||||
use Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException;
|
||||
use Symfony\Component\HttpFoundation\File\MimeType\ExtensionGuesser;
|
||||
use Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesser;
|
||||
use Symfony\Component\Mime\MimeTypes;
|
||||
|
||||
/**
|
||||
* A file in the file system.
|
||||
@@ -50,33 +49,28 @@ class File extends \SplFileInfo
|
||||
*
|
||||
* @return string|null The guessed extension or null if it cannot be guessed
|
||||
*
|
||||
* @see ExtensionGuesser
|
||||
* @see MimeTypes
|
||||
* @see getMimeType()
|
||||
*/
|
||||
public function guessExtension()
|
||||
{
|
||||
$type = $this->getMimeType();
|
||||
$guesser = ExtensionGuesser::getInstance();
|
||||
|
||||
return $guesser->guess($type);
|
||||
return MimeTypes::getDefault()->getExtensions($this->getMimeType())[0] ?? null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the mime type of the file.
|
||||
*
|
||||
* The mime type is guessed using a MimeTypeGuesser instance, which uses finfo(),
|
||||
* mime_content_type() and the system binary "file" (in this order), depending on
|
||||
* which of those are available.
|
||||
* The mime type is guessed using a MimeTypeGuesserInterface instance,
|
||||
* which uses finfo_file() then the "file" system binary,
|
||||
* depending on which of those are available.
|
||||
*
|
||||
* @return string|null The guessed mime type (e.g. "application/pdf")
|
||||
*
|
||||
* @see MimeTypeGuesser
|
||||
* @see MimeTypes
|
||||
*/
|
||||
public function getMimeType()
|
||||
{
|
||||
$guesser = MimeTypeGuesser::getInstance();
|
||||
|
||||
return $guesser->guess($this->getPathname());
|
||||
return MimeTypes::getDefault()->guessMimeType($this->getPathname());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user