Index

IssueBoard

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

class

IssueBoard

IssueBoard.php:44

A repository's GitHub issues seen as the data of a kanban board (mmo.client's <mmo-kanban>), and the changes made on the board written back to the issues.

class MMO\git\helpers\IssueBoard extends MMO\git\classes\aBoard
Namespace
MMO\git\helpers
Extends
aBoard
### What an issue becomes | ticket | issue | |---------------|-------------------------------------------------------------------------------------------| | `id` | its number | | `title` | its title | | `description` | its body, without the comment below | | `status` | a label `status:<id>` while it is open; closed is the board's first "done" status | | `labels` | its other labels | | `category` | its milestone: the board's categories are the repository's milestones | | `assignee` | its first assignee's login | | `parent`, `start`, `end`, `constraint`, `startedAt` | a `<!-- mmo-kanban {...} -->` comment at the end of its body, which GitHub does not show | A status the board does not know and a label `status:<id>` names joins the board's statuses. A ticket removed from the board closes its issue as "not planned", and the board does not show those: GitHub cannot delete an issue through its REST API. ### Saving The board sends its data as it was given (`$before`) and as it is now (`$after`): [`save`](https://mcp.mmoframework.fr/documentation/mmo.git/php/helpers/IssueBoard.md#issueboard-save) compares them and changes only the issues whose GitHub fields differ, so an issue changed on GitHub meanwhile keeps the changes the board did not make. A ticket in `$after` and not in `$before` is a new issue; its id was the board's own, and `save()` answers which number it got.
GitHubAPI::Configure(['token' => $token, 'repository' => 'owner/name']); $board = new IssueBoard(GitHubAPI::Shared()); $data = $board->load(); // {statuses, labels, categories, tickets} $after = $data; $after['tickets'][0]['status'] = 'done'; $board->save($data, $after); // closes that issue

Index

METAthe name of the comment holding what GitHub has no field for
STATUSESthe statuses a board starts with: mmo-kanban's own
api
closedLimit
defaultStatus
repository
statuses
statusPrefix
diff($old, $new)
discussion($ticketId)
getRepository()
getTitle()
getUrl()
keepsColor($kind)a label's colour and a status's (its label's) are GitHub's
load()Read the repository's issues as a board's data.
save($before, $after)Write to GitHub what changed on the board.
saveColors($before, $after)Give the labels, and the labels the statuses are, the colours the board gave them; a status whose label does not exist yet gets one.
splitBody($body)
statusOf($label)
toFields($ticket, $statuses)
toTicket($issue, $statuses)
__construct($api, $repository)

Constants2

META

the name of the comment holding what GitHub has no field for

const META = 'mmo-kanban'

STATUSES

the statuses a board starts with: mmo-kanban's own

const STATUSES = […5 items]

Properties6

api

protected MMO\git\GitHubAPI $api
Type
GitHubAPI

closedLimit

int $closedLimit = 50
Type
int

defaultStatus

string $defaultStatus = 'todo'
Type
string

repository

protected ?string $repository
Type
null | string

statuses

array $statuses = […5 items]
Type
array

statusPrefix

string $statusPrefix = 'status:'
Type
string

Methods14

discussion($ticketId)

IssueBoard.php:210
function discussion(string $ticketId): ?MMO\git\helpers\IssueDiscussion
$ticketIdstring
returnsnull | IssueDiscussionthe issue's comments; null for an id that is not an issue's number

keepsColor($kind)

IssueBoard.php:273

a label's colour and a status's (its label's) are GitHub's

function keepsColor(string $kind): bool
$kindstring
returnsbool

load()

IssueBoard.php:97

Read the repository's issues as a board's data.

function load(): array
returnsarrayarray, labels: array, categories: array, tickets: array}
throwswhen GitHub refuses (no access, rate limit...)

save($before, $after)

IssueBoard.php:223

Write to GitHub what changed on the board.

function save(array $before, array $after): array
$beforearraythe board's data as load gave it
$afterarraythe board's data now
returnsarrayarray<string, string>} the number each new ticket got, by the id the board gave it
throwswhen GitHub refuses a change: the ones made before it are made

saveColors($before, $after)

IssueBoard.php:284

Give the labels, and the labels the statuses are, the colours the board gave them; a status whose label does not exist yet gets one.

protected function saveColors(array $before, array $after): void
$beforearray
$afterarray
returnsvoid

splitBody($body)

IssueBoard.php:198
protected function splitBody(string $body): array
$bodystring
returnsarraystring, 1: array} the text, and what its mmo-kanban comment holds

statusOf($label)

IssueBoard.php:190
protected function statusOf(string $label): ?string
$labelstring
returnsnull | stringthe status the label gives, null when it is a plain label

toFields($ticket, $statuses)

IssueBoard.php:309
function toFields(array $ticket, array $statuses): array
$ticketarray
$statusesarraythe board's
returnsarraystring, body: string, labels: string[], assignees: string[], milestone: ?int, state: string} the GitHub fields the ticket gives its issue

toTicket($issue, $statuses)

IssueBoard.php:145
function toTicket(array $issue, array $statuses): array
$issuearrayas GitHub gives it
$statusesarraythe board's
returnsarraythe ticket

__construct($api, $repository)

IssueBoard.php:73
function __construct(MMO\git\GitHubAPI $api, ?string $repository = null)
$apiGitHubAPI
$repository = nullnull | stringowner/name, or null for the api's own
Inherited members (8)
ConstantsDeclared byDescription
COLORSaBoardthe colours mmo-kanban names, as GitHub's label colours: a colour read from GitHub is named when it is one
MethodsDeclared byDescription
ColorHex($color)aBoard
ColorName($color)aBoard
getState()aBoard
meta($ticket, $type)aBoard
remap($ticket, $ids, $categories)aBoardGive the board's ids of new tickets and categories the ones GitHub gave them.
remapCondition($node, $ids)aBoard
setState($state)aBoard