* This file is part of the Symfony package.
* (c) Fabien Potencier <fabien@symfony.com>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
namespace Symfony\Component\Mime;
use Symfony\Component\Mime\Exception\InvalidArgumentException;
use Symfony\Component\Mime\Exception\LogicException;
* Guesses the MIME type using the PECL extension FileInfo.
* @author Bernhard Schussek <bschussek@gmail.com>
class FileinfoMimeTypeGuesser implements MimeTypeGuesserInterface
* @param string $magicFile A magic file to use with the finfo instance
* @see http://www.php.net/manual/en/function.finfo-open.php
public function __construct(string $magicFile = null)
$this->magicFile = $magicFile;
public function isGuesserSupported(): bool
return \function_exists('finfo_open');