You are here

protected function NormalizerBase::checkFormat in Schemata 8

Checks if the provided format is supported by this normalizer.

Parameters

string $format: The format to check.

Return value

bool TRUE if the format is supported, FALSE otherwise. If no format is specified this will return TRUE.

Overrides NormalizerBase::checkFormat

File

src/Normalizer/NormalizerBase.php, line 80

Class

NormalizerBase
Base class for JSON Schema Normalizers.

Namespace

Drupal\schemata\Normalizer

Code

protected function checkFormat($format = NULL) {
  if (!isset($format) || !isset($this->format)) {
    return TRUE;
  }
  $parts = explode(':', $format);
  return $parts[0] == $this->format && isset($parts[1]) && $this->describedFormat == $parts[1];
}