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

Method coroutine

examples/demo.php:1757–1764  ·  view source on GitHub ↗

@return \Generator */

()

Source from the content-addressed store, hash-verified

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

Callers 1

runDemoAssertionsFunction · 0.80

Calls 1

sketchMethod · 0.80

Tested by

no test coverage detected