@rturn string

@throws \UnexpectedValueException
437626
public function getSiteGroup()
    {
        if (!isset($this->sitegroup)) {
            $this->sitegroup = $this->getenv('AH_SITE_GROUP');
            if (!$this->sitegroup) {
                throw new \UnexpectedValueException('Expecting environment variable AH_SITE_GROUP to be set');
            }
        }
        return $this->sitegroup;
    }
855316
protected function value_char()
	{
		$len = strcspn($this->data, "\x09\x20\x0A\"", $this->position);
		$this->value .= substr($this->data, $this->position, $len);
		$this->position += $len;
		$this->state = 'value';
	}
564700
public function asBMPString(): Primitive\BMPString
    {
        if (!$this->_element instanceof Primitive\BMPString) {
            throw new \UnexpectedValueException(
                $this->_generateExceptionMessage(Element::TYPE_BMP_STRING));
        }
        return $this->_element;
    }
1259642
public function grant()
    {
        if (!$this->name) {
            throw new UnexpectedValueException(
                'Cannot grant privileges to a user with no name'
            );
        }
        if (!$this->grants) {
            throw new UnexpectedValueException(
                'Cannot grant privileges without being told what privileges to grant'
            );
        }
        if (!$this->grantLevel) {
            throw new UnexpectedValueException(
                'Cannot grant privileges without being told on what to grant them'
            );
        }

        $params = array();
        $parts = array(
            sprintf(
                'GRANT %s ON %s',
                strtolower($this->grants) == 'all'
                    ? 'ALL PRIVILEGES'
                    : $this->grants,
                $this->grantLevel
            )
        );

        $parts[] = 'TO :user';
        $params[':user'] = $this->name;

        if ($this->host) {
            $parts[] = '@:host';
            $params[':host'] = strtolower($this->host) == 'any' ? '%' : $this->host;
        }

        if ($this->grantGrant) {
            $parts[] = 'WITH GRANT OPTION';
        }
        
        // Wrap in 'FLUSH PRIVILEGES' commands to update in-memory state
        $this->client->execute('FLUSH PRIVILEGES');
        $this->client->execute(implode(' ', $parts), $params);
        $this->client->execute('FLUSH PRIVILEGES');
    }
856769
private static function string()
    {
        $files = ['Strings'];
        $folder = static::$root.'Strings'.'/';

        self::call($files, $folder);

        $files = ['StringOutIndexException'];
        $folder = static::$root.'Strings/Exceptions'.'/';

        self::call($files, $folder);
    }
848495
public function serialize($value, array $options=[])
    {

        if (!is_string($value)) {
            throw new UnexpectedValueException('I can only work with strings, not ' . Type::of($value));
        }

        return $value;

    }
1006199
public function asVisibleString(): Primitive\VisibleString
    {
        if (!$this->_element instanceof Primitive\VisibleString) {
            throw new \UnexpectedValueException(
                $this->_generateExceptionMessage(Element::TYPE_VISIBLE_STRING));
        }
        return $this->_element;
    }
352090
public function asCharacterString(): Primitive\CharacterString
    {
        if (!$this->_element instanceof Primitive\CharacterString) {
            throw new \UnexpectedValueException(
                $this->_generateExceptionMessage(Element::TYPE_CHARACTER_STRING));
        }
        return $this->_element;
    }
1185999
function ToString()
    {
        $result = (string)$this->type;
        if ($this->value)
        {
            $result .= '=' . $this->value;
        }
        return $result;
    }
294889
public function getTemplate()
    {
        if(!$this->__template instanceof TemplateInterface)
        {
            $this->__template = $this->getObject($this->__template);

            if(!$this->__template instanceof TemplateInterface)
            {
                throw new \UnexpectedValueException(
                    'Template: '.get_class($this->_model).' does not implement TemplateInterface'
                );
            }
        }

        return $this->__template;
    }
819980
public function getRequest()
    {
        if(!$this->_request instanceof ControllerRequestInterface)
        {
            //Setup the request
            $this->_request->url  = $this->getIdentifier();
            $this->_request->user = $this->getUser();

            $this->_request = $this->getObject('lib:controller.request', ObjectConfig::unbox($this->_request));

            if(!$this->_request instanceof ControllerRequestInterface)
            {
                throw new \UnexpectedValueException(
                    'Request: '.get_class($this->_request).' does not implement ControllerRequestInterface'
                );
            }
        }

        return $this->_request;
    }
763710
public function asIA5String(): Primitive\IA5String
    {
        if (!$this->_element instanceof Primitive\IA5String) {
            throw new \UnexpectedValueException(
                $this->_generateExceptionMessage(Element::TYPE_IA5_STRING));
        }
        return $this->_element;
    }
1112081
protected function performStringCallable($callable)
    {
        if ( ! preg_match('#^(?<class>[\\a-z0-9_]+)@(?<method>[a-z0-9_]+)$#i', $callable, $matches)) {
            throw new \UnexpectedValueException("Unable to process callable string '{$callable}'");
        }

        $instance = app($matches['class']);

        $result = $instance->{$matches['method']}($this);

        return $result === null ? true : (bool) $result;
    }
122542
public function toASN1(): StringType
    {
        switch ($this->_tag) {
            case Element::TYPE_IA5_STRING:
                return new IA5String($this->_text);
            case Element::TYPE_VISIBLE_STRING:
                return new VisibleString($this->_text);
            case Element::TYPE_BMP_STRING:
                return new BMPString($this->_text);
            case Element::TYPE_UTF8_STRING:
                return new UTF8String($this->_text);
            default:
                throw new \UnexpectedValueException(
                    "Type " . Element::tagToName($this->_tag) . " not supported.");
        }
    }
124234
private function multiLineString()
    {
        $values = array();
        $count  = $this->readCount();

        for ($i = 0; $i < $count; $i++) {
            $this->readByteOrder();

            $type = $this->readType();

            if ($this->getDimensionedPrimitive(self::WKB_TYPE_LINESTRING) !== $type) {
                throw new UnexpectedValueException($this->getBadTypeInTypeMessage($type, self::WKB_TYPE_MULTILINESTRING, array(self::WKB_TYPE_LINESTRING)));
            }

            $values[] = $this->readPoints($this->readCount());
        }

        return $values;
    }
827320
protected function byProperty()
    {
        $fields = $this->fieldIdentifiers();
        if (empty($fields)) {
            throw new UnexpectedValueException(
                'Property is required.'
            );
        }

        $dir = $this->direction();
        $dir = $dir === null ? '' : ' '.$dir;

        return implode($dir.', ', $fields).$dir;
    }
665329
public function transform($value)
    {
        if (null === $value) {
            return null;
        }

        if (!is_string($value)) {
            throw new UnexpectedTypeException($value, 'string');
        }

        return explode($this->separator, $value);
    }