MMOframework
Pourquoi l'IA Playground Bibliothèques Documentation Rechercher Agence
FR EN
Index

KanbanBoard

MMO\admin\helpers · 1 symbole · générée le 27 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
Espace de noms
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://mmoframework.fr/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://mmoframework.fr/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
roleOf($status)
roles()The column each step of a ticket's life is in, whatever the board calls its columns: intake where a ticket enters (Backlog), ready where it waits with its prompt (À faire), doing while it is …
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
typeOf($status)
WriteFile($filename, $json) staticWrite through a temporary file: a crash never leaves half a file.
__construct($file)

Propriétés1

Méthodes17

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

KanbanBoard.php:260

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
retournearraythe comment

comments($ticket)

KanbanBoard.php:144
function comments(string $ticket): array
$ticketstring
retournearraya 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
retournemixedwhat $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
retournemixedwhat $action answers

move($ticket, $status)

KanbanBoard.php:236

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
retourneboolfalse when there is no such ticket

Normalize($json)

staticKanbanBoard.php:117
static function Normalize(array $json): array
$jsonarraya board file, or nothing
retournearrayint, 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
retourne

ReadFile($filename)

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

roleOf($status)

KanbanBoard.php:214
function roleOf(string $status): ?string
$statusstring
retournenull | stringthe role of a status (roles), the later one when it plays two (a board whose only active column is both En cours and Recette: verify), null when it plays none

roles()

KanbanBoard.php:192

The column each step of a ticket's life is in, whatever the board calls its columns: intake where a ticket enters (Backlog), ready where it waits with its prompt (À faire), doing while it is worked on (En cours), verify while its checklist proves it (Recette), done (Terminé). The board's roles (at the top of its file) say it; a role it leaves out is found from the statuses' types: the first backlog, the second backlog, the first active, the last active, the first done.

function roles(): array
retournearray?string, ready: ?string, doing: ?string, verify: ?string, done: ?string} each role's status id, null when the board has no column for it
(new KanbanBoard($file))->roles()['verify']; // 'review'

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
retourneboolwhether the ticket changed

statusOfType($type)

KanbanBoard.php:175
function statusOfType(string $type): ?string
$typestringbacklog, active or done
retournenull | 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
retournevoid

typeOf($status)

KanbanBoard.php:223
function typeOf(string $status): ?string
$statusstring
retournenull | stringthe type of a status of the board (backlog, active or done), null when there is no such status

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
retournevoid