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

Update to latest PHP 8.1 syntax #33

Merged
merged 1 commit into from
Nov 3, 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
4 changes: 2 additions & 2 deletions src/CsrfMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ class CsrfMiddleware implements MiddlewareInterface
public const GUARD_ATTRIBUTE = 'csrf';

public function __construct(
private CsrfGuardFactoryInterface $guardFactory,
private string $attributeKey = self::GUARD_ATTRIBUTE
private readonly CsrfGuardFactoryInterface $guardFactory,
private readonly string $attributeKey = self::GUARD_ATTRIBUTE
) {
}

Expand Down
2 changes: 1 addition & 1 deletion src/FlashCsrfGuard.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

class FlashCsrfGuard implements CsrfGuardInterface
{
public function __construct(private FlashMessagesInterface $flashMessages)
public function __construct(private readonly FlashMessagesInterface $flashMessages)
{
}

Expand Down
2 changes: 1 addition & 1 deletion src/FlashCsrfGuardFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

class FlashCsrfGuardFactory implements CsrfGuardFactoryInterface
{
public function __construct(private string $attributeKey = FlashMessageMiddleware::FLASH_ATTRIBUTE)
public function __construct(private readonly string $attributeKey = FlashMessageMiddleware::FLASH_ATTRIBUTE)
{
}

Expand Down
2 changes: 1 addition & 1 deletion src/SessionCsrfGuard.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

class SessionCsrfGuard implements CsrfGuardInterface
{
public function __construct(private SessionInterface $session)
public function __construct(private readonly SessionInterface $session)
{
}

Expand Down
2 changes: 1 addition & 1 deletion src/SessionCsrfGuardFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

class SessionCsrfGuardFactory implements CsrfGuardFactoryInterface
{
public function __construct(private string $attributeKey = SessionMiddleware::SESSION_ATTRIBUTE)
public function __construct(private readonly string $attributeKey = SessionMiddleware::SESSION_ATTRIBUTE)
{
}

Expand Down