diff --git a/core/lib/Drupal/Core/Image/Image.php b/core/lib/Drupal/Core/Image/Image.php index 9cca6fc..90e72fa 100644 --- a/core/lib/Drupal/Core/Image/Image.php +++ b/core/lib/Drupal/Core/Image/Image.php @@ -283,14 +283,24 @@ protected function processInfo() { } /** - * Calls specific toolkit operation to be performed against the image. + * Passes through calls that represent image toolkit operations onto the + * image toolkit. + * + * By implementing this magic method, image operations are accessible directly + * from the Image object as if it were methods of \Drupal\Core\Image\Image. + * For example next calls can be performed on an Image object: + * @code + * $image = new Image($path, $toolkit); + * $image->scale(50, 100); + * $image->rotate(30); + * @endcode */ - public function __call($name, $arguments) { - if (is_callable(array($this->toolkit, $name))) { + public function __call($method, $arguments) { + if (is_callable(array($this->toolkit, $method))) { // @todo In https://drupal.org/node/2073759, call_user_func_array() will - // be replaced by $this->toolkit->process($name, $this, $arguments). + // be replaced by $this->toolkit->apply($name, $this, $arguments). array_unshift($arguments, $this); - return call_user_func_array(array($this->toolkit, $name), $arguments); + return call_user_func_array(array($this->toolkit, $method), $arguments); } throw new \BadMethodCallException(); }