You are here

protected function InterlaceTrait::validateArguments in Image Effects 8.3

Same name and namespace in other branches
  1. 8 src/Plugin/ImageToolkit/Operation/InterlaceTrait.php \Drupal\image_effects\Plugin\ImageToolkit\Operation\InterlaceTrait::validateArguments()
  2. 8.2 src/Plugin/ImageToolkit/Operation/InterlaceTrait.php \Drupal\image_effects\Plugin\ImageToolkit\Operation\InterlaceTrait::validateArguments()

File

src/Plugin/ImageToolkit/Operation/InterlaceTrait.php, line 26

Class

InterlaceTrait
Base trait for image_effects Interlace operations.

Namespace

Drupal\image_effects\Plugin\ImageToolkit\Operation

Code

protected function validateArguments(array $arguments) {

  // Assure interlace type is valid.
  if (!$arguments['type'] || !in_array($arguments['type'], [
    'Line',
    'Plane',
  ])) {
    throw new \InvalidArgumentException("Invalid type '{$arguments['type']}' specified for the image 'interlace' operation");
  }
  return $arguments;
}