static function set($key, $val, $type = null)
{
if (!static::$pimple) {
throw new \LogicException('\\Pimple\\Container not set, call init() or setPimple() before using set().');
}
if ('factory' == $type) {
static::$pimple[$key] = static::$pimple->factory($val);
} elseif ('protect' == $type) {
static::$pimple[$key] = static::$pimple->protect($val);
} else {
static::$pimple[$key] = $val;
}
}