You are here

protected function Rotate::arguments in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/system/src/Plugin/ImageToolkit/Operation/gd/Rotate.php \Drupal\system\Plugin\ImageToolkit\Operation\gd\Rotate::arguments()
  2. 10 core/modules/system/src/Plugin/ImageToolkit/Operation/gd/Rotate.php \Drupal\system\Plugin\ImageToolkit\Operation\gd\Rotate::arguments()

Returns the definition of the operation arguments.

Image toolkit operation implementers must implement this method to "document" their operation, thus also if no arguments are expected.

Return value

array An array whose keys are the names of the arguments (e.g. "width", "degrees") and each value is an associative array having the following keys:

  • description: A string with the argument description. This is used only internally for documentation purposes, so it does not need to be translatable.
  • required: (optional) A boolean indicating if this argument should be provided or not. Defaults to TRUE.
  • default: (optional) When the argument is set to "required" = FALSE, this must be set to a default value. Ignored for "required" = TRUE arguments.

Overrides ImageToolkitOperationBase::arguments

File

core/modules/system/src/Plugin/ImageToolkit/Operation/gd/Rotate.php, line 23

Class

Rotate
Defines GD2 rotate operation.

Namespace

Drupal\system\Plugin\ImageToolkit\Operation\gd

Code

protected function arguments() {
  return [
    'degrees' => [
      'description' => 'The number of (clockwise) degrees to rotate the image',
    ],
    'background' => [
      'description' => "A string specifying the hexadecimal color code to use as background for the uncovered area of the image after the rotation. E.g. '#000000' for black, '#ff00ff' for magenta, and '#ffffff' for white. For images that support transparency, this will default to transparent white",
      'required' => FALSE,
      'default' => NULL,
    ],
  ];
}