protected function ImagemagickArgumentsTrait::validateArguments in Image Effects 8.3
Same name and namespace in other branches
- 8 src/Plugin/ImageToolkit/Operation/ImagemagickArgumentsTrait.php \Drupal\image_effects\Plugin\ImageToolkit\Operation\ImagemagickArgumentsTrait::validateArguments()
- 8.2 src/Plugin/ImageToolkit/Operation/ImagemagickArgumentsTrait.php \Drupal\image_effects\Plugin\ImageToolkit\Operation\ImagemagickArgumentsTrait::validateArguments()
File
- src/
Plugin/ ImageToolkit/ Operation/ ImagemagickArgumentsTrait.php, line 30
Class
- ImagemagickArgumentsTrait
- Base trait for ImageMagick arguments operations.
Namespace
Drupal\image_effects\Plugin\ImageToolkit\OperationCode
protected function validateArguments(array $arguments) {
// Ensure 'width' is NULL or a positive integer.
$arguments['width'] = $arguments['width'] !== NULL ? (int) $arguments['width'] : NULL;
if ($arguments['width'] !== NULL && $arguments['width'] <= 0) {
throw new \InvalidArgumentException("Invalid width ('{$arguments['width']}') specified for the image 'imagemagick_arguments' operation");
}
// Ensure 'height' is NULL or a positive integer.
$arguments['height'] = $arguments['height'] !== NULL ? (int) $arguments['height'] : NULL;
if ($arguments['height'] !== NULL && $arguments['height'] <= 0) {
throw new \InvalidArgumentException("Invalid height ('{$arguments['height']}') specified for the image 'imagemagick_arguments' operation");
}
return $arguments;
}