()
| 1381 | class GenericShapeDemo |
| 1382 | { |
| 1383 | public function demo(): void |
| 1384 | { |
| 1385 | $src = new ScaffoldingGenericShape(); |
| 1386 | |
| 1387 | // Template params inside array shape bodies are substituted through inheritance |
| 1388 | $result = $src->getResult(); |
| 1389 | $result['data']->open(); // array{data: T} with T=Gift → Gift |
| 1390 | |
| 1391 | // Chained bracket access walks shape key then list element |
| 1392 | $first = $result['items'][0]; |
| 1393 | $first->open(); // list<T> with T=Gift → Gift |
| 1394 | } |
| 1395 | } |
| 1396 | |
| 1397 |