You are here

interface MimeMapManagerInterface in Sophron 8

Provides an interface for FileMapManager.

Hierarchy

Expanded class hierarchy of MimeMapManagerInterface

All classes that implement MimeMapManagerInterface

4 files declare their use of MimeMapManagerInterface
SettingsForm.php in src/Form/SettingsForm.php
SophronApiTest.php in tests/src/Kernel/SophronApiTest.php
SophronMimeTypeGuesser.php in sophron_guesser/src/SophronMimeTypeGuesser.php
SophronTest.php in tests/src/Functional/SophronTest.php

File

src/MimeMapManagerInterface.php, line 8

Namespace

Drupal\sophron
View source
interface MimeMapManagerInterface {

  /**
   * Option to use Sophron's Drupal-compatible map.
   */
  const DRUPAL_MAP = 0;

  /**
   * Option to use MimeMap's default map.
   */
  const DEFAULT_MAP = 1;

  /**
   * Option to use a custom defined map.
   */
  const CUSTOM_MAP = 99;

  /**
   * Determines if a FQCN is a valid map class.
   *
   * Map classes muste extend from FileEye\MimeMap\Map\AbstractMap.
   *
   * @param string $map_class
   *   A FQCN.
   *
   * @return bool
   *   TRUE if valid, FALSE otherwise.
   */
  public function isMapClassValid($map_class);

  /**
   * Gets the FQCN of map currently in use by the manager.
   *
   * @return string
   *   A FQCN.
   */
  public function getMapClass();

  /**
   * Sets the map class to use by the manager.
   *
   * @param string $map_class
   *   A FQCN.
   *
   * @return $this
   */
  public function setMapClass($map_class);

  /**
   * Gets the initialization errors of a map class.
   *
   * @param string $map_class
   *   A FQCN.
   *
   * @return array
   *   The array of mapping errors.
   */
  public function getMappingErrors($map_class);

  /**
   * Gets the list of MIME types.
   *
   * @return string[]
   *   A simple array of MIME type strings.
   */
  public function listTypes();

  /**
   * Gets a MIME type.
   *
   * @param string $type
   *   A MIME type string.
   *
   * @return \FileEye\MimeMap\Type
   *   A Type object.
   *
   * @see \FileEye\MimeMap\Type
   */
  public function getType($type);

  /**
   * Gets the list of file extensions.
   *
   * @return string[]
   *   A simple array of file extension strings.
   */
  public function listExtensions();

  /**
   * Gets a file extension.
   *
   * @param string $extension
   *   A file extension string.
   *
   * @return \FileEye\MimeMap\Extension
   *   An Extension object.
   *
   * @see \FileEye\MimeMap\Extension
   */
  public function getExtension($extension);

  /**
   * Check installation requirements and do status reporting.
   *
   * @param string $phase
   *   The phase in which requirements are checked.
   *
   * @return array
   *   An associative array of requirements.
   */
  public function requirements($phase);

}

Members

Namesort descending Modifiers Type Description Overrides
MimeMapManagerInterface::CUSTOM_MAP constant Option to use a custom defined map.
MimeMapManagerInterface::DEFAULT_MAP constant Option to use MimeMap's default map.
MimeMapManagerInterface::DRUPAL_MAP constant Option to use Sophron's Drupal-compatible map.
MimeMapManagerInterface::getExtension public function Gets a file extension. 1
MimeMapManagerInterface::getMapClass public function Gets the FQCN of map currently in use by the manager. 1
MimeMapManagerInterface::getMappingErrors public function Gets the initialization errors of a map class. 1
MimeMapManagerInterface::getType public function Gets a MIME type. 1
MimeMapManagerInterface::isMapClassValid public function Determines if a FQCN is a valid map class. 1
MimeMapManagerInterface::listExtensions public function Gets the list of file extensions. 1
MimeMapManagerInterface::listTypes public function Gets the list of MIME types. 1
MimeMapManagerInterface::requirements public function Check installation requirements and do status reporting. 1
MimeMapManagerInterface::setMapClass public function Sets the map class to use by the manager. 1