You are here

protected function Replace::validateArguments in Image Replace 8

Same name in this branch
  1. 8 src/Plugin/ImageToolkit/Operation/gd/Replace.php \Drupal\image_replace\Plugin\ImageToolkit\Operation\gd\Replace::validateArguments()
  2. 8 src/Plugin/ImageToolkit/Operation/imagemagick/Replace.php \Drupal\image_replace\Plugin\ImageToolkit\Operation\imagemagick\Replace::validateArguments()

File

src/Plugin/ImageToolkit/Operation/imagemagick/Replace.php, line 36

Class

Replace
Defines Imagegemagick image_replace operation.

Namespace

Drupal\image_replace\Plugin\ImageToolkit\Operation\imagemagick

Code

protected function validateArguments(array $arguments) {
  if (!($arguments['replacement_image'] instanceof ImageInterface || !$arguments['replacement_image']
    ->getToolkit() instanceof ImagemagickToolkit)) {
    throw new \InvalidArgumentException("Invalid replacement image specified for the 'image_replace' operation.");
  }
  return $arguments;
}