Index

IssueDiscussion

MMO\git\helpers · 1 symbol · generated 5 Oct 2026

class

IssueDiscussion

IssueDiscussion.php:31

The discussion of a GitHub issue (or pull request) as mmo.client's <mmo-kanban> shows it: comments with their author, which can answer one another.

class MMO\git\helpers\IssueDiscussion
Namespace
MMO\git\helpers
GitHub's comments are flat: a reply is a comment that starts with a comment of its own, which GitHub does not show, naming the one it answers, and a quote of it, which GitHub shows: ```markdown <!-- mmo-kanban reply-to:2165473 --> > [@marc](https://github.com/owner/name/issues/12#issuecomment-2165473) wrote: > The first line of what it answers… The reply. ``` The board shows the reply under what it answers, without the quote; github.com shows it in its place by date, with the quote saying what it answers.
$discussion = new IssueDiscussion(GitHubAPI::Shared(), 'owner/name', 12); $first = $discussion->add('Is this still happening?'); $discussion->add('Yes, on 2.1.', $first['id']);

Index

EXCERPTthe length of the quote of what a reply answers
REPLYwhat starts a reply
api
number
repository
add($body, $parent)
list()
mine($id)
own($id)
remove($id)Delete one's own comment.
splitReply($body)
toComment($c)
update($id, $body)Change one's own comment: a reply still answers what it answered.
__construct($api, $repository, $number)

Constants2

EXCERPT

the length of the quote of what a reply answers

const EXCERPT = 120

REPLY

what starts a reply

const REPLY = 'mmo-kanban reply-to:'

Properties3

api

protected MMO\git\GitHubAPI $api
Type
GitHubAPI

number

protected int $number
Type
int

repository

protected string $repository
Type
string

Methods9

add($body, $parent)

IssueDiscussion.php:60
function add(string $body, ?string $parent = null): array
$bodystringmarkdown
$parent = nullnull | stringthe id of the comment it answers, null for none
returnsarraythe new comment
throwswhen the comment answered is not one of this issue's

list()

IssueDiscussion.php:50
function list(): array
returnsarraythe comments, oldest first: {id, parent, author: {login, name, avatar, url}, role, body, createdAt, updatedAt, url, mine} each (toComment)

mine($id)

IssueDiscussion.php:159
protected function mine(string $id): array
$idstring
returnsarraythe comment
throwswhen it is not one of this issue's comments, or not the token owner's

remove($id)

IssueDiscussion.php:93

Delete one's own comment.

function remove(string $id): void
$idstring
returnsvoid
throwswhen it is not one of this issue's comments, or not the token owner's

splitReply($body)

IssueDiscussion.php:133
protected function splitReply(string $body): array
$bodystring
returnsarray?string, 1: string, 2: string} the comment it answers (null for none), the header saying so, and the text after it

update($id, $body)

IssueDiscussion.php:81

Change one's own comment: a reply still answers what it answered.

function update(string $id, string $body): array
$idstring
$bodystringmarkdown
returnsarraythe comment, as it is now
throwswhen it is not one of this issue's comments, or not the token owner's