function Convert::validateArguments

Same name in other branches
  1. 9 core/modules/system/src/Plugin/ImageToolkit/Operation/gd/Convert.php \Drupal\system\Plugin\ImageToolkit\Operation\gd\Convert::validateArguments()
  2. 8.9.x core/modules/system/src/Plugin/ImageToolkit/Operation/gd/Convert.php \Drupal\system\Plugin\ImageToolkit\Operation\gd\Convert::validateArguments()
  3. 10 core/modules/system/src/Plugin/ImageToolkit/Operation/gd/Convert.php \Drupal\system\Plugin\ImageToolkit\Operation\gd\Convert::validateArguments()

Overrides ImageToolkitOperationBase::validateArguments

File

core/modules/system/src/Plugin/ImageToolkit/Operation/gd/Convert.php, line 34

Class

Convert
Defines GD2 convert operation.

Namespace

Drupal\system\Plugin\ImageToolkit\Operation\gd

Code

protected function validateArguments(array $arguments) {
    if (!in_array($arguments['extension'], $this->getToolkit()
        ->getSupportedExtensions())) {
        throw new \InvalidArgumentException("Invalid extension ({$arguments['extension']}) specified for the image 'convert' operation");
    }
    return $arguments;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.