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

Checklist

MMO\admin\helpers · 1 symbole · générée le 27 Oct 2026

class

Checklist

Checklist.php:50

A release checklist: everything to look at before a version is committed or shipped, one box per item -- or one per item and per member, when the team checks it together.

class MMO\admin\helpers\Checklist
Espace de noms
MMO\admin\helpers
Kept in a JSON file of its own, `{folder}/{name}.json` ([`ChecklistController`](https://mmoframework.fr/fr/documentation/mmo.admin/php/controllers/ChecklistController.md#checklistcontroller)): {"version": 4, "updatedAt": "...", "title": "my.oviepro 4.1: review before commit", "description": "...", "board": "my.oviepro-deploy", "boardUrl": "boards/oviepro-deploy", "members": [], "recipe": {...}, // how [`ChecklistBuilder`](https://mmoframework.fr/fr/documentation/mmo.admin/php/helpers/ChecklistBuilder.md#checklistbuilder) makes the items "types": {"pdf": {"label": "PDF and printing", "icon": "file-pdf"}}, // what each `kind` is called, and its icon "groups": {"General": {"icon": "globe"}}, // a group's icon "refPrefix": "R421-", "lastRef": 12, // what the items' refs start with, the last number given "items": [{id, ref, group, section, kind, title, detail, url, note, tickets, recheck, action}, ...], "checks": {"<item id>": {"<member, or *>": {"at": "...", "by": "marc"}}}, "runs": {"<item id>": {"at": "...", "by": "marc", "exitCode": 0, "passed": true, "duration": 21.4}}, // an action's last ▶ "decisions": {"<item id>": {"at": "...", "by": "marc", "option": "..."}}, // what a decision item's button chose "release": {"name": "4.1", "startedAt": "...", "startedBy": "marc"}, // the round being checked "history": [{name, startedAt, startedBy, closedAt, closedBy, done, total}, ...]} // the rounds before, last first - An item's `id` is the hash of its group, section and title ([`ItemId`](https://mmoframework.fr/fr/documentation/mmo.admin/php/helpers/Checklist.md#checklist-itemid)): items are rebuilt whenever the code changes, and what was checked stays checked while its item is still there. - An item's `ref` is what people call it by (`R421-12`, [`AssignRefs`](https://mmoframework.fr/fr/documentation/mmo.admin/php/helpers/Checklist.md#checklist-assignrefs)): `refPrefix` and a number, shown beside its title. Unique in the checklist and never given twice (`lastRef` only grows), it stays the item's while the item is there -- a rebuild keeps it, an item file may give it (a release carries the refs of the checklist it comes from). - `group` is what the page folds (a library, "pages", "before committing"), `section` a heading inside it (a folder, a page), `kind` what the item is (`code`, `page`, `global`...), `url` where to look. - `tickets` are the ids of the board's tickets the item verifies. A ticket all of whose items are checked is verified ([`tickets`](https://mmoframework.fr/fr/documentation/mmo.admin/php/helpers/Checklist.md#checklist-tickets)): it gets a label on the board, and can then be moved to done. - Without `members`, an item has one box (`*`). With them, it has one per member, and is done once all are checked. - A checklist is checked again at each release: the first check starts the round (`release`), [`reset`](https://mmoframework.fr/fr/documentation/mmo.admin/php/helpers/Checklist.md#checklist-reset) closes it -- every box unchecked, a line of `history` saying how far it got. [`startRound`](https://mmoframework.fr/fr/documentation/mmo.admin/php/helpers/Checklist.md#checklist-startround) does it when the items file asks for a round the checklist is not at (its `round`, [`ChecklistBuilder::meta`](https://mmoframework.fr/fr/documentation/mmo.admin/php/helpers/ChecklistBuilder.md#checklistbuilder-meta)): the release that brings it starts it. - `recheck` is what an item asks to be checked again for (a version, `4.2.9`): a rebuild bringing a `recheck` the item did not have unchecks its boxes, the others' stay -- a release that touched a page asks its checks again, only them. - `note` is a word on the item's section (a page's), `types` and `groups` how the page shows kinds and groups. - `action` is how the item is checked in one click ([`NormalizeAction`](https://mmoframework.fr/fr/documentation/mmo.admin/php/helpers/Checklist.md#checklist-normalizeaction)): a diff to read (`diff`), a page to open with its steps (`page`), a command the server runs (`run`), a choice to make (`decision`), something only a person can do (`manual`); null for none.
$list = new Checklist(['title' => 'acme 2.0', 'items' => [['group' => 'acme', 'section' => 'src', 'title' => 'src/A.php']]]); $id = $list->data['items'][0]['id']; $list->check($id, true, 'marc'); $list->progress(); // ['total' => 1, 'done' => 1, ...]

Index

ACTIONSthe types of an item's action (NormalizeAction)
ANYONEthe key of an item's only box, when the checklist has no members
REF_PREFIXwhat the refs of a checklist without refPrefix start with
REVISIONa git revision an action may name: no option, no space, nothing a shell reads
data
AssignRefs($json) staticGive a ref to each item of $json that has none, or one another item has: refPrefix and the number after lastRef.
boxes()
check($id, $checked, $by, $member)Check an item, or uncheck it.
Edit($filename, $action, $write) staticRun $action on the checklist of $filename, locked: what it changes is written back when $write.
idOf($idOrRef)
ids()
isDone($id)
item($idOrRef)
ItemId($group, $section, $title) static
itemsOf($ticket)
Normalize($json) static
NormalizeAction($action, $errors) staticAn item's action, checked: what the page offers to check it in one click.
NormalizeItems($items) static
progress()
reset($name, $by)Start a new round (a release to check): every box is unchecked, and a line of history says how far the round before got.
setItems($items)Replace the items: what was checked stays checked when its item is still there, and keeps its ref -- unless the item asks to be checked again (a recheck it did not have).
setRefPrefix($prefix)Change what the refs start with: an item's ref keeps its number (C12 becomes R421-12).
startRound($name, $by)Start the round $name unless the checklist is at it already: what an items file asking for a new round does (ChecklistBuilder::meta).
tickets($tickets)
toArray()
__construct($data)

Constantes4

ACTIONS

the types of an item's action (NormalizeAction)

const ACTIONS = ['diff', 'page', 'run', 'decision', 'manual']

ANYONE

the key of an item's only box, when the checklist has no members

const ANYONE = '*'

REF_PREFIX

what the refs of a checklist without refPrefix start with

const REF_PREFIX = 'C'

REVISION

a git revision an action may name: no option, no space, nothing a shell reads

const REVISION = '/^(?!-)[\\w.\\/@^~{}+-]{1,200}$/u'

Propriétés1

Méthodes21

AssignRefs($json)

staticChecklist.php:241

Give a ref to each item of $json that has none, or one another item has: refPrefix and the number after lastRef.

static function AssignRefs(array &$json): voidA ref the item brings (an item file's) is kept, and `lastRef` raised past its number.
$jsonarraya checklist, normalized (Normalize)
retournevoid
$json = ['refPrefix' => 'R', 'lastRef' => 2, 'items' => [['ref' => 'R1', ...], ['ref' => '', ...]]]; Checklist::AssignRefs($json); // the second item is R3, lastRef 3

boxes()

Checklist.php:304
function boxes(): array
retournearraywho checks each item: the members, or one box for anyone

check($id, $checked, $by, $member)

Checklist.php:339

Check an item, or uncheck it.

function check(string $id, bool $checked, string $by, ?string $member = null): void
$idstringthe item's id, or its ref
$checkedbool
$bystringwho
$member = nullnull | stringwhose box, when the checklist has members
retournevoid
lèvean unknown item or member

Edit($filename, $action, $write)

staticChecklist.php:78

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

static function Edit(string $filename, callable $action, callable|bool $write = false): mixed
$filenamestring
$actioncallable
$write = falsecallable | bool
retournemixedwhat $action answers

idOf($idOrRef)

Checklist.php:312
function idOf(string $idOrRef): ?string
$idOrRefstringan item's id, or its ref (R421-12)
retournenull | stringthe item's id, null for none

ItemId($group, $section, $title)

staticChecklist.php:230
static function ItemId(string $group, string $section, string $title): string
$groupstring
$sectionstring
$titlestring
retournestringan item's id: its group, section and title -- rewording an item starts it again, unchecked
Checklist::ItemId('mmo.core', 'src/entities', 'src/entities/Entity.php (modified)'); // 'a3f1...' (12 characters)

Normalize($json)

staticChecklist.php:95
static function Normalize(array $json): array
$jsonarraya checklist file, or nothing
retournearraythe checklist with every key; what else the file holds is kept

NormalizeAction($action, $errors)

staticChecklist.php:174

An item's action, checked: what the page offers to check it in one click.

static function NormalizeAction(mixed $action, ?array &$errors = null): ?array- `{type: "diff", repository, path?, from?, to?}`: the changes to read in `<mmo-diff>` -- `repository` a label of the recipe's `repositories`, `from` the old revision (`HEAD` when none), `to` the new one (none: the working tree); - `{type: "page", url, as?, steps: [...]}`: the page to open, as whom -- a profile of the recipe's `accounts` (its key: the page opens it in that test account's session, [`TestAccounts`](https://mmoframework.fr/fr/documentation/mmo.admin/php/helpers/TestAccounts.md#testaccounts)), else the words of the check (« an account limited to a group ») --, and what to do and see there, step by step; - `{type: "run", command, expect?, match?, notMatch?, cwd?}`: a command the server runs when it is on its list ([`ChecklistController::$run`](https://mmoframework.fr/fr/documentation/mmo.admin/php/controllers/ChecklistController.md#checklistcontroller)), in `cwd` (a label of the recipe's `repositories`); the item is checked when it ends with 0, its output holds `match` (a text, or a `/regular expression/`; without one, `expect`) and not `notMatch`. `expect` is what a person reads (« 78 à rattacher… »), `match` what the machine finds ([`ChecklistBuilder::DeriveMatch`](https://mmoframework.fr/fr/documentation/mmo.admin/php/helpers/ChecklistBuilder.md#checklistbuilder-derivematch) gives one by family of command); - `{type: "decision", ticket, question, options: [...], asked?}`: a choice, posted on the ticket; `asked` the date it was asked: a decision posted on the ticket since answers it; - `{type: "manual", command?, steps?, as?}`: what only a person can do (a server, a console): a command to copy, steps; `as` the account a request is sent as (a profile, as a page's).
$actionmixed
$errors = nullnull | arraywhat is wrong with it, filled when it is refused
retournenull | arraythe action with its keys, trimmed; null for none, or for one that is not valid
Checklist::NormalizeAction(['type' => 'run', 'command' => ' phpunit ']); // ['type' => 'run', 'command' => 'phpunit', 'expect' => null, 'match' => null, 'notMatch' => null, 'cwd' => null]Checklist::NormalizeAction(['type' => 'diff'], $errors); // null, $errors: ['a diff needs `repository`.']

NormalizeItems($items)

staticChecklist.php:124
static function NormalizeItems(array $items): array
$itemsarray
retournearraystring, ref: string, group: string, section: string, kind: string, title: string, detail: string, url: ?string, note: string, tickets: list<string>, recheck: string, action: ?array}> every item with every key, its id computed when it has none; an item without a title is dropped, an action that is not valid too (NormalizeAction) -- the item stays, without it

progress()

Checklist.php:405
function progress(): array
retournearrayint, done: int, boxes: int, checked: int} items, items done, and boxes when there are members

reset($name, $by)

Checklist.php:363

Start a new round (a release to check): every box is unchecked, and a line of history says how far the round before got.

function reset(string $name, string $by): void
$namestringthe new round's name (4.2), '' for none
$bystringwho
retournevoid
$list->reset('4.2', 'marc'); // $list->data['history'][0]: ['name' => '4.1', ..., 'done' => 12, 'total' => 40]

setItems($items)

Checklist.php:279

Replace the items: what was checked stays checked when its item is still there, and keeps its ref -- unless the item asks to be checked again (a recheck it did not have).

function setItems(array $items): array
$itemsarray
retournearraythe ids of the items unchecked because of their recheck
$list->setItems([['group' => 'g', 'section' => 'Login', 'title' => 'The form shows', 'recheck' => '4.2.9']]); // its boxes unchecked, once

setRefPrefix($prefix)

Checklist.php:258

Change what the refs start with: an item's ref keeps its number (C12 becomes R421-12).

function setRefPrefix(string $prefix): void
$prefixstring'' for REF_PREFIX
retournevoid

startRound($name, $by)

Checklist.php:383

Start the round $name unless the checklist is at it already: what an items file asking for a new round does (ChecklistBuilder::meta). A checklist nobody checked yet is only named, without a line of history.

function startRound(string $name, string $by): bool
$namestringthe round (4.2.9), '' for none: nothing to do
$bystringwho
retourneboolwhether the round started
$list->startRound('4.2.9', 'auto : release'); // true, every box unchecked; again: false

tickets($tickets)

Checklist.php:423
function tickets(?array $tickets = null): array
$tickets = nullnull | array
retournearrayarray{title: string, status: string, total: int, checked: int, verified: bool}> each ticket the items name, with how many of its items are done; one the board does not have is left out when $tickets is given

toArray()

Checklist.php:447
function toArray(): array
retournearraythe checklist as json wants it: maps stay objects, even empty