phplinter\Lint\LComment::lint PHP Method

lint() public method

----------------------------------------------------------------------+
public lint ( ) : Array
return Array ----------------------------------------------------------------------+
    public function lint()
    {
        $tcnt = count($this->node->tokens);
        $empty = true;
        $code = false;
        for ($i = 0; $i < $tcnt; $i++) {
            $comment = $this->node->tokens[$i][1];
            if ($this->node->tokens[$i] === T_NEWLINE) {
                continue;
            }
            if (preg_match('/[^\\s\\/\\*]+/u', $comment)) {
                $empty = false;
                if (preg_match('/(FIXME|TODO|HACK|WTF)/iu', $comment, $m)) {
                    switch (mb_strtolower($m[1])) {
                        case 'fixme':
                        case 'todo':
                            $this->report('INF_UNDONE', $m[1]);
                            break;
                        case 'hack':
                            $this->report('WAR_HACK_MARKED');
                            break;
                        case 'wtf':
                            $this->report('INF_FOUND_WTF');
                            break;
                    }
                }
                if (!$code && !$this->config->match_rule('CON_WS_COMMENTED_CODE', $comment)) {
                    $this->report('CON_WS_COMMENTED_CODE');
                    $code = true;
                }
            }
        }
        if ($empty) {
            $this->report('CON_EMPTY_COMMENT');
        }
        return $this->reports;
    }
LComment