protected function ImagemagickIdentify::validateKey in ImageMagick 8.2
Same name and namespace in other branches
- 8.3 src/Plugin/FileMetadata/ImagemagickIdentify.php \Drupal\imagemagick\Plugin\FileMetadata\ImagemagickIdentify::validateKey()
Validates a file metadata key.
Return value
bool TRUE if the key is valid.
Throws
\Drupal\file_mdm\FileMetadataException In case the key is invalid.
3 calls to ImagemagickIdentify::validateKey()
- ImagemagickIdentify::doGetMetadata in src/
Plugin/ FileMetadata/ ImagemagickIdentify.php - ImagemagickIdentify::doRemoveMetadata in src/
Plugin/ FileMetadata/ ImagemagickIdentify.php - ImagemagickIdentify::doSetMetadata in src/
Plugin/ FileMetadata/ ImagemagickIdentify.php
File
- src/
Plugin/ FileMetadata/ ImagemagickIdentify.php, line 140
Class
- ImagemagickIdentify
- FileMetadata plugin for ImageMagick's identify results.
Namespace
Drupal\imagemagick\Plugin\FileMetadataCode
protected function validateKey($key, $method) {
if (!is_string($key)) {
throw new FileMetadataException("Invalid metadata key specified", $this
->getPluginId(), $method);
}
if (!in_array($key, $this
->getSupportedKeys(), TRUE)) {
throw new FileMetadataException("Invalid metadata key '{$key}' specified", $this
->getPluginId(), $method);
}
return TRUE;
}