1 Commits
1.0 ... 1.1

Author SHA1 Message Date
User
b265edcf80 20250126#1 2025-01-26 14:05:36 +03:00
2 changed files with 17 additions and 3 deletions

View File

@@ -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;
}

View File

@@ -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