You are here

public function ExtensionGuesser::guess in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/http-foundation/File/MimeType/ExtensionGuesser.php \Symfony\Component\HttpFoundation\File\MimeType\ExtensionGuesser::guess()

Tries to guess the extension.

The mime type is passed to each registered mime type guesser in reverse order of their registration (last registered is queried first). Once a guesser returns a value that is not NULL, this method terminates and returns the value.

Parameters

string $mimeType The mime type:

Return value

string The guessed extension or NULL, if none could be guessed

Overrides ExtensionGuesserInterface::guess

File

vendor/symfony/http-foundation/File/MimeType/ExtensionGuesser.php, line 88

Class

ExtensionGuesser
A singleton mime type to file extension guesser.

Namespace

Symfony\Component\HttpFoundation\File\MimeType

Code

public function guess($mimeType) {
  foreach ($this->guessers as $guesser) {
    if (null !== ($extension = $guesser
      ->guess($mimeType))) {
      return $extension;
    }
  }
}