Returns the named or default session without starting it.

@param string $name session name

@return Session

@throws \InvalidArgumentException If the named session is not registered
421351
protected function locateSession($name = null)
    {
        $name = strtolower($name) ?: $this->defaultSessionName;

        if (null === $name) {
            throw new \InvalidArgumentException('Specify session name to get');
        }

        if (!isset($this->sessions[$name])) {
            throw new \InvalidArgumentException(sprintf('Session "%s" is not registered.', $name));
        }

        $session = $this->sessions[$name];

        return $session;
    }
716568
public function getOption($name)
    {
        if (is_string($name)) {
            if (isset($this->options[$name])) {
                return $this->options[$name];
            } else {
                throw new \InvalidArgumentException("An option with the name '$name' doesn't exist.");
            }
        } else {
            throw new \InvalidArgumentException("Invalid type '" . gettype($name) . "' for argument 'name'.");
        }
    }
630942
public static function get($name = '')
    {
        empty(self::$init) && self::init();

        return empty($name) ? $_SESSION : (isset($_SESSION[$name]) ? $_SESSION[$name] : false);
    }
674472
public function getParameter($name)
    {
        $config = $this->get('config');
        if (!isset($config['parameters'][$name])) {
            throw new \InvalidArgumentException(sprintf('You have requested a non-existent parameter "%s".', $name));
        }

        return $config['parameters'][$name];
    }
1103158
public function getArgument($name) {
        if (!$this->definition->hasArgument($name)) {
            throw new \InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name));
        }

        return isset($this->arguments[$name]) ? $this->arguments[$name] : $this->definition->getArgument($name)
            ->getDefault();
    }
598926
public function createNamespace(string $name): SessionInterface
    {
        $name = $this->getNamespacedKey($name);
        return new SessionNamespace($name, $this->session);
    }
1035226
final public function getDefaultPort($name)
	{
		$this->_getPortKey($name);
		if ($this->isNamedPort($name)) {
			return constant($this->_port_class . $name);
		} else {
			throw new \InvalidArgumentException("Unknown name or scheme: {$name}");
		}
	}
1368945
public function get($name)
    {
        if (!isset($this->storages[$name])) {
            throw new InvalidArgumentException("Storage $name not found.");
        }

        return $this->storages[$name];
    }
1179611
public static function & GetNamespace (
		$name = \MvcCore\ISession::DEFAULT_NAMESPACE_NAME
	) {
		if (!static::GetStarted()) static::Start();
		if (!isset(static::$instances[$name])) {
			static::$instances[$name] = new static($name);
		}
		/** @var $result \MvcCore\Session */
		$result = & static::$instances[$name];
		return $result;
	}
513609
public function getClient(string $name = 'default')
    {
        if (!isset($this->clients[$name])) {
            throw new InvalidArgumentException("No client with name \"$name\"");
        }

        return $this->clients[$name];
    }
1107302
public function setDefaultSessionName($name)
    {
        $name = strtolower($name);

        if (!isset($this->sessions[$name])) {
            throw new \InvalidArgumentException(sprintf('Session "%s" is not registered.', $name));
        }

        $this->defaultSessionName = $name;
    }
112590
public function getOption($name) {
        if (!$this->definition->hasOption($name)) {
            throw new \InvalidArgumentException(sprintf('The "%s" option does not exist.', $name));
        }

        return isset($this->options[$name]) ? $this->options[$name] : $this->definition->getOption($name)->getDefault();
    }
1045882
final public static function byName(string $name)
    {
        if (isset(self::$instances[static::class][$name])) {
            return self::$instances[static::class][$name];
        }

        $const = static::class . "::{$name}";
        if (!\defined($const)) {
            throw new InvalidArgumentException("{$const} not defined");
        }

        return self::$instances[static::class][$name] = new static(\constant($const));
    }
824628
public function get($name)
    {
        $toggle = $this->collection->get($name);
        if(!$toggle){
            throw new \InvalidArgumentException("Cannot find Toggle with name $name");
        }

        return $toggle;
    }
610554
public function getNamer($name)
    {
        if (!isset($this->namers[$name])) {
            throw new \InvalidArgumentException(sprintf('Namer "%s" is not registered.', $name));
        }

        return $this->namers[$name];
    }
279103
public function retrieve($name)
    {
        $this->userRagnarok = Session::get($this->getName());

        if (property_exists($this->userRagnarok, $name)) {
            return $this->userRagnarok->$name;
        }

        return null;
    }
605434
protected function getSessionNamespace($name = null) {
		if ($name === null) {
			$name = str_replace('\\', '_', get_class($this));
		}
		
		if (isset($this->_namespacesInstances[$name])) {
			return $this->_namespacesInstances[$name];
		}
		
		$namespace = $this->getNamespaceFactory()->createNamespace($name);
		
		$this->_namespacesInstances[$name] = $namespace;
		return $namespace;
	}