Skip to content

Commit

Permalink
Merge pull request #21 from samsonasik/apply-php80
Browse files Browse the repository at this point in the history
Apply PHP 8.0 Syntax and constructor promotion
  • Loading branch information
Ocramius authored Oct 15, 2022
2 parents 6558c59 + 12f3ce4 commit bd0d3fc
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/AuthorizationMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,11 @@

class AuthorizationMiddleware implements MiddlewareInterface
{
private AuthorizationInterface $authorization;

/** @var callable */
private $responseFactory;

public function __construct(AuthorizationInterface $authorization, callable $responseFactory)
public function __construct(private AuthorizationInterface $authorization, callable $responseFactory)
{
$this->authorization = $authorization;

// Ensures type safety of the composed factory
$this->responseFactory = static fn(): ResponseInterface => $responseFactory();
}
Expand Down

0 comments on commit bd0d3fc

Please sign in to comment.