diff --git a/src/Manipulators/BaseManipulator.php b/src/Manipulators/BaseManipulator.php index b2f89dc..966fd1a 100644 --- a/src/Manipulators/BaseManipulator.php +++ b/src/Manipulators/BaseManipulator.php @@ -20,7 +20,7 @@ abstract class BaseManipulator implements ManipulatorInterface * * @return $this */ - public function setParams(array $params) + public function setParams(array $params): static { $this->params = $params; diff --git a/src/Manipulators/Helpers/Color.php b/src/Manipulators/Helpers/Color.php index fe88f44..ca8a187 100644 --- a/src/Manipulators/Helpers/Color.php +++ b/src/Manipulators/Helpers/Color.php @@ -112,7 +112,7 @@ public function parseHex(string $hex): array * * @return string The formatted color. */ - public function formatted() + public function formatted(): string { return 'rgba('.$this->red.', '.$this->green.', '.$this->blue.', '.$this->alpha.')'; } diff --git a/src/Manipulators/ManipulatorInterface.php b/src/Manipulators/ManipulatorInterface.php index 93a4153..be1119f 100644 --- a/src/Manipulators/ManipulatorInterface.php +++ b/src/Manipulators/ManipulatorInterface.php @@ -15,7 +15,7 @@ interface ManipulatorInterface * * @return $this */ - public function setParams(array $params); + public function setParams(array $params): static; /** * Get a specific manipulation param. diff --git a/src/Manipulators/Size.php b/src/Manipulators/Size.php index 9ab127b..5581662 100644 --- a/src/Manipulators/Size.php +++ b/src/Manipulators/Size.php @@ -172,7 +172,7 @@ public function resolveMissingDimensions(ImageInterface $image, ?int $width = nu * * @return int[] The modified width and height. */ - public function applyDpr(int $width, int $height, float $dpr) + public function applyDpr(int $width, int $height, float $dpr): array { $width = $width * $dpr; $height = $height * $dpr; diff --git a/src/Responses/PsrResponseFactory.php b/src/Responses/PsrResponseFactory.php index 0c725a9..0cb6d4b 100644 --- a/src/Responses/PsrResponseFactory.php +++ b/src/Responses/PsrResponseFactory.php @@ -39,7 +39,7 @@ public function __construct(ResponseInterface $response, \Closure $streamCallbac * * @return ResponseInterface Response object. */ - public function create(FilesystemOperator $cache, $path) + public function create(FilesystemOperator $cache, string $path): ResponseInterface { $stream = $this->streamCallback->__invoke( $cache->readStream($path) diff --git a/src/Responses/ResponseFactoryInterface.php b/src/Responses/ResponseFactoryInterface.php index 48dc650..f9ddeb1 100644 --- a/src/Responses/ResponseFactoryInterface.php +++ b/src/Responses/ResponseFactoryInterface.php @@ -16,5 +16,5 @@ interface ResponseFactoryInterface * * @return mixed The response object. */ - public function create(FilesystemOperator $cache, $path); + public function create(FilesystemOperator $cache, string $path); } diff --git a/src/Signatures/Signature.php b/src/Signatures/Signature.php index 5c366c9..d7f96c9 100644 --- a/src/Signatures/Signature.php +++ b/src/Signatures/Signature.php @@ -61,7 +61,7 @@ public function validateRequest(string $path, array $params): void * * @return string The generated HTTP signature. */ - public function generateSignature(string $path, array $params) + public function generateSignature(string $path, array $params): string { unset($params['s']); ksort($params);