From aaa636f3572fa8136b7da16ffbaed9931e6a4123 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Thu, 4 Jun 2020 14:31:22 -0600 Subject: [PATCH] cleaner handling of cropZoom Signed-off-by: Andy Miller --- system/src/Grav/Common/Page/Medium/ImageMedium.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/system/src/Grav/Common/Page/Medium/ImageMedium.php b/system/src/Grav/Common/Page/Medium/ImageMedium.php index 1925bef81..13c142aba 100644 --- a/system/src/Grav/Common/Page/Medium/ImageMedium.php +++ b/system/src/Grav/Common/Page/Medium/ImageMedium.php @@ -516,6 +516,15 @@ class ImageMedium extends Medium return $this; } + /** + * Handle this commonly used variant + */ + public function cropZoom() + { + $this->__call('zoomCrop', func_get_args()); + return $this; + } + /** * Forward the call to the image processing method. * @@ -525,10 +534,6 @@ class ImageMedium extends Medium */ public function __call($method, $args) { - if ($method === 'cropZoom') { - $method = 'zoomCrop'; - } - if (!\in_array($method, self::$magic_actions, true)) { return parent::__call($method, $args); }