<?php

namespace inc;

class PhpStorage
{
    public static $store = [];

    public static function get($name, $def = null)
    {
        if (array_key_exists($name, self::$store)) {
            return self::$store[$name];
        }
        return $def;
    }

    public static function set($name, $value)
    {
        self::$store = array_merge(self::$store, [$name => $value]);
    }

    public static function sets(array $array)
    {
        foreach ($array as $key => $value) {
            self::set($key, $value ?? '');
        }
    }

    public static function reset()
    {
        self::$store = [];
    }
}

