/var/www/vhosts/ihelp.ro/_OLD/vendor/cakephp/cakephp/src/TestSuite
Edit: /var/www/vhosts/ihelp.ro/_OLD/vendor/cakephp/cakephp/src/TestSuite/TestSession.php (2152B)
session = $session;
}
/**
* Returns true if given variable name is set in session.
*
* @param string|null $name Variable name to check for
* @return bool True if variable is there
*/
public function check(?string $name = null): bool
{
if ($this->session === null) {
return false;
}
if ($name === null) {
return (bool)$this->session;
}
return Hash::get($this->session, $name) !== null;
}
/**
* Returns given session variable, or all of them, if no parameters given.
*
* @param string|null $name The name of the session variable (or a path as sent to Hash.extract)
* @return mixed The value of the session variable, null if session not available,
* session not started, or provided name not found in the session.
*/
public function read(?string $name = null)
{
if ($this->session === null) {
return null;
}
if ($name === null) {
return $this->session ?: [];
}
return Hash::get($this->session, $name);
}
}