MCPcopy Create free account
hub / github.com/PHPantom-dev/phpantom_lsp / demo

Method demo

examples/demo.php:3456–3473  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3454class DeepVariableChainDemo
3455{
3456 public function demo(): void
3457 {
3458 // 5-level chain: each variable is assigned from a method/property on the previous.
3459 $brush = new Brush();
3460 $canvas = $brush->getCanvas();
3461 $easel = $canvas->easel;
3462 $material = $easel->material; // string from Easel::$material
3463 $back = $canvas->getBrush();
3464 $back->stroke(); // Brush::stroke() — full round-trip
3465
3466 // Reassignment chains: the resolver picks the most recent assignment.
3467 $tool = new Pen();
3468 $tool->write(); // Pen::write()
3469 $tool = new Pencil();
3470 $tool->sketch(); // Pencil::sketch() — Pen::write() is gone
3471 $tool = new Marker();
3472 $tool->highlight(); // Marker::highlight()
3473 }
3474}
3475
3476

Callers

nothing calls this directly

Calls 6

getCanvasMethod · 0.80
getBrushMethod · 0.80
strokeMethod · 0.80
writeMethod · 0.80
sketchMethod · 0.80
highlightMethod · 0.80

Tested by

no test coverage detected