phplinter\Lint\LClass::process_tokens PHP Method

process_tokens() protected method

----------------------------------------------------------------------+
protected process_tokens ( )
    protected function process_tokens()
    {
        $tcnt = $this->node->token_count;
        $et = $this->node->tokens;
        $locals = array();
        $methods = 0;
        $comment = false;
        for ($i = 0; $i < $tcnt; $i++) {
            $token = $et[$i];
            switch ($token[0]) {
                case T_EXTENDS:
                    $n = $this->next($i);
                    $this->node->extends = $et[$n][1];
                    break;
                case T_IMPLEMENTS:
                    $n = $this->next($i);
                    $this->node->implements = $et[$n][1];
                    break;
                case T_COMMENT:
                case T_DOC_COMMENT:
                    $comment = true;
                    break;
                case T_VAR:
                    $this->report('WAR_OLD_STYLE_VARIABLE', null, $token[2]);
                    break;
                case T_VARIABLE:
                    if (!$comment) {
                        $this->report('DOC_NO_DOCHEAD_PROPERTY', $token[1], $token[2]);
                    }
                    $comment = false;
                    if ($methods > 0) {
                        $this->report('CON_MISPLACED_PROPERTY');
                    }
                    $locals[] = substr($token[1], 1);
                    break;
                case T_FUNCTION:
                    $comment = false;
                    $methods++;
                    break;
                default:
                    $this->common_tokens($i);
                    break;
            }
        }
        $lcnt = $this->process_locals($locals);
        $compares = array('REF_CLASS_METHODS' => $methods, 'REF_CLASS_PROPERTYS' => $lcnt);
        foreach ($compares as $k => $_) {
            if ($this->config->match_rule($k, $_)) {
                $this->report($k, $_);
            }
        }
    }