Skip to content

Commit 44ecdec

Browse files
committed
add readonly to properties
1 parent 4c9386a commit 44ecdec

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/CorsMiddleware.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ final class CorsMiddleware implements MiddlewareInterface
1919
* @param array<string> $exposeHeaders
2020
*/
2121
public function __construct(
22-
private ResponseFactoryInterface $responseFactory,
23-
private OriginNegotiatorInterface $originNegotiator,
24-
private MethodNegotiatorInterface $methodNegotiator,
25-
private HeadersNegotiatorInterface $headersNegotiator,
26-
private array $exposeHeaders = [],
27-
private bool $allowCredentials = false,
28-
private int $maxAge = 600
22+
private readonly ResponseFactoryInterface $responseFactory,
23+
private readonly OriginNegotiatorInterface $originNegotiator,
24+
private readonly MethodNegotiatorInterface $methodNegotiator,
25+
private readonly HeadersNegotiatorInterface $headersNegotiator,
26+
private readonly array $exposeHeaders = [],
27+
private readonly bool $allowCredentials = false,
28+
private readonly int $maxAge = 600
2929
) {}
3030

3131
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface

src/Negotiation/Origin/AllowOriginExact.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
final class AllowOriginExact implements AllowOriginInterface
88
{
9-
public function __construct(private string $value) {}
9+
public function __construct(private readonly string $value) {}
1010

1111
public function match(string $origin): bool
1212
{

src/Negotiation/Origin/AllowOriginRegex.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
final class AllowOriginRegex implements AllowOriginInterface
88
{
9-
public function __construct(private string $pattern) {}
9+
public function __construct(private readonly string $pattern) {}
1010

1111
public function match(string $origin): bool
1212
{

0 commit comments

Comments
 (0)