Swagger\StaticAnalyser::nextToken PHP Method

nextToken() private method

The next non-whitespace, non-comment token.
private nextToken ( array &$tokens, Context $context ) : string | array
$tokens array
$context Context
return string | array The next token (or false)
    private function nextToken(&$tokens, $context)
    {
        $token = next($tokens);
        if ($token[0] === T_WHITESPACE) {
            return $this->nextToken($tokens, $context);
        }
        if ($token[0] === T_COMMENT) {
            $pos = strpos($token[1], '@SWG\\');
            if ($pos) {
                $line = $context->line ? $context->line + $token[2] : $token[2];
                $commentContext = new Context(['line' => $line], $context);
                Logger::notice('Annotations are only parsed inside `/**` DocBlocks, skipping ' . $commentContext);
            }
            return $this->nextToken($tokens, $context);
        }
        return $token;
    }