@return \Generator */
()
| 1755 | |
| 1756 | /** @return \Generator<int, string, Pencil, void> */ |
| 1757 | public function coroutine(): \Generator |
| 1758 | { |
| 1759 | // TSend inference: $var = yield gets the 3rd Generator type param. |
| 1760 | // yield produces 'ready' (TValue = string) to the consumer; |
| 1761 | // the yield expression evaluates to whatever was ->send()'d (TSend = Pencil). |
| 1762 | $pencil = yield 'ready'; |
| 1763 | $pencil->sketch(); // resolves to Pencil (TSend) |
| 1764 | } |
| 1765 | |
| 1766 | /** @return \Generator<int, string, Pencil, void> */ |
| 1767 | public function tsendInsideNestedBlocks(): \Generator |
no test coverage detected