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

Method demo

examples/demo.php:787–800  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

785 public array $items = [];
786
787 public function demo(): void
788 {
789 // Property typed as array<string, Pen> — variable key
790 $this->cache[$this->getKey()]->write(); // element type from generic annotation
791
792 // Property typed as array<string, Pen> — string-literal key
793 $this->cache['brushes']->color(); // element type from generic annotation
794
795 // Property typed as array<int, Pen> — numeric index
796 $this->items[0]->write(); // element type from generic annotation
797
798 // Method chain after bracket access
799 $this->cache['tools']->rename('Fine')->write(); // chain through element type
800 }
801
802 private function getKey(): string { return 'k'; }
803}

Callers

nothing calls this directly

Calls 4

getKeyMethod · 0.95
writeMethod · 0.80
colorMethod · 0.80
renameMethod · 0.45

Tested by

no test coverage detected