Skip to content

Commit

Permalink
Merge pull request #405 from thephpleague/chore/types
Browse files Browse the repository at this point in the history
Add missing types
  • Loading branch information
ADmad authored Nov 9, 2024
2 parents 3db66b0 + b083745 commit 89a262f
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
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

0 comments on commit 89a262f

Please sign in to comment.