From 964e40c4345ba870d4840ee8d60596b78c26cb7b Mon Sep 17 00:00:00 2001 From: Thomas Date: Tue, 17 Dec 2024 09:15:20 -0600 Subject: [PATCH] fixed typos --- src/Api/Api.php | 12 ++++++------ src/Manipulators/BaseManipulator.php | 2 +- src/Manipulators/ManipulatorInterface.php | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Api/Api.php b/src/Api/Api.php index 12ef681..9aef3ba 100644 --- a/src/Api/Api.php +++ b/src/Api/Api.php @@ -12,7 +12,7 @@ class Api implements ApiInterface { public const GLOBAL_API_PARAMS = [ - 'p', // presets + 'p', // preset 'q', // quality 'fm', // format 's', // signature @@ -139,15 +139,15 @@ public function encode(ImageInterface $image, array $params): string */ public function setApiParams(): array { - $params = []; + $this->apiParams = self::GLOBAL_API_PARAMS; - array_walk($this->manipulators, function (ManipulatorInterface $manipulator) use (&$params) { + foreach ($this->manipulators as $manipulator) { foreach ($manipulator->getApiParams() as $param) { - $params[] = $param; + $this->apiParams[] = $param; } - }); + } - return $this->apiParams = array_values(array_unique(array_merge(self::GLOBAL_API_PARAMS, $params))); + return $this->apiParams = array_values(array_unique($this->apiParams)); } /** diff --git a/src/Manipulators/BaseManipulator.php b/src/Manipulators/BaseManipulator.php index ac658ed..1c734f4 100644 --- a/src/Manipulators/BaseManipulator.php +++ b/src/Manipulators/BaseManipulator.php @@ -40,7 +40,7 @@ public function getParam(string $name): mixed /** * Get the names of the manipulator API parameters. * - * @rerun list + * @return list */ abstract public function getApiParams(): array; diff --git a/src/Manipulators/ManipulatorInterface.php b/src/Manipulators/ManipulatorInterface.php index 27d473e..9e58d41 100644 --- a/src/Manipulators/ManipulatorInterface.php +++ b/src/Manipulators/ManipulatorInterface.php @@ -25,7 +25,7 @@ public function getParam(string $name): mixed; /** * Get the names of the manipulator API parameters. * - * @rerun list + * @return list */ public function getApiParams(): array;