@param string $comment

@return bool
421601
protected function getInvalidReturnType($comment)
    {
        if (preg_match(self::ALLOWED_RETURN_TYPES_PATTERN, $comment, $returnType)) {
            return $returnType[self::INVALID_RETURN_TYPE_MATCH];
        }

        return false;
    }
739664
protected function cleanInput($comment)
    {
        $comment = trim(
            preg_replace(
                '#[ \t]*(?:\/\*\*|\*\/|\*)?[ \t]{0,1}(.*)?#u',
                '$1',
                $comment
            )
        );

        // reg ex above is not able to remove */ from a single line docblock
        if (substr($comment, -2) == '*/') {
            $comment = trim(substr($comment, 0, -2));
        }

        // normalize strings
        $comment = str_replace(array("\r\n", "\r"), "\n", $comment);

        return $comment;
    }
307027
public static function comment($comment) {
		$text = null;
		$tags = [];
		$description = null;
		$comment = trim(preg_replace('/^(\s*\/\*\*|\s*\*{1,2}\/|\s*\* ?)/m', '', $comment));
		$comment = str_replace("\r\n", "\n", $comment);

		if ($items = preg_split('/\n@/ms', $comment, 2)) {
			list($description, $tags) = $items + ['', ''];
			$tags = $tags ? static::tags("@{$tags}") : [];
		}

		if (strpos($description, "\n\n")) {
			list($description, $text) = explode("\n\n", $description, 2);
		}
		$text = trim($text);
		$description = trim($description);
		return compact('description', 'text', 'tags');
	}
788390
public function setSubscriptionComment($comment)
    {
        if (strlen($comment) > 200) {
            throw new InvalidArgumentException("Subscription comment cannot be longer than 200 characters");
        }
        if (preg_match('/[^a-zA-Z0-9_ -]/', $comment)) {
            throw new InvalidArgumentException("Subscription comment cannot contain special characters");
        }
        $this->parameters['sub_comment'] = $comment;
    }
1130211
public function addComment($comment)
    {
        if ($this->comments === null) {
            $this->comments = [];
        }
        $this->comments[] = $comment;
    }
334512
public function addComment(Comment $comment)
    {
        if (!$this->comments->contains($comment)) {
            $this->comments->add($comment);
        }
    }
1234945
protected function isComment($line)
    {
        if (is_string($line) && (substr($line, 0, 1) == ';' || trim($line) == '')) {
            return true;
        }

        return false;
    }
556341
private function getDocDescription($comment)
    {
        $result = null;
        if (preg_match('/\*\s+([^@]*)\s+/s', $comment, $matches)) {
            $result = str_replace('*', "\n", trim(trim($matches[1], '*')));
        }

        return $result;
    }
1148236
public static function tagList(string $comment)
    {
        $comment = "@Description \n" . strtr(trim(preg_replace('/^\s*\**( |\t)?/m', '', trim($comment, '/'))), "\r", '');
        $parts   = preg_split('/^\s*@/m', $comment, -1, PREG_SPLIT_NO_EMPTY);

        $tags = [];
        foreach ($parts as $part) {
            $isMatch = preg_match('/^(\w+)(.*)/ms', trim($part), $matches);
            if ($isMatch == false) {
                continue;
            }
            $name = $matches[1];
            if (!isset($tags[$name])) {
                $tags[$name] = trim($matches[2]);
                continue;
            }
            if (is_array($tags[$name])) {
                $tags[$name][] = trim($matches[2]);
                continue;
            }
            $tags[$name] = [$tags[$name], trim($matches[2])];
        }

        return $tags;
    }
1279462
public function addComment($comment)
    {
        $comment->setPaymentId($this->getPaymentId());
        $comment->save();

        $this->load($this->getPaymentId());

        return $comment;
    }
914480
public static function description(string $comment): string
    {
        $comment = \str_replace("\r", '', \trim(\preg_replace('/^\s*\**( |\t)?/m', '', trim($comment, '/'))));

        if (\preg_match('/^\s*@\w+/m', $comment, $matches, \PREG_OFFSET_CAPTURE)) {
            $comment = \trim(\substr($comment, 0, $matches[0][1]));
        }

        return $comment;
    }
1153400
public function setComment($comment): self
    {
        if (!empty($comment)) {
            if (is_array($comment)) {
                $this->docComment->setLines($comment);
            } elseif (is_string($comment)) {
                $this->docComment->setString($comment);
            }
        }

        return $this;
    }
1074207
public function update(Comment &$comment)
    {
        $data = $comment->exportData();
        $endpoint = '/admin/comments/'.$comment->id.'.json';
        $response = $this->request(
            $endpoint, 'PUT', array(
            'comment' => $data
            )
        );
        $comment->setData($response['comment']);
    }
397252
public static function firstLine(string $comment): string
    {
        $docLines = \preg_split('~\R~u', $comment);

        if (isset($docLines[1])) {
            return \trim($docLines[1], "/\t *");
        }

        return '';
    }
627805
public function check($val, $comment = "")
	{
		$this->commonComment = trim($comment) . " ";
		$this->val = $val;
		$this->isValid = true;
		return $this;
	}
1081882
public function delete_comment($commentid) {
        global $DB;
        if ($DB->record_exists('comments', array('id' => $commentid))) {
            $DB->delete_records('comments', array('id' => $commentid));
            return true;
        }
        return false;
    }
414424
public function comment($comment = null) {
		if ($comment) {
			$this->_config['comment'] = $comment;
			return $this;
		}
		return $this->_config['comment'];
	}