Index

KanbanBoard

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

class

KanbanBoard

KanbanBoard.php:22

A <mmo-kanban> board kept in a JSON file: its data (statuses, labels, categories, people, tickets) and each ticket's discussion. The format BoardController serves (api/boards/{board}.json):

class MMO\admin\helpers\KanbanBoard
Namespace
MMO\admin\helpers
{"version": 3, "updatedAt": "2026-10-02T10:00:00+02:00", "data": {statuses, labels, categories, people, tickets}, "comments": {"<ticket id>": [{id, parent, author, body, createdAt, updatedAt}, ...]}} A release checklist ([`Checklist`](https://mcp.mmoframework.fr/documentation/mmo.admin/php/helpers/Checklist.md#checklist)) reads its tickets and their discussions, and writes back what its checks prove: a label on the verified tickets, a ticket moved to done with a comment saying what was checked. Every access goes through [`Edit`](https://mcp.mmoframework.fr/documentation/mmo.admin/php/helpers/KanbanBoard.md#kanbanboard-edit), which holds `{file}.lock` -- the same lock the boards' controller takes, so a board saved from its page meanwhile is neither lost nor overwritten.
KanbanBoard::Edit('boards/my.oviepro-deploy.json', function (KanbanBoard $board) { $board->comment('12', '**Release** : checked.', ['login' => 'marc', 'name' => 'marc']); }, true);

Index

file
comment($ticket, $body, $author, $parent)Add a comment to a ticket's discussion.
comments($ticket)
Edit($filename, $action, $write) staticRun $action on the board of $filename, locked: what it changes is written back when $write.
Locked($filename, $action) staticRun $action holding {filename}.lock: one request at a time on a file, so a comment added while the board saves is not lost.
move($ticket, $status)Move a ticket to $status, stamping it as <mmo-kanban> does when a ticket is dropped in a column of that type.
Normalize($json) static
OpenLock($lock) staticOpen a lock file, made when missing.
ReadFile($filename) static
setLabel($ticket, $label, $on)Give $label to a ticket, or take it away; the board learns the label when it does not know it yet.
statusOfType($type)
tickets()
touch()a new version: the page that holds the board sees it changed
WriteFile($filename, $json) staticWrite through a temporary file: a crash never leaves half a file.
__construct($file)

Properties1

Methods14

comment($ticket, $body, $author, $parent)

KanbanBoard.php:212

Add a comment to a ticket's discussion.

function comment(string $ticket, string $body, array $author, ?string $parent = null): array
$ticketstring
$bodystringmarkdown
$authorarray
$parent = nullnull | stringthe comment it answers
returnsarraythe comment

comments($ticket)

KanbanBoard.php:144
function comments(string $ticket): array
$ticketstring
returnsarraya ticket's discussion, oldest first: {id, parent, author, body, createdAt, updatedAt} each

Edit($filename, $action, $write)

staticKanbanBoard.php:39

Run $action on the board of $filename, locked: what it changes is written back when $write.

static function Edit(string $filename, callable $action, bool $write = false): mixed
$filenamestring
$actioncallable
$write = falsebool
returnsmixedwhat $action answers
KanbanBoard::Edit($filename, fn(KanbanBoard $b) => $b->tickets());

Locked($filename, $action)

staticKanbanBoard.php:59

Run $action holding {filename}.lock: one request at a time on a file, so a comment added while the board saves is not lost. Its folder is created when missing.

static function Locked(string $filename, callable $action): mixed
$filenamestring
$actioncallable
returnsmixedwhat $action answers

move($ticket, $status)

KanbanBoard.php:188

Move a ticket to $status, stamping it as <mmo-kanban> does when a ticket is dropped in a column of that type.

function move(string $ticket, string $status): bool
$ticketstring
$statusstring
returnsboolfalse when there is no such ticket

Normalize($json)

staticKanbanBoard.php:117
static function Normalize(array $json): array
$jsonarraya board file, or nothing
returnsarrayint, updatedAt: ?string, data: array, comments: array} with every key, whatever the file held (what else it holds is kept)

OpenLock($lock)

staticKanbanBoard.php:83

Open a lock file, made when missing. The web server and a command line both lock the same files, and the one that made it owns it: it is made writable by all, and opened read-only when it is not writable (flock() needs no write access) -- a lock made by the web server before stopped every command at cannot lock.

static function OpenLock(string $lock)
$lockstring
returns

ReadFile($filename)

staticKanbanBoard.php:94
static function ReadFile(string $filename): array
$filenamestring
returnsarraythe file's json, an empty array when there is none

setLabel($ticket, $label, $on)

KanbanBoard.php:155

Give $label to a ticket, or take it away; the board learns the label when it does not know it yet.

function setLabel(string $ticket, array $label, bool $on): bool
$ticketstring
$labelarray
$onbool
returnsboolwhether the ticket changed

statusOfType($type)

KanbanBoard.php:175
function statusOfType(string $type): ?string
$typestringbacklog, active or done
returnsnull | stringthe id of the board's first status of that type

touch()

KanbanBoard.php:127

a new version: the page that holds the board sees it changed

function touch(): void
returnsvoid

WriteFile($filename, $json)

staticKanbanBoard.php:105

Write through a temporary file: a crash never leaves half a file. The web server writes it: whoever runs it, the file stays editable by hand.

static function WriteFile(string $filename, array $json): void
$filenamestring
$jsonarray
returnsvoid