public function getTokenParser($tag)
    {
        if (isset($this->parsers[$tag])) {
            return $this->parsers[$tag];
        }
        $broker = end($this->brokers);
        while (false !== $broker) {
            $parser = $broker->getTokenParser($tag);
            if (null !== $parser) {
                return $parser;
            }
            $broker = prev($this->brokers);
        }
    }
public function getTokenParser($tag)
    {
        if (isset($this->parsers[$tag])) {
            return $this->parsers[$tag];
        }
        $broker = end($this->brokers);
        while (false !== $broker) {
            $parser = $broker->getTokenParser($tag);
            if (null !== $parser) {
                return $parser;
            }
            $broker = prev($this->brokers);
        }
    }
public function getTokenParser ( $ tag ) { if ( isset ( $ this -> parsers [ $ tag ] ) ) { return $ this -> parsers [ $ tag ] ; } $ broker = end ( $ this -> brokers ) ; while ( false !== $ broker ) { $ parser = $ broker -> getTokenParser ( $ tag ) ; if ( null !== $ parser ) { return $ parser ; } $ broker = prev ( $ this -> brokers ) ; } }
Gets a suitable TokenParser for a tag.

First looks in parsers, then in brokers.

@param string $tag A tag name

@return null|Twig_TokenParserInterface A Twig_TokenParserInterface or null if no suitable TokenParser was found
Gets a suitable TokenParser for a tag .