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

Method demo

examples/demo.php:861–873  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

859class SpreadOperatorDemo
860{
861 public function demo(): void
862 {
863 /** @var list<Pen> */
864 $penList = [];
865 /** @var list<Pencil> */
866 $pencilList = [];
867
868 $allPens = [...$penList];
869 $allPens[0]->write(); // resolves Pen from spread
870
871 $everything = [...$penList, ...$pencilList];
872 $everything[0]->label(); // union: Pen|Pencil from multiple spreads
873 }
874}
875
876

Callers

nothing calls this directly

Calls 2

writeMethod · 0.80
labelMethod · 0.45

Tested by

no test coverage detected