public function asString(): StringType
    {
        if (!$this->_element instanceof StringType) {
            throw new \UnexpectedValueException(
                $this->_generateExceptionMessage(Element::TYPE_STRING));
        }
        return $this->_element;
    }
public function asString(): StringType
    {
        if (!$this->_element instanceof StringType) {
            throw new \UnexpectedValueException(
                $this->_generateExceptionMessage(Element::TYPE_STRING));
        }
        return $this->_element;
    }
public function asString ( ) : StringType { if ( ! $ this -> _element instanceof StringType ) { throw new \ UnexpectedValueException ( $ this -> _generateExceptionMessage ( Element :: TYPE_STRING ) ) ; } return $ this -> _element ; }
Get the wrapped element as any string type.

@throws \UnexpectedValueException If the element is not a string
@return StringType
Get the wrapped element as any string type .