chore: Аннотации к типам

This commit is contained in:
origami11@yandex.ru 2025-10-28 12:26:00 +03:00
parent 89913de4fe
commit 386a927254
6 changed files with 63 additions and 27 deletions

View file

@ -21,9 +21,13 @@ class ViewState // extends Collection
$this->values[$name] = $value;
}
function get($_rest)
/**
* Возвращает значение
* @param string ...$args
* @return mixed
*/
function get(...$args)
{
$args = func_get_args();
$result = $this->values;
foreach ($args as $name) {
if (!isset($result[$name])) {
@ -34,16 +38,28 @@ class ViewState // extends Collection
return $result;
}
/**
* Сохраняет состояние
* @return string
*/
function saveState(): string
{
return base64_encode(serialize($this->values));
}
function restoreState($value)
/**
* Восстанавливает состояние
* @param string $value
*/
function restoreState($value): void
{
$this->values = unserialize(base64_decode($value));
}
/**
* Возвращает состояние
* @return array
*/
function export()
{
return $this->values;