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

Method findAll

examples/demo.php:1725–1736  ·  view source on GitHub ↗

@return \Generator */

()

Source from the content-addressed store, hash-verified

1723{
1724 /** @return \Generator<int, Pen> */
1725 public function findAll(): \Generator
1726 {
1727 // The type of $pen comes from `new Pen(...)`, not from the @return.
1728 // Completion on $pen-> works because the assignment is known.
1729 $pen = new Pen('blue');
1730 yield $pen;
1731 $pen->write(); // resolves to Pen
1732
1733 $anotherPen = new Pen('red');
1734 yield 0 => $anotherPen;
1735 $anotherPen->color(); // key => value yields also work
1736 }
1737
1738 /** @return \Generator<int, Pen> */
1739 public function yieldInsideControlFlow(): \Generator

Callers

nothing calls this directly

Calls 2

writeMethod · 0.80
colorMethod · 0.80

Tested by

no test coverage detected