fix:更新已知bug,优化代码

This commit is contained in:
Ying
2022-11-28 19:11:12 +08:00
parent f6aee95cfc
commit 9445b206a2
1378 changed files with 53759 additions and 20789 deletions

View File

@@ -26,15 +26,8 @@ class MetadataBag implements SessionBagInterface
public const UPDATED = 'u';
public const LIFETIME = 'l';
/**
* @var string
*/
private $name = '__metadata';
/**
* @var string
*/
private $storageKey;
private string $name = '__metadata';
private string $storageKey;
/**
* @var array
@@ -43,15 +36,10 @@ class MetadataBag implements SessionBagInterface
/**
* Unix timestamp.
*
* @var int
*/
private $lastUsed;
private int $lastUsed;
/**
* @var int
*/
private $updateThreshold;
private int $updateThreshold;
/**
* @param string $storageKey The key used to store bag in the session
@@ -84,10 +72,8 @@ class MetadataBag implements SessionBagInterface
/**
* Gets the lifetime that the session cookie was set with.
*
* @return int
*/
public function getLifetime()
public function getLifetime(): int
{
return $this->meta[self::LIFETIME];
}
@@ -108,7 +94,7 @@ class MetadataBag implements SessionBagInterface
/**
* {@inheritdoc}
*/
public function getStorageKey()
public function getStorageKey(): string
{
return $this->storageKey;
}
@@ -118,7 +104,7 @@ class MetadataBag implements SessionBagInterface
*
* @return int Unix timestamp
*/
public function getCreated()
public function getCreated(): int
{
return $this->meta[self::CREATED];
}
@@ -128,7 +114,7 @@ class MetadataBag implements SessionBagInterface
*
* @return int Unix timestamp
*/
public function getLastUsed()
public function getLastUsed(): int
{
return $this->lastUsed;
}
@@ -136,7 +122,7 @@ class MetadataBag implements SessionBagInterface
/**
* {@inheritdoc}
*/
public function clear()
public function clear(): mixed
{
// nothing to do
return null;
@@ -145,7 +131,7 @@ class MetadataBag implements SessionBagInterface
/**
* {@inheritdoc}
*/
public function getName()
public function getName(): string
{
return $this->name;
}