From 19ebc8854eb219188aa699711b3aa6ee13f68280 Mon Sep 17 00:00:00 2001 From: Luke Towers Date: Tue, 25 Aug 2020 11:06:38 -0600 Subject: [PATCH] Remove unnecessary $sourceDisk & $sourcePath variables. The $resizer instance provides access to the necessary data. --- modules/system/classes/ImageResizer.php | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/modules/system/classes/ImageResizer.php b/modules/system/classes/ImageResizer.php index ab7bf848e..2e5570ac5 100644 --- a/modules/system/classes/ImageResizer.php +++ b/modules/system/classes/ImageResizer.php @@ -261,13 +261,9 @@ class ImageResizer * Halting event that enables replacement of the resizing process. There should only ever be * one listener handling this event per project at most, as other listeners would be ignored. * - * > **NOTE:** The `$sourceDisk` and `$sourcePath` variables are only provided for informational - * purposes, i.e. logging errors. They should never be interacted with directly, only interact - * with the `$localTempPath` variable. - * * Example usage: * - * Event::listen('system.resizer.processResize', function ((\System\Classes\ImageResizer) $resizer, (string) $localTempPath, (\Illuminate\Filesystem\FilesystemAdapter) $sourceDisk, (string) $sourcePath) { + * Event::listen('system.resizer.processResize', function ((\System\Classes\ImageResizer) $resizer, (string) $localTempPath) { * // Get the resizing configuration * $config = $resizer->getConfig(); * @@ -282,7 +278,7 @@ class ImageResizer * }); * */ - $processed = Event::fire('system.resizer.processResize', [$this, $tempPath, $disk, $path], true); + $processed = Event::fire('system.resizer.processResize', [$this, $tempPath], true); if (!$processed) { // Process the resize with the default image resizer DefaultResizer::open($tempPath) @@ -295,13 +291,9 @@ class ImageResizer * Enables post processing of resized images after they've been resized before the * resizing process is finalized (ex. adding watermarks, further optimizing, etc) * - * > **NOTE:** The `$sourceDisk` and `$sourcePath` variables are only provided for informational - * purposes, i.e. logging errors. They should never be interacted with directly, only interact - * with the `$localTempPath` variable. - * * Example usage: * - * Event::listen('system.resizer.afterResize', function ((\System\Classes\ImageResizer) $resizer, (string) $localTempPath, (\Illuminate\Filesystem\FilesystemAdapter) $disk, (string) $path)) { + * Event::listen('system.resizer.afterResize', function ((\System\Classes\ImageResizer) $resizer, (string) $localTempPath) { * // Get the resized image data * $resizedImageContents = file_get_contents($localTempPath); * @@ -313,7 +305,7 @@ class ImageResizer * }); * */ - Event::fire('system.resizer.afterResize', [$this, $tempPath, $disk, $path]); + Event::fire('system.resizer.afterResize', [$this, $tempPath]); // Store the resized image $disk->put($path, file_get_contents($tempPath));