Return the constant name corresponding to the $tokenValue
@param int $typeCode
@return string
432075
public static function getCodeName( $typeCode )
	{
		// Maybe this should be: XmlTypeCode::$codeToTypeMap[ $typeCode ];
		$oClass = new \ReflectionClass( __CLASS__ );
		foreach ( $oClass->getConstants() as $key => $value )
		{
			if ( $value == $typeCode ) return $key;
		}

		return false;
	}
523190
public static function getTypeForCode( $typeCode )
	{
		return isset( XmlTypeCode::$codeToTypeMap[ $typeCode ] )
			? XmlTypeCode::$codeToTypeMap[ $typeCode ]
			: false;
	}
630483
public function getName($languageCode = null)
    {
        if ($languageCode === null) {
            $languageCode = $this->initialLanguageCode;
        }

        return $this->names[$languageCode];
    }
230373
public function getTokenName($type)
    {
        if (!isset($this->tokenNames[$type])) {
            throw new \RuntimeException(
                "Unknown token $type."
            );
        }

        return $this->tokenNames[$type];
    }
169877
public function getLocalM2MRelatedName($code = true)
    {
        return $this->getReferencedTable()->getManyToManyRelatedName($this->getReferencedTable()->getRawTableName(), implode('_', $this->getLocalColumns()), $code);
    }
748689
public function readByValue(string $tokenValue, int $expirationInSeconds): ?TokenInterface
    {
        $schema = $this->getDatabaseSchema();
        return $this->readEnabledTokenByColumnWithExpirationCheck(
            $tokenValue,
            $schema->getTokensValueColumn(),
            $expirationInSeconds,
            $schema->getTokensValueCreatedAtColumn()
        );
    }
838892
private function injectFormHiddenFieldToResponse(string $body, string $tokenValue): string
    {
        $regex = '/(<form\b[^>]*>)(.*?)(<\/form>)/is';
        $htmlHiddenField = sprintf('$1<input type="hidden" name="%s" value="%s">$2$3', $this->name, $tokenValue);
        $body = preg_replace($regex, $htmlHiddenField, $body);

        return (string)$body;
    }
461810
public static function GetCodeName( $code ) : string
   {

      switch ( $code )
      {

         case \E_ERROR:
         case \E_USER_ERROR:
            return 'ERROR';

         case \E_WARNING:
         case \E_USER_WARNING:
            return 'WARNING';

         case \E_DEPRECATED:
         case \E_USER_DEPRECATED:
            return 'DEPRECATED';

         case \E_NOTICE:
         case \E_USER_NOTICE:
            return 'NOTICE';

         case \E_PARSE:
            return 'PARSE';
         case \E_RECOVERABLE_ERROR:
            return 'RECOVERABLE ERROR';

         case \E_STRICT:
            return 'STRICT';

         default:
            if ( \is_string( $code ) )
            {
               return $code;
            }
            return 'OTHER';

      }

   }
1010148
public function readByCode(string $code, int $expirationInSeconds): ?TokenInterface
    {
        $schema = $this->getDatabaseSchema();
        return $this->readEnabledTokenByColumnWithExpirationCheck(
            $code,
            $schema->getTokensCodeColumn(),
            $expirationInSeconds,
            $schema->getTokensCodeCreatedAtColumn()
        );
    }
354454
public static function getTypeName($type)
	{
		static $ref = [];
		
		$key = static::class;
		
		if(empty($ref[$key]))
		{
			$ref[$key] = new \ReflectionClass($key);
		}
		
		foreach($ref[$key]->getConstants() as $k => $v)
		{
			if($v === $type && strpos($k, 'T_') === 0)
			{
				return $k;
			}
		}

		return static::UNKNOWN;
	}
892602
public function getNextExpected($expectedCode)
    {
        $token = $this->getNext();
        if ($this->getCurrentCode() != $expectedCode) {
            return null;
        }

        return $token;
    }
1171319
public function generateCodeValue(TokenInterface $token): string
    {
        $codeValue = bin2hex(random_bytes(16)) . uniqid();

        assert(is_string($codeValue) === true && empty($codeValue) === false);

        return $codeValue;
    }
1278993
public static function TypeCodeIsNodeType( $typeCode )
		{
			switch ( $typeCode )
			{
				case XmlTypeCode::Node:
				case XmlTypeCode::Element:
				case XmlTypeCode::Attribute:
				case XmlTypeCode::Document:
				case XmlTypeCode::Comment:
				case XmlTypeCode::Text:
				case XmlTypeCode::ProcessingInstruction:
					return true;
			}
			return false;
		}
948582
function tokenName($tokenType)
    {
        if ($tokenType === 0) {
            return 'End of Input';
        }
        if ($tokenType > 0 && $tokenType < count(self::$yyTokenName)) {
            return self::$yyTokenName[$tokenType];
        } else {
            return "Unknown";
        }
    }
81791
public function tokenExchange($code)
        {
            $parameters = array(
                'client_id'     => $this->clientId,
                'client_secret' => $this->clientSecret,
                'code'          => $code,
            );

            return $this->request(
                $this->authUrl . 'token',
                $parameters
            );
        }
1161379
public static function TypeCodeToItemType( $typeCode, $schemaType )
	{
		switch ($typeCode)
		{
			case XmlTypeCode::Boolean:
				return Types::$BooleanType;

			case XmlTypeCode::Short:
				return Types::$ShortType;

			case XmlTypeCode::Int:
				return Types::$IntType;

			case XmlTypeCode::Long:
				return Types::$LongType;

			case XmlTypeCode::UnsignedShort:
				return Types::$UInt16Type;

			case XmlTypeCode::UnsignedInt:
				return Types::$UInt32Type;

			case XmlTypeCode::UnsignedLong:
				return Types::$UInt64Type;

			case XmlTypeCode::Byte:
				return Types::$ByteType;

			case XmlTypeCode::UnsignedByte:
				return Types::$ByteType;

			case XmlTypeCode::Float:
				return Types::$FloatType;

			case XmlTypeCode::Decimal:
				return Types::$DecimalType;

			case XmlTypeCode::Integer:
			case XmlTypeCode::PositiveInteger:
			case XmlTypeCode::NegativeInteger:
			case XmlTypeCode::NonPositiveInteger:
			case XmlTypeCode::NonNegativeInteger:
				return Types::$IntType;

			case XmlTypeCode::Double:
				return Types::$DoubleType;

			case XmlTypeCode::DateTime:
				return Types::$DateTimeValueType;

			case XmlTypeCode::Date:
				return Types::$DateValueType;

			case XmlTypeCode::Time:
				return Types::$TimeValueType;

			case XmlTypeCode::AnyUri:
				return Types::$AnyUriValueType;

			case XmlTypeCode::String:
			case XmlTypeCode::NormalizedString:
			case XmlTypeCode::Token:
			case XmlTypeCode::Language:
			case XmlTypeCode::Name:
			case XmlTypeCode::NCName:
			case XmlTypeCode::Id:
				return Types::$StringType;

			case XmlTypeCode::Idref:
				if ($schemaType == XmlSchema::$IDREFS)
					return Types::$IDREFSValueType;
				else
					return Types::$StringType;
			case XmlTypeCode::NmToken:
				if ($schemaType == XmlSchema::$NMTOKENS)
					return Types::$NMTOKENSValueType;
				else
					return Types::$StringType;
			case XmlTypeCode::Entity:
				if ($schemaType == XmlSchema::$ENTITIES)
					return Types::$ENTITIESValueType;
				else
					return Types::$StringType;
			case XmlTypeCode::UntypedAtomic:
				return Types::$UntypedAtomicType;
			case XmlTypeCode::Duration:
				return Types::$DurationValueType;
			case XmlTypeCode::DayTimeDuration:
				return Types::$DayTimeDurationValueType;
			case XmlTypeCode::YearMonthDuration:
				return Types::$YearMonthDurationValueType;
			case XmlTypeCode::GYearMonth:
				return Types::$GYearMonthValueType;
			case XmlTypeCode::GYear:
				return Types::$GYearValueType;
			case XmlTypeCode::GMonth:
				return Types::$GMonthValueType;
			case XmlTypeCode::GMonthDay:
				return Types::$GMonthDayValueType;
			case XmlTypeCode::GDay:
				return Types::$GDayValueType;
			case XmlTypeCode::QName:
				return Types::$QNameValueType;
			case XmlTypeCode::HexBinary:
				return Types::$HexBinaryValueType;
			case XmlTypeCode::Base64Binary:
				return Types::$Base64BinaryValueType;
			default:
				return Types::$ObjectType;
		}
	}
1002872
private function getConstant()
    {
        $identifier = $this->getIdentifier();
        $tokens = array();

        // check for a special constant type
        switch (strtolower($identifier)) {
            case 'true':
                $tokens[] = array(DocLexer::T_TRUE, $identifier);
                break;
            case 'false':
                $tokens[] = array(DocLexer::T_FALSE, $identifier);
                break;
            case 'null':
                $tokens[] = array(DocLexer::T_NULL, $identifier);
                break;
            default:
                $tokens[] = array(DocLexer::T_IDENTIFIER, $identifier);
        }

        return $tokens;
    }