public function generateContentType($extension)
    {
        if (!in_array($extension, InvalidExtensionException::getValidExtensions())) {
            throw InvalidExtensionException::fromExtension($extension);
        }

        return sprintf('image/%s', $extension == self::DEFAULT_EXTENSION ? 'jpeg' : $extension);
    }
public function generateContentType($extension)
    {
        if (!in_array($extension, InvalidExtensionException::getValidExtensions())) {
            throw InvalidExtensionException::fromExtension($extension);
        }

        return sprintf('image/%s', $extension == self::DEFAULT_EXTENSION ? 'jpeg' : $extension);
    }
public function generateContentType ( $ extension ) { if ( ! in_array ( $ extension , InvalidExtensionException :: getValidExtensions ( ) ) ) { throw InvalidExtensionException :: fromExtension ( $ extension ) ; } return sprintf ( 'image/%s' , $ extension == self :: DEFAULT_EXTENSION ? 'jpeg' : $ extension ) ; }
Generates the content-type corresponding to the provided extension
@param $extension
@return string
@throws InvalidExtensionException
Generates the content - type corresponding to the provided extension