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

Method demo

examples/demo.php:1919–1942  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1917class SignatureHelpDemo
1918{
1919 public function demo(): void
1920 {
1921 // Place cursor inside parentheses to see parameter hints.
1922 // The active parameter updates as you type commas.
1923 $user = new User('Alice', 'alice@example.com');
1924 createUser('Alice', 'alice@example.com'); // standalone function
1925 $user->setStatus(Status::Active); // instance method
1926 User::findByEmail('alice@example.com'); // static method
1927 new User('Bob', 'bob@example.com'); // constructor
1928
1929 // Chains resolve through return types and properties:
1930 $user->getProfile()->setBio('Hello'); // method return chain
1931 (new User('X', 'x@x.com'))->setStatus(Status::Active); // (new ...)->method
1932 new User('X', 'x@x.com')->setStatus(Status::Active); // PHP 8.4 style
1933
1934 // Default values appear in parameter labels (e.g. "int $page = 1"):
1935 $svc = new ScaffoldingSignatureHelp();
1936 $svc->paginate(2, 50);
1937
1938 // Per-parameter @param descriptions appear next to each parameter.
1939 // When the effective docblock type differs from the native PHP type
1940 // the description is prefixed with the effective type:
1941 $svc->search('php', 1, 25);
1942 }
1943}
1944
1945

Callers

nothing calls this directly

Calls 7

createUserFunction · 0.85
setStatusMethod · 0.80
findByEmailMethod · 0.80
setBioMethod · 0.80
paginateMethod · 0.80
getProfileMethod · 0.45
searchMethod · 0.45

Tested by

no test coverage detected