Skip to content

Commit

Permalink
Merge pull request #59 from samsonasik/update-to-php81-syntax
Browse files Browse the repository at this point in the history
Update to use PHP 8.1 syntax
  • Loading branch information
gsteel authored Nov 3, 2024
2 parents 53d8c8c + 5bd5c16 commit 253158d
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/CacheSessionPersistence.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,7 @@ class CacheSessionPersistence implements InitializePersistenceIdInterface, Sessi
use CacheHeadersGeneratorTrait;
use SessionCookieAwareTrait;

private CacheItemPoolInterface $cache;

private bool $persistent;
private bool $autoRegenerate;

/**
* Prepare session cache and default HTTP caching headers.
Expand Down Expand Up @@ -74,7 +71,7 @@ class CacheSessionPersistence implements InitializePersistenceIdInterface, Sessi
* @todo reorder the constructor arguments
*/
public function __construct(
CacheItemPoolInterface $cache,
private CacheItemPoolInterface $cache,
string $cookieName,
string $cookiePath = '/',
string $cacheLimiter = 'nocache',
Expand All @@ -85,10 +82,8 @@ public function __construct(
bool $cookieSecure = false,
bool $cookieHttpOnly = false,
string $cookieSameSite = 'Lax',
bool $autoRegenerate = true
private bool $autoRegenerate = true
) {
$this->cache = $cache;

if (empty($cookieName)) {
throw new Exception\InvalidArgumentException('Session cookie name must not be empty');
}
Expand Down Expand Up @@ -117,8 +112,6 @@ public function __construct(
: $this->getLastModified();

$this->persistent = $persistent;

$this->autoRegenerate = $autoRegenerate;
}

public function initializeSessionFromRequest(ServerRequestInterface $request): SessionInterface
Expand Down

0 comments on commit 253158d

Please sign in to comment.