Sulu\Bundle\GeneratorBundle\Manipulator\Manipulator::peek PHP Method

peek() protected method

Peeks the next token.
protected peek ( $nb = 1 )
    protected function peek($nb = 1)
    {
        $i = 0;
        $tokens = $this->tokens;
        while ($token = array_shift($tokens)) {
            if (is_array($token) && in_array($token[0], [T_WHITESPACE, T_COMMENT, T_DOC_COMMENT])) {
                continue;
            }
            ++$i;
            if ($i == $nb) {
                return $token;
            }
        }
    }