• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

JBZoo / Mermaid-PHP / 30428623629
92%

Build:
DEFAULT BRANCH: master
Ran 29 Jul 2026 06:35AM UTC
Jobs 6
Files 50
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

23 Jul 2026 07:33PM UTC coverage: 91.755% (+1.4%) from 90.404%
30428623629

push

github

web-flow
feat: add Sequence Diagram support (#10) (#33)

## Summary

Adds first-class Mermaid `sequenceDiagram` support to the library,
following the same fluent, object-oriented style as the existing
`Graph`/`Timeline` families. Requested in #10.

A sequence diagram is modeled as an **ordered stream of statements with
nesting** (not two flat sets like `Graph`). A tiny `Statement` interface
(`render(int $shift): string`, extends `\Stringable`) is implemented by
every body element; participants/boxes form a header region; the
`SequenceDiagram` container renders header + ordered body and plugs into
the existing `Render`/`Helper` machinery.

## What's covered (full `sequenceDiagram` syntax)

- **Participants / actors** — aliases, `safeMode` (md5 ids, like
`Node`), repeatable per-participant `link()`
- **Messages** — all 10 arrow types, inline activation (`+`/`-`,
mutually exclusive) and explicit `activate`/`deactivate`
- **Notes** — `left of` / `right of` / `over` (one or two participants)
- **Lifecycle** — `create` / `destroy`; **comments** (`%%`)
- **Boxes** — participant grouping with optional color
- **Control blocks** — `loop`, `opt`, `break`, `rect` (single-section)
and `alt`/`else`, `par`/`and`, `critical`/`option` (multi-section),
arbitrarily nestable
- **Container** — title frontmatter, `autonumber`, `getParticipant()`,
`addMessageByIds()` (throws on unknown id), `renderHtml()`,
`getLiveEditorUrl()`

## Notes

- The `break` block class is named **`BreakBlock`** — `break` is a
reserved word in PHP, so `class Break` is a parse error. It still emits
the Mermaid `break` keyword.
- `Render::html()` / `Helper::getLiveEditorUrl()` union types widened to
accept `SequenceDiagram`.
- README updated with the new diagram type and a runnable example.

## Testing

- `tests/SequenceDiagramTest.php`: 23 tests, 58 assertions — every arrow
type, activation, notes, lifecycle, comments, boxes/links, all blocks +
nesting, container ordering, `addMessageByIds` errors, and an ... (continued)

153 of 158 new or added lines in 16 files covered. (96.84%)

690 of 752 relevant lines covered (91.76%)

79.63 hits per line

Uncovered Changes

Lines Coverage ∆ File
2
86.67
src/SequenceDiagram/Participant.php
2
96.43
src/SequenceDiagram/SequenceDiagram.php
1
94.44
src/SequenceDiagram/Block/Block.php
Jobs
ID Job ID Ran Files Coverage
1 30428623629.1 29 Jul 2026 06:35AM UTC 50
91.76
GitHub Action Run
2 30428623629.2 29 Jul 2026 06:35AM UTC 50
91.76
GitHub Action Run
3 30428623629.3 29 Jul 2026 06:35AM UTC 50
91.76
GitHub Action Run
4 30428623629.4 29 Jul 2026 06:35AM UTC 50
91.76
GitHub Action Run
5 30428623629.5 29 Jul 2026 06:35AM UTC 50
91.76
GitHub Action Run
6 30428623629.6 29 Jul 2026 06:35AM UTC 50
91.76
GitHub Action Run
Source Files on build 30428623629
  • Tree
  • List 50
  • Changed 2
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 5cee3c55 on github
  • Prev Build on master (#30002095152)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc