Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing types #405

Merged
merged 1 commit into from
Nov 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Manipulators/BaseManipulator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/Manipulators/Helpers/Color.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.')';
}
Expand Down
2 changes: 1 addition & 1 deletion src/Manipulators/ManipulatorInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ interface ManipulatorInterface
*
* @return $this
*/
public function setParams(array $params);
public function setParams(array $params): static;

/**
* Get a specific manipulation param.
Expand Down
2 changes: 1 addition & 1 deletion src/Manipulators/Size.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/Responses/PsrResponseFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/Responses/ResponseFactoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ interface ResponseFactoryInterface
*
* @return mixed The response object.
*/
public function create(FilesystemOperator $cache, $path);
public function create(FilesystemOperator $cache, string $path);
}
2 changes: 1 addition & 1 deletion src/Signatures/Signature.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Loading