20250126#1
This commit is contained in:
@@ -18,6 +18,11 @@ class Session implements SessionInterface {
|
||||
}
|
||||
}
|
||||
|
||||
/** @inheritDoc */
|
||||
public function __invoke(string $name = "", string $type = ""): mixed {
|
||||
return $this->get($name, $type);
|
||||
}
|
||||
|
||||
/** @inheritDoc */
|
||||
public function has(string $name = "") : bool {
|
||||
return (!empty($name)) ? isset($this->getSession()[$name]) : !empty($this->getSession());
|
||||
@@ -50,7 +55,9 @@ class Session implements SessionInterface {
|
||||
else $_SESSION = [];
|
||||
}
|
||||
|
||||
/** @inheritDoc */
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
private function getSession() : array {
|
||||
return $_SESSION;
|
||||
}
|
||||
|
||||
@@ -16,6 +16,13 @@ interface SessionInterface {
|
||||
*/
|
||||
public function has(string $name = "") : bool;
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
* @param string $type
|
||||
* @return mixed
|
||||
*/
|
||||
public function __invoke(string $name = "", string $type = ""): mixed;
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
* @param string $type
|
||||
|
||||
Reference in New Issue
Block a user