Get the wrapped element as a T61 string type.

@throws \UnexpectedValueException If the element is not a T61 string
@return \ASN1\Type\Primitive\T61String
774233
public function asT61String(): Primitive\T61String
    {
        if (!$this->_element instanceof Primitive\T61String) {
            throw new \UnexpectedValueException(
                $this->_generateExceptionMessage(Element::TYPE_T61_STRING));
        }
        return $this->_element;
    }
953794
public function getMimeType()
    {
        if (!$this->mimeType) {
            $finfo = finfo_open(FILEINFO_MIME_TYPE, $this->magicFile);
            if (!$finfo) {
                throw new \UnexpectedValueException('Failed to open fileinfo database');
            }
            $this->mimeType = finfo_file($finfo, $this->file);
        }
        return $this->mimeType;
    }
162684
public function asGraphicString(): Primitive\GraphicString
    {
        if (!$this->_element instanceof Primitive\GraphicString) {
            throw new \UnexpectedValueException(
                $this->_generateExceptionMessage(Element::TYPE_GRAPHIC_STRING));
        }
        return $this->_element;
    }
53908
public function current()
    {
        if (!isset($this->tokenList[$this->ptr])) {
            throw new \UnexpectedValueException("Unexpected input at offset {$this->ptr}, unexpected end of stream");
        }
        return $this->tokenList[$this->ptr];
    }
371041
public function asPrintableString(): Primitive\PrintableString
    {
        if (!$this->_element instanceof Primitive\PrintableString) {
            throw new \UnexpectedValueException(
                $this->_generateExceptionMessage(Element::TYPE_PRINTABLE_STRING));
        }
        return $this->_element;
    }
533729
public function getAdapter()
    {
        if(!$this->_adapter instanceof KDatabaseAdapterInterface)
        {
            $this->_adapter = $this->getObject($this->_adapter);

            if(!$this->_adapter instanceof KDatabaseAdapterInterface)
            {
                throw new UnexpectedValueException(
                    'Adapter: '.get_class($this->_adapter).' does not implement KDatabaseAdapterInterface'
                );
            }
        }

        return $this->_adapter;
    }
861650
function xmlString( )
    {
        $doc = new DOMDocument( '1.0', 'utf-8' );

        $root = $doc->createElement( "ezrangeoption" );
        $root->setAttribute( "start_value", $this->StartValue );
        $root->setAttribute( "stop_value", $this->StopValue );
        $root->setAttribute( "step_value", $this->StepValue );
        $doc->appendChild( $root );

        $name = $doc->createElement( "name", $this->Name );
        $root->appendChild( $name );

        $xml = $doc->saveXML();

        return $xml;
    }
136274
public function getValue() {
        $type = (string) $this->element->attributes()->type;
        $type = (empty($type)) ? 'string' : $type;
        $value = (string) $this->element->attributes()->value;

        $casterClassName = $this->resolveCasterClassName($type);

        /** @type \BuildR\TestTools\Caster\CasterInterface $casterObject */
        $casterObject = new $casterClassName($value);
        return $casterObject->cast();
    }
612150
public function transform($string)
    {
        $string = $this->transliterator->transliterate($string);
        if ($string === false) {
            throw new UnexpectedValueException($this->transliterator->getErrorMessage(), $this->transliterator->getErrorCode());
        }
        return $string;
    }
945129
public function ToString()
	{
		$sb = array();
		switch ( $this->TypeCode )
		{
			case XmlTypeCode::AnyAtomicType:
				$sb[] = "AnyAtomicType";
				break;

			case XmlTypeCode::UntypedAtomic:
				$sb[] = "UntypedAtomic";
				break;

			case XmlTypeCode::None:
				$sb[] = "empty-sequence()";
				break;

			case XmlTypeCode::Item:
				$sb[] = "item()";
				break;

			case XmlTypeCode::Node:
				$sb[] = "node()";
				break;

			case XmlTypeCode::Document:
				$sb[] = "document-node(";
				if ( is_null( $this->SchemaElement ) )
				{
					if ( ! $this->NameTest->IsWildcard() || is_null( $this->SchemaType ) )
					{
						$sb[] = "element(";
						$sb[] = $this->NameTest->ToString();
						if ( ! is_null( $this->SchemaType ) )
						{
							$sb[] = ",";
							$sb[] = get_class( $this->SchemaType );
							if ( $this->Nillable )
								$sb[] = "?";
						}
						else
						{
							$sb[] = ", xs:untyped";
						}
						$sb[] = ")";
					}
				}
				else
				{
					$sb[] = "schema-element(";
					$sb[] = $this->SchemaElement->QualifiedName->__toString();
					$sb[] = ")";
				}
				$sb[] = ")";
				break;

			case XmlTypeCode::Element:
				if ( is_null( $this->SchemaElement ) )
				{
					$sb[] = "element(";
					$sb[] = $this->NameTest->ToString();
					if ( ! is_null( $this->SchemaType ) )
					{
						$sb[] = ",";
						$sb[] = get_class( $this->SchemaType );
						if ( $this->Nillable )
						{
							$sb[] = "?";
						}
					}
					else
					{
						$sb[] = ", xs:untyped";
					}
				}
				else
				{
					$sb[] = "schema-element(";
					$sb[] = $this->SchemaElement->QualifiedName->__toString();
				}
				$sb[] = ")";
				break;

			case XmlTypeCode::Attribute:
				if ( is_null( $this->SchemaAttribute ) )
				{
					$sb[] = "attribute(";
					$sb[] = $this->NameTest->ToString();
					if ( ! is_null( $this->SchemaType ) )
					{
						$sb[] = ",";
						$sb[] = get_class( $this->SchemaType );
					}
				}
				else
				{
					$sb[] = "schema-attribute(";
					$sb[] = $this->SchemaAttribute->QualifiedName;
				}
				$sb[] = ")";
				break;

			case XmlTypeCode::ProcessingInstruction:
				$sb[] = "processing-instruction(";
				break;

			case XmlTypeCode::Comment:
				$sb[] = "comment()";
				break;

			case XmlTypeCode::Text:
				$sb[] = "text()";
				break;

			case XmlTypeCode::String:
				$sb[] = "xs:string";
				break;

			case XmlTypeCode::Boolean:
				$sb[] = "xs:boolean";
				break;

			case XmlTypeCode::Decimal:
				$sb[] = "xs:decimal";
				break;

			case XmlTypeCode::Float:
				$sb[] = "xs:float";
				break;

			case XmlTypeCode::Double:
				$sb[] = "xs:double";
				break;

			case XmlTypeCode::Duration:
				$sb[] = "xs:Duration";
				break;

			case XmlTypeCode::DateTime:
				$sb[] = "xs:dateTime";
				break;

			case XmlTypeCode::Time:
				$sb[] = "xs:time";
				break;

			case XmlTypeCode::Date:
				$sb[] = "xs:date";
				break;

			case XmlTypeCode::GYearMonth:
				$sb[] = "xs:gYearMonth";
				break;

			case XmlTypeCode::GYear:
				$sb[] = "xs:gYear";
				break;

			case XmlTypeCode::GMonthDay:
				$sb[] = "xs:gMonthDay";
				break;

			case XmlTypeCode::GDay:
				$sb[] = "xs:gDay";
				break;

			case XmlTypeCode::GMonth:
				$sb[] = "xs:gMonth";
				break;

			case XmlTypeCode::HexBinary:
				$sb[] = "xs:hexBinary";
				break;

			case XmlTypeCode::Base64Binary:
				$sb[] = "xs:base64Binary";
				break;

			case XmlTypeCode::AnyUri:
				$sb[] = "xs:anyURI";
				break;

			case XmlTypeCode::QName:
				$sb[] = "xs:QName";
				break;

			case XmlTypeCode::Notation:
				$sb[] = "xs:NOTATION";
				break;

			case XmlTypeCode::NormalizedString:
				$sb[] = "xs:normalizedString";
				break;

			case XmlTypeCode::Token:
				$sb[] = "xs:token";
				break;

			case XmlTypeCode::Language:
				$sb[] = "xs:language";
				break;

			case XmlTypeCode::NmToken:
				if ( $this->SchemaType == XmlSchema::$NMTOKENS )
					$sb[] = "xs:NMTOKENS";
				else
					$sb[] = "xs:NMTOKEN";
				break;

			case XmlTypeCode::Name:
				$sb[] = "xs:Name";
				break;

			case XmlTypeCode::NCName:
				$sb[] = "xs:NCName";
				break;

			case XmlTypeCode::Id:
				$sb[] = "xs:ID";
				break;

			case XmlTypeCode::Idref:
				if ( $this->SchemaType == XmlSchema::$IDREFS )
					$sb[] = "xs:IDREFS";
				else
					$sb[] = "xs:IDREF";
				break;

			case XmlTypeCode::Entity:
				if ( $this->SchemaType == XmlSchema::$ENTITIES )
					$sb[] = "xs:ENTITYS";
				else
					$sb[] = "xs:ENTITY";
				break;

			case XmlTypeCode::Integer:
				$sb[] = "xs:integer";
				break;

			case XmlTypeCode::NonPositiveInteger:
				$sb[] = "xs:nonPositiveInteger";
				break;

			case XmlTypeCode::NegativeInteger:
				$sb[] = "xs:negativeInteger";
				break;

			case XmlTypeCode::Long:
				$sb[] = "xs:long";
				break;

			case XmlTypeCode::Int:
				$sb[] = "xs:int";
				break;

			case XmlTypeCode::Short:
				$sb[] = "xs:short";
				break;

			case XmlTypeCode::Byte:
				$sb[] = "xs:byte";
				break;

			case XmlTypeCode::NonNegativeInteger:
				$sb[] = "xs:nonNegativeInteger";
				break;

			case XmlTypeCode::UnsignedLong:
				$sb[] = "xs:unsignedLong";
				break;

			case XmlTypeCode::UnsignedInt:
				$sb[] = "xs:unsignedInt";
				break;

			case XmlTypeCode::UnsignedShort:
				$sb[] = "xs:unsignedShort";
				break;

			case XmlTypeCode::UnsignedByte:
				$sb[] = "xs:unsignedByte";
				break;

			case XmlTypeCode::PositiveInteger:
				$sb[] = "xs:positiveInteger";
				break;

			case XmlTypeCode::DayTimeDuration:
				$sb[] = "xs:dayTimeDuration";
				break;

			case XmlTypeCode::YearMonthDuration:
				$sb[] = "xs:yearMonthDuration";
				break;

			default:
				$sb[] = "[]";
				break;
		}

		switch ( $this->Cardinality )
		{
			case XmlTypeCardinality::OneOrMore:
				$sb[] = "+";
				break;

			case XmlTypeCardinality::ZeroOrMore:
				$sb[] = "*";
				break;

			case XmlTypeCardinality::ZeroOrOne:
				$sb[] = "?";
				break;
		}

		return implode( "", $sb );
	}
55704
public function getIterator()
    {

        $result = $this->data !== null ? $this->data : call_user_func($this->getter);

        if (!$result) {
            return new ArrayIterator([]);
        }

        if ($result instanceof Iterator) {
            return $result;
        }

        if (is_array($result)) {
            return new ArrayIterator($result);
        }

        if (!$result instanceof Traversable) {
            throw new UnexpectedValueException('The returned result of the assigned callable is not supported (traversable)');
        }

        $array = [];

        foreach ($result as $item) {
            $array[] = $item;
        }

        return new ArrayIterator($array);
    }
375170
private function _typeDescriptorString(): string
    {
        $type_cls = $this->_element->typeClass();
        $tag = $this->_element->tag();
        if ($type_cls == Identifier::CLASS_UNIVERSAL) {
            return Element::tagToName($tag);
        }
        return Identifier::classToName($type_cls) . " TAG $tag";
    }
826420
public function getComponent()
    {
        if (! ($this->_controller instanceof LibBaseControllerAbstract)) {

            $this->_controller = $this->getController();

            if (! $this->_controller instanceof LibBaseControllerAbstract) {
                throw new \UnexpectedValueException(
                    'Dispatcher: '.get_class($this->_controller).' does not implement LibBaseDispatcherAbstract',
                    AnHttpResponse::INTERNAL_SERVER_ERROR
                );
            }
        }

        return $this->_controller;
    }
182129
private function getPlainValue()
    {
        // check if array, then hand off
        if ($this->lexer->isNextToken(DocLexer::T_OPEN_CURLY_BRACES)) {
            return $this->getArray();
        }

        // check if nested annotation, then hand off
        if ($this->lexer->isNextToken(DocLexer::T_AT)) {
            return $this->getAnnotation();
        }

        // check if constant, then hand off
        if ($this->lexer->isNextToken(DocLexer::T_IDENTIFIER)) {
            return $this->getConstant();
        }

        $tokens = array();

        // determine type, or throw syntax error if unrecognized
        switch ($this->lexer->lookahead['type']) {
            case DocLexer::T_FALSE:
            case DocLexer::T_FLOAT:
            case DocLexer::T_INTEGER:
            case DocLexer::T_NULL:
            case DocLexer::T_STRING:
            case DocLexer::T_TRUE:
                $this->match($this->lexer->lookahead['type']);

                $tokens[] = array(
                    $this->lexer->token['type'],
                    $this->lexer->token['value']
                );

                break;
            default:
                throw SyntaxException::expectedToken(
                    'PlainValue',
                    null,
                    $this->lexer
                );
        }

        return $tokens;
    }
36987
public function getBindingType()
    {
        $bindingType = $this->session->get(SessionParameter::BINDING_TYPE);

        if (!is_string($bindingType)) {
            return BindingType::cast(BindingType::CUSTOM);
        }

        try {
            return BindingType::cast($bindingType);
        } catch (InvalidEnumerationValueException $exception) {
            return BindingType::cast(BindingType::CUSTOM);
        }
    }
39883
protected function parse(): array
    {
        $offset = 0;
        $name = $this->_parseName($offset);
        if ($offset < $this->_len) {
            $remains = substr($this->_dn, $offset);
            throw new \UnexpectedValueException(
                "Parser finished before the end of string" .
                     ", remaining: '$remains'.");
        }
        return $name;
    }
817740
public function asVideotexString(): Primitive\VideotexString
    {
        if (!$this->_element instanceof Primitive\VideotexString) {
            throw new \UnexpectedValueException(
                $this->_generateExceptionMessage(Element::TYPE_VIDEOTEX_STRING));
        }
        return $this->_element;
    }