upgraded dependencies
This commit is contained in:
@@ -21,17 +21,22 @@ final class SessionBagProxy implements SessionBagInterface
|
||||
private $bag;
|
||||
private $data;
|
||||
private $usageIndex;
|
||||
private $usageReporter;
|
||||
|
||||
public function __construct(SessionBagInterface $bag, array &$data, ?int &$usageIndex)
|
||||
public function __construct(SessionBagInterface $bag, array &$data, ?int &$usageIndex, ?callable $usageReporter)
|
||||
{
|
||||
$this->bag = $bag;
|
||||
$this->data = &$data;
|
||||
$this->usageIndex = &$usageIndex;
|
||||
$this->usageReporter = $usageReporter;
|
||||
}
|
||||
|
||||
public function getBag(): SessionBagInterface
|
||||
{
|
||||
++$this->usageIndex;
|
||||
if ($this->usageReporter && 0 <= $this->usageIndex) {
|
||||
($this->usageReporter)();
|
||||
}
|
||||
|
||||
return $this->bag;
|
||||
}
|
||||
@@ -42,6 +47,9 @@ final class SessionBagProxy implements SessionBagInterface
|
||||
return true;
|
||||
}
|
||||
++$this->usageIndex;
|
||||
if ($this->usageReporter && 0 <= $this->usageIndex) {
|
||||
($this->usageReporter)();
|
||||
}
|
||||
|
||||
return empty($this->data[$this->bag->getStorageKey()]);
|
||||
}
|
||||
@@ -60,6 +68,10 @@ final class SessionBagProxy implements SessionBagInterface
|
||||
public function initialize(array &$array): void
|
||||
{
|
||||
++$this->usageIndex;
|
||||
if ($this->usageReporter && 0 <= $this->usageIndex) {
|
||||
($this->usageReporter)();
|
||||
}
|
||||
|
||||
$this->data[$this->bag->getStorageKey()] = &$array;
|
||||
|
||||
$this->bag->initialize($array);
|
||||
|
Reference in New Issue
Block a user