phplinter\Linter::measure_comment PHP Method

measure_comment() protected method

----------------------------------------------------------------------+
protected measure_comment ( $pos, $depth, &$ret ) : integer
$pos int
$depth int
return integer ----------------------------------------------------------------------+
    protected function measure_comment($pos, $depth, &$ret)
    {
        $node = new Lint\Node();
        $node->start = $pos;
        $node->start_line = $this->tokens[$pos][2];
        $node->type = $this->tokens[$pos][0];
        $node->name = 'comment';
        $depth += count($this->scope);
        $this->debug("In comment at {$node->start_line}", $depth, OPT_SCOPE_MAP, true);
        $t = $this->tokens;
        for ($i = $pos; $i < $this->tcount; $i++) {
            if (Tokenizer::meaningfull($t[$i][0])) {
                $i--;
                break;
            }
            $node->tokens[] = $t[$i];
            if (preg_match('/\\*\\//u', $t[$i][1])) {
                // End of comment.
                break;
            }
        }
        if ($i === $this->tcount) {
            $i--;
        }
        $node->end = $i;
        $node->end_line = $t[$i][2];
        $this->debug("Exiting comment at {$node->end_line}", $depth, OPT_SCOPE_MAP, true);
        $ret = $i;
        return $node;
    }