@@ -153,8 +153,9 @@ replays a stored capture with no debugger host present.
153153
154154## Presentation vocabulary
155155
156- Five types are published: ` CollectorInterface ` , ` Panel ` , ` PanelView ` , ` Tone ` , and ` ColumnStyle ` . Everything a panel can
157- display is a ` PanelView ` method, so there is no value class to import and no shape to build by hand.
156+ Five types are published for panel authors: ` CollectorInterface ` , ` Panel ` , ` PanelView ` , ` Tone ` , and ` ColumnStyle ` .
157+ Everything a panel can display is a ` PanelView ` method, so an extension imports no value class and builds nothing by
158+ hand.
158159
159160``` php
160161use PHPForge\Debug\{ColumnStyle, PanelView, Tone};
@@ -174,9 +175,26 @@ PanelView::create()
174175```
175176
176177Plain scalars and ` null ` become text. ` PanelView::text() ` , ` ::strong() ` , ` ::code() ` , ` ::preview() ` , ` ::badge() ` , and
177- ` ::value() ` produce validated inline values accepted wherever a scalar is accepted. Every method validates its
178- arguments and rejects invalid input with an explicit ` InvalidArgumentException ` . The host reads the finished
179- description through ` summaryMetrics() ` , ` toolbarMetrics() ` , ` blocks() ` , and ` isActive() ` .
178+ ` ::value() ` produce validated inline values accepted wherever a scalar is accepted. Methods with explicit value
179+ validation reject invalid input with an ` InvalidArgumentException ` ; arguments with incompatible declared types raise
180+ PHP's native ` TypeError ` .
181+
182+ The host reads the finished description through ` summaryMetrics() ` , ` toolbarMetrics() ` , ` blocks() ` , and ` isActive() ` .
183+ Those accessors return ` PHPForge\Debug\Presenter ` value objects: ` SummaryMetric ` , ` ToolbarMetric ` , and the blocks,
184+ entries, and inline values behind them. A renderer narrows each value with ` instanceof ` over the sealed ` Block ` and
185+ ` Inline ` unions, which static analysis proves exhaustive, and reads its public properties. Inline text carries a
186+ ` TextStyle ` case and a table carries its ` ColumnStyle ` cases, so semantics reach the markup without parsing strings.
187+
188+ ``` php
189+ use PHPForge\Debug\Presenter\{HeadingBlock, ParagraphBlock, TableBlock};
190+
191+ $html = match (true) {
192+ $block instanceof HeadingBlock => $this->heading($block->title, $block->section),
193+ $block instanceof ParagraphBlock => $this->paragraph($block->content, $block->tone),
194+ $block instanceof TableBlock => $this->table($block->headers, $block->rows, $block->styles),
195+ // one arm per block; PHPStan reports a missing arm as an unhandled match value.
196+ };
197+ ```
180198
181199## Documentation
182200
0 commit comments