package and depencies

This commit is contained in:
RafficMohammed
2023-01-08 02:57:24 +05:30
parent d5332eb421
commit 1d54b8bc7f
4309 changed files with 193331 additions and 172289 deletions

View File

@@ -25,12 +25,12 @@ class MigratingSessionHandler implements \SessionHandlerInterface, \SessionUpdat
/**
* @var \SessionHandlerInterface&\SessionUpdateTimestampHandlerInterface
*/
private $currentHandler;
private \SessionHandlerInterface $currentHandler;
/**
* @var \SessionHandlerInterface&\SessionUpdateTimestampHandlerInterface
*/
private $writeOnlyHandler;
private \SessionHandlerInterface $writeOnlyHandler;
public function __construct(\SessionHandlerInterface $currentHandler, \SessionHandlerInterface $writeOnlyHandler)
{
@@ -45,11 +45,7 @@ class MigratingSessionHandler implements \SessionHandlerInterface, \SessionUpdat
$this->writeOnlyHandler = $writeOnlyHandler;
}
/**
* @return bool
*/
#[\ReturnTypeWillChange]
public function close()
public function close(): bool
{
$result = $this->currentHandler->close();
$this->writeOnlyHandler->close();
@@ -57,11 +53,7 @@ class MigratingSessionHandler implements \SessionHandlerInterface, \SessionUpdat
return $result;
}
/**
* @return bool
*/
#[\ReturnTypeWillChange]
public function destroy($sessionId)
public function destroy(string $sessionId): bool
{
$result = $this->currentHandler->destroy($sessionId);
$this->writeOnlyHandler->destroy($sessionId);
@@ -69,11 +61,7 @@ class MigratingSessionHandler implements \SessionHandlerInterface, \SessionUpdat
return $result;
}
/**
* @return int|false
*/
#[\ReturnTypeWillChange]
public function gc($maxlifetime)
public function gc(int $maxlifetime): int|false
{
$result = $this->currentHandler->gc($maxlifetime);
$this->writeOnlyHandler->gc($maxlifetime);
@@ -81,11 +69,7 @@ class MigratingSessionHandler implements \SessionHandlerInterface, \SessionUpdat
return $result;
}
/**
* @return bool
*/
#[\ReturnTypeWillChange]
public function open($savePath, $sessionName)
public function open(string $savePath, string $sessionName): bool
{
$result = $this->currentHandler->open($savePath, $sessionName);
$this->writeOnlyHandler->open($savePath, $sessionName);
@@ -93,21 +77,13 @@ class MigratingSessionHandler implements \SessionHandlerInterface, \SessionUpdat
return $result;
}
/**
* @return string
*/
#[\ReturnTypeWillChange]
public function read($sessionId)
public function read(string $sessionId): string
{
// No reading from new handler until switch-over
return $this->currentHandler->read($sessionId);
}
/**
* @return bool
*/
#[\ReturnTypeWillChange]
public function write($sessionId, $sessionData)
public function write(string $sessionId, string $sessionData): bool
{
$result = $this->currentHandler->write($sessionId, $sessionData);
$this->writeOnlyHandler->write($sessionId, $sessionData);
@@ -115,21 +91,13 @@ class MigratingSessionHandler implements \SessionHandlerInterface, \SessionUpdat
return $result;
}
/**
* @return bool
*/
#[\ReturnTypeWillChange]
public function validateId($sessionId)
public function validateId(string $sessionId): bool
{
// No reading from new handler until switch-over
return $this->currentHandler->validateId($sessionId);
}
/**
* @return bool
*/
#[\ReturnTypeWillChange]
public function updateTimestamp($sessionId, $sessionData)
public function updateTimestamp(string $sessionId, string $sessionData): bool
{
$result = $this->currentHandler->updateTimestamp($sessionId, $sessionData);
$this->writeOnlyHandler->updateTimestamp($sessionId, $sessionData);