cleaned up composer
This commit is contained in:
@@ -62,7 +62,7 @@ class MockArraySessionStorage implements SessionStorageInterface
|
||||
*/
|
||||
protected $bags = [];
|
||||
|
||||
public function __construct(string $name = 'MOCKSESSID', MetadataBag $metaBag = null)
|
||||
public function __construct(string $name = 'MOCKSESSID', ?MetadataBag $metaBag = null)
|
||||
{
|
||||
$this->name = $name;
|
||||
$this->setMetadataBag($metaBag);
|
||||
@@ -94,7 +94,7 @@ class MockArraySessionStorage implements SessionStorageInterface
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function regenerate(bool $destroy = false, int $lifetime = null)
|
||||
public function regenerate(bool $destroy = false, ?int $lifetime = null)
|
||||
{
|
||||
if (!$this->started) {
|
||||
$this->start();
|
||||
@@ -204,7 +204,7 @@ class MockArraySessionStorage implements SessionStorageInterface
|
||||
return $this->started;
|
||||
}
|
||||
|
||||
public function setMetadataBag(MetadataBag $bag = null)
|
||||
public function setMetadataBag(?MetadataBag $bag = null)
|
||||
{
|
||||
if (null === $bag) {
|
||||
$bag = new MetadataBag();
|
||||
@@ -226,14 +226,11 @@ class MockArraySessionStorage implements SessionStorageInterface
|
||||
/**
|
||||
* Generates a session ID.
|
||||
*
|
||||
* This doesn't need to be particularly cryptographically secure since this is just
|
||||
* a mock.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function generateId()
|
||||
{
|
||||
return hash('sha256', uniqid('ss_mock_', true));
|
||||
return bin2hex(random_bytes(16));
|
||||
}
|
||||
|
||||
protected function loadSession()
|
||||
|
||||
Reference in New Issue
Block a user