You are here

public function MimeMapManager::isMapClassValid in Sophron 8

Determines if a FQCN is a valid map class.

Map classes muste extend from FileEye\MimeMap\Map\AbstractMap.

Parameters

string $map_class: A FQCN.

Return value

bool TRUE if valid, FALSE otherwise.

Overrides MimeMapManagerInterface::isMapClassValid

1 call to MimeMapManager::isMapClassValid()
MimeMapManager::getMapClass in src/MimeMapManager.php
Gets the FQCN of map currently in use by the manager.

File

src/MimeMapManager.php, line 91

Class

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

Namespace

Drupal\sophron

Code

public function isMapClassValid($map_class) {
  if (class_exists($map_class) && in_array(AbstractMap::class, class_parents($map_class))) {
    return TRUE;
  }
  return FALSE;
}