You are here

interface MediaTypeGuesserInterface in Gutenberg 8

Same name and namespace in other branches
  1. 8.2 src/MediaTypeGuesserInterface.php \Drupal\gutenberg\MediaTypeGuesserInterface

Guesses media type of the file.

@package Drupal\gutenberg

Hierarchy

Expanded class hierarchy of MediaTypeGuesserInterface

All classes that implement MediaTypeGuesserInterface

1 file declares its use of MediaTypeGuesserInterface
MediaService.php in src/Service/MediaService.php

File

src/MediaTypeGuesserInterface.php, line 10

Namespace

Drupal\gutenberg
View source
interface MediaTypeGuesserInterface {

  /**
   * Flag for ::guess method, returns all guessed media types.
   */
  const RETURN_ALL = 0;

  /**
   * Flag for ::guess method, returns only one negotiated media type.
   */
  const RETURN_NEGOTIATED = 1;

  /**
   * Guesses all media types based on general mime type.
   *
   * @param \Drupal\gutenberg\string $general_mime_type
   *   General mime type (image, video, audio, ...).
   * @param int $return_option
   *   If self::RETURN_ALL - return all guessed media types.
   *   If self::RETURN_NEGOTIATED - returns only one negotiated media type.
   *
   * @return string|array
   *   The guessed media types.
   */
  public function guess(string $general_mime_type, $return_option = self::RETURN_ALL);

}

Members

Namesort descending Modifiers Type Description Overrides
MediaTypeGuesserInterface::guess public function Guesses all media types based on general mime type. 1
MediaTypeGuesserInterface::RETURN_ALL constant Flag for ::guess method, returns all guessed media types.
MediaTypeGuesserInterface::RETURN_NEGOTIATED constant Flag for ::guess method, returns only one negotiated media type.