Skip to content

Commit

Permalink
fixed typos
Browse files Browse the repository at this point in the history
  • Loading branch information
deluxetom committed Dec 17, 2024
1 parent eacb31f commit 964e40c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions src/Api/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
class Api implements ApiInterface
{
public const GLOBAL_API_PARAMS = [
'p', // presets
'p', // preset
'q', // quality
'fm', // format
's', // signature
Expand Down Expand Up @@ -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));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Manipulators/BaseManipulator.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function getParam(string $name): mixed
/**
* Get the names of the manipulator API parameters.
*
* @rerun list<string>
* @return list<string>
*/
abstract public function getApiParams(): array;

Expand Down
2 changes: 1 addition & 1 deletion src/Manipulators/ManipulatorInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function getParam(string $name): mixed;
/**
* Get the names of the manipulator API parameters.
*
* @rerun list<string>
* @return list<string>
*/
public function getApiParams(): array;

Expand Down

0 comments on commit 964e40c

Please sign in to comment.