Inserts a token before the current token. Cursor now points to
this token.  You must reprocess after this.
@param HTMLPurifier_Token $token
547044
private function insertBefore($token)
    {
        // NB not $this->zipper->insertBefore(), due to positioning
        // differences
        $splice = $this->zipper->splice($this->token, 0, array($token));

        return $splice[1];
    }
61489
private function addTokenToVector($token, $field, $count = 1)
    {
        if (!empty($token)) {
            if (isset($this->tokenVector[$field][$token])) {
                $this->tokenVector[$field][$token] += $count;
            } else {
                $this->tokenVector[$field][$token] = $count;
            }
        }
    }
252310
public function addSeparator($token)
    {
        $this->row->addGenerator($this->generator);
        $this->generator = $this->documentGenerator->getInlineGenerator($this->generatorName);

        $this->wikiContent .= $this->wikiContentArr[$this->separatorCount];
        ++$this->separatorCount;
        $this->currentSeparator = $token;
        $this->wikiContent .= $token;
        $this->contents[$this->separatorCount] = '';
        $this->wikiContentArr[$this->separatorCount] = '';
    }
1007516
private function ConsumeChar( $token )
	{
		$curr = new CurrentToken();
		$curr->token = $token;
		$curr->value = null;
		$curr->anchor = $this->m_anchor;
		$curr->length = 1;
		array_push( $this->m_token, $curr );
	}
47541
public function prependTokens(Tokenizer $new_tokens)
    {
        $this->tokens = array_merge($new_tokens->asArray(), $this->tokens);
        $this->rewind();

        return $this;
    }
1359350
public function update(Token $token)
    {
        $this->om->persist($token);
        $this->om->flush();

        return $token;
    }
1286320
public function addToken(Token $token)
    {
        $this->tokens[$this->getAppKey()][$token->getTokenUUID()->composeUUID()] = $token;
    }
352267
private function _checkNoWhiteSpaceAfter($token) {
		if ($this->_isActive('noSpaceAfterToken')) {

			$text = $token->text;

			if (!$this->_config->isException('noSpaceAfterToken', $text)) {

				// The next token is a whitespace
				if ($this->tokenizer->checkNextToken(T_WHITESPACE)) {

					// And the next valid token is on the same line
					$tokenAfter = $this->tokenizer->peekNextValidToken();
					if ($tokenAfter->line === $token->line) {
						$msg = $this->_getMessage('NO_SPACE_AFTER_TOKEN', $text);
						$this->_writeError('noSpaceAfterToken', $msg);
					}
				}
			}
		}
	}
46490
public function parse(Token $token): PerLineNode
    {
        $stream = $this->parser->getStream();

        // perline is a very simple tag, not having anything more than its name
        // between the braces, so we expect the closing brace immediately.
        $stream->expect(Token::BLOCK_END_TYPE);

        // sub-parse everything until we reach the endperline tag.
        $body = $this->parser->subparse(function (Token $token) {
            return $token->test('endperline');
        }, true);

        // make sure our closing tag is also closed neatly and advance the
        // stream to allow continuation of parsing.
        $stream->expect(Token::BLOCK_END_TYPE);

        // turn out body in a nicely formatted PerLineNode
        return $this->parseBody($body);
    }
245309
public function renewToken(?Token $token) : Token
    {
        if ($token === null) {
            throw new NullValueException("Token cannot be null");
        }

        $token->updateExisting([
            'token' => $this->generateToken($this->config->get('app.key')),
        ]);

        $this->fireUpdatedEvent($token->user, $token);

        return $token;
    }
787238
protected function store_token($token) {
        global $SESSION;

        $this->accesstoken = $token;
        $name = $this->get_tokenname();

        if ($token !== null) {
            $SESSION->{$name} = $token;
        } else {
            unset($SESSION->{$name});
        }
    }
1356030
protected function processToken($token)
    {
        switch ($token) {
            case ')':
                $this->processTokenClosingParenthesis();
                break;
            case '(':
                $this->processTokenOpeningParenthesis();
                break;
            case self::LOGICAL_OR:
            case self::LOGICAL_AND:
                $this->processTokenLogicalOperator($token);
                break;
            default:
                $this->processTokenCondition($token);
                break;
        }

        return $this;
    }
1308680
public function setToken($token)
    {
        $config = $this->navitia_component->getConfiguration();
        $config['token'] = $token;
        $this->navitia_component->setConfiguration($config);
    }
1004684
public function setToken($token)
    {
        $this->_tokenString = (string) $token;
        $this->_token       = $token;
        return $this;
    }
1256897
public void insert( Token where , Token token ) {
        if( where == null ) {
            // put at the front of the list
            if( size == 0 )
                push(token);
            else {
                first.previous = token;
                token.previous = null;
                token.next = first;
                first = token;
                size++;
            }
        } else if( where == last || null == last ) {
            push(token);
        } else {
            token.next = where.next;
            token.previous = where;
            where.next.previous = token;
            where.next = token;
            size++;
        }
    }
1132889
public function moveToToken(Token $token) {

      if (!$token->isValid()) {
        $this->setValid(false);
        return new Token();
      }

      $tokenIndex = $token->getIndex();


      foreach ($this->collection as $index => $collectionToken) {
        if ($collectionToken->getIndex() === $tokenIndex) {
          $this->setPosition($index);
          return $collectionToken;
        }
      }

      $this->setValid(false);
      return new Token();
    }
432950
public function move(Token $token) {
			$this->begin = $token->begin;
			$this->end = $token->end;

			unset($this->after, $this->before);
		}