You are here

public function MimeMapManager::getExtension in Sophron 8

Gets a file extension.

Parameters

string $extension: A file extension string.

Return value

\FileEye\MimeMap\Extension An Extension object.

Overrides MimeMapManagerInterface::getExtension

See also

\FileEye\MimeMap\Extension

File

src/MimeMapManager.php, line 175

Class

MimeMapManager
Provides a sensible mapping between filename extensions and MIME types.

Namespace

Drupal\sophron

Code

public function getExtension($extension) {
  try {
    return new Extension($extension, $this
      ->getMapClass());
  } catch (MappingException $e) {
    return NULL;
  }
}