Move to the next token of a given type.

@param  mixed       $type Token type to search for.
@return string|null Returns the skipped text content (the current is not saved).
325824
public function next($type = false)
    {
        if ($type === false || $type === true) {
            $this->_current++;
            return $this->current($type);
        }
        $content = '';
        $start = $this->_current++;
        $count = $this->count();

        $list = array_fill_keys((array) $type, true);

        while ($this->_current < $count) {
            $content .= $this->_data[$this->_current][1];
            if (isset($list[$this->_data[$this->_current][0]])) {
                return $content;
            }
            $this->_current++;
        }
        $this->_current = $start;
    }
322698
protected function matchTokenTextAtCursor(int $type)
    {
        $result = preg_match($this->getTokenPattern($type), $this->getTextAtCursor(), $matches);
        PregHelper::assertMatchResult(
            $result,
            RegExpException::class,
            "Failed to match token text due to regular expression error"
        );
        if (1 === $result) {
            $text = $matches[0];
            if (strlen($text) == 0) {
                throw new LengthException("Matched token text is empty");
            }
        } else {
            $text = null;
        }
        return $text;
    }
1040290
public function nextTokenIf($type, $value = null)
    {
        if ($this->next->test($type, $value)) {
            return $this->next();
        }

        return false;
    }
499869
public function skipUntil($type)
    {
        while ( ! $this->isNext($type) && $this->moveNext());

        if ( ! $this->isNext($type)) {
            throw new \RuntimeException(sprintf('Could not find the token %s.', $this->getName($type)));
        }
    }
240495
private function getFromMemory($type)
    {
        if (isset($this->loaded[$type])) {
            return $this->loaded[$type];
        }
        return null;
    }
139908
public function getTokens($type) {
        $tokens = $this->client->tokens(array('type' => implode('|', $type)));
        if (!empty($tokens['warnings']) || empty($tokens['tokens'])) {
            throw new SessionException("Error while getting tokens from wiki. ".json_encode($tokens));
        }
        $result = (array) $tokens['tokens'];
        $this->tokencache = array_merge($this->tokencache, $result );
        return $result;
    }
230373
public function getTokenName($type)
    {
        if (!isset($this->tokenNames[$type])) {
            throw new \RuntimeException(
                "Unknown token $type."
            );
        }

        return $this->tokenNames[$type];
    }
1170119
public function getChanges($type)
	{
		if ( ! isset($this->changes[$type]))
		{
			return null;
		}

		return $this->changes[$type];
	}
725922
public function getMessage($type = null)
    {
        do {
            if (false !== strpos($this->current()->contenttype, 'text/html')) {
                $currentType = 'text/html';
            } else {
                $currentType = 'text';
            }
        } while ($type && $type != $currentType && $this->countParts() > $this->key() && !$this->next());

        $message = new Email();
        $message->setSubject($this->subject);
        $message->setTo($this->to);
        $message->setFrom($this->from);
        $part = new Part($this->current());
        $body = (string)$part->getContent();
        if ('text/html' == $currentType) {
            $body = quoted_printable_decode($body);
        }
        $message->setBody($body);
        return $message;
    }
1254610
public function getTransformer($type)
    {
        return isset($this->methods[$type]) ? $this->methods[$type] : null;
    }
849386
public function getAsString(string $type): ?string
    {
        $ret = $this->entry[$type];
        if (is_array($ret)) {
            $ret = implode('', $ret);
        }
        return $ret;
    }
669864
public static function getResource(string $type)
    {
        if (isset(self::$resources[$type])) {
            return self::$resources[$type];
        }
        $class = '\\sdopx\\resource\\' . Utils::toCamel($type) . 'Resource';
        if (class_exists($class)) {
            self::$resources[$type] = new $class();
            return self::$resources[$type];
        }
        return null;
    }
813861
private function is_text_col( $type ) {
		foreach ( array( 'text', 'varchar' ) as $token ) {
			if ( false !== strpos( $type, $token ) ) {
				return true;
			}
		}

		return false;
	}
1144058
public function nextToken()
    {
        if ($this->_input === null) {
            return null;
        }

        do {
            if (! preg_match('/[\p{L}\p{N}]+/u', $this->_input, $match, PREG_OFFSET_CAPTURE, $this->_bytePosition)) {
                // It covers both cases a) there are no matches (preg_match(...) === 0)
                // b) error occured (preg_match(...) === FALSE)
                return null;
            }

            // matched string
            $matchedWord = $match[0][0];

            // binary position of the matched word in the input stream
            $binStartPos = $match[0][1];

            // character position of the matched word in the input stream
            $startPos = $this->_position +
                        iconv_strlen(
                            substr(
                                $this->_input,
                                $this->_bytePosition,
                                $binStartPos - $this->_bytePosition
                            ),
                            'UTF-8'
                        );
            // character postion of the end of matched word in the input stream
            $endPos = $startPos + iconv_strlen($matchedWord, 'UTF-8');

            $this->_bytePosition = $binStartPos + strlen($matchedWord);
            $this->_position     = $endPos;

            $token = $this->normalize(new Zend_Search_Lucene_Analysis_Token($matchedWord, $startPos, $endPos));
        } while ($token === null); // try again if token is skipped

        return $token;
    }
363167
public static function getExtensionByType($type)
    {
        return empty($foundExtensions = array_keys(self::$_contentTypes, $type)) ? null : $foundExtensions[0];
    }
1062778
public function getXSDType($type)
    {
        if ($this->isXDSType($type)) {
            return self::$XSDTypes[strtolower($type)];
        } elseif ($type) {
            if (strpos($type, '[]')) {
                if ($this->isXDSType(str_replace('[]', '', $type))) {
                    return self::$XSDTypes['array'];
                }
            }

            return $this->addComplexType($type);
        } else {
            return null;
        }
    }
1227816
public function get_chunks($type) {
        if (!isset($this->_chunks[$type]) || $this->_chunks[$type] === null)
            return null;

        $chunks = array ();

        foreach ($this->_chunks[$type] as $chunk) {
            if ($chunk['size'] > 0) {
                fseek($this->_fp, $chunk['offset'], SEEK_SET);
                $chunks[] = fread($this->_fp, $chunk['size']);
            } else {
                $chunks[] = '';
            }
        }

        return $chunks;
    }