phplinter\Lint\Node::_cleanc PHP Method

_cleanc() protected method

----------------------------------------------------------------------+
protected _cleanc ( )
    protected function _cleanc()
    {
        $comment = array();
        if (!empty($this->comments)) {
            foreach ($this->comments as $_) {
                if ($_->type !== T_DOC_COMMENT) {
                    continue;
                }
                $val = '';
                $tag = '';
                $text = '';
                foreach ($_->tokens as $t) {
                    if ($tag && preg_match('/\\*\\//', $t[1])) {
                        $comment[$tag] = $val;
                        $val = '';
                        $tag = '';
                    }
                    $s = preg_replace('/^[ \\t]*\\/\\*\\*+|\\**\\*\\/|^[ \\t]*\\*/u', '$1', $t[1]);
                    // remove lines
                    $s = trim(preg_replace('/[\\+\\*]?(\\-\\-\\-+|~~~+|\\*\\*\\*+)[\\+\\*]?/', '', $s), " \t/");
                    if ($s && preg_match('/@([a-z]+)(.*)/ui', $s, $m)) {
                        if ($tag) {
                            $comment[$tag] = $val;
                            $val = '';
                            $tag = '';
                        }
                        $tag = trim($m[1]);
                        $val = trim($m[2]);
                    } else {
                        if ($tag) {
                            $val .= $s;
                        } else {
                            $text .= $s;
                        }
                    }
                }
                if ($tag) {
                    $comment[$tag] = $val;
                }
                $comment['text'] = $text;
            }
        }
        $this->comments = $comment;
    }