Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b265edcf80 |
@@ -18,6 +18,11 @@ class Session implements SessionInterface {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @inheritDoc */
|
||||||
|
public function __invoke(string $name = "", string $type = ""): mixed {
|
||||||
|
return $this->get($name, $type);
|
||||||
|
}
|
||||||
|
|
||||||
/** @inheritDoc */
|
/** @inheritDoc */
|
||||||
public function has(string $name = "") : bool {
|
public function has(string $name = "") : bool {
|
||||||
return (!empty($name)) ? isset($this->getSession()[$name]) : !empty($this->getSession());
|
return (!empty($name)) ? isset($this->getSession()[$name]) : !empty($this->getSession());
|
||||||
@@ -50,8 +55,10 @@ class Session implements SessionInterface {
|
|||||||
else $_SESSION = [];
|
else $_SESSION = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @inheritDoc */
|
/**
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
private function getSession() : array {
|
private function getSession() : array {
|
||||||
return $_SESSION;
|
return $_SESSION;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,13 @@ interface SessionInterface {
|
|||||||
*/
|
*/
|
||||||
public function has(string $name = "") : bool;
|
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 $name
|
||||||
* @param string $type
|
* @param string $type
|
||||||
@@ -35,4 +42,4 @@ interface SessionInterface {
|
|||||||
*/
|
*/
|
||||||
public function clear(string $name = null) : void;
|
public function clear(string $name = null) : void;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user