diff --git a/fixtures/signature/funcClosed.php b/fixtures/signature/funcClosed.php new file mode 100644 index 0000000..6012844 --- /dev/null +++ b/fixtures/signature/funcClosed.php @@ -0,0 +1,7 @@ +method(); + } +} + +$a = new HelpClass5; +$a->method("asdf", 123, true); \ No newline at end of file diff --git a/fixtures/signature/methodClosed.php b/fixtures/signature/methodClosed.php new file mode 100644 index 0000000..924cd30 --- /dev/null +++ b/fixtures/signature/methodClosed.php @@ -0,0 +1,15 @@ +method(); + } +} + +$a = new HelpClass1; +$a->method(); \ No newline at end of file diff --git a/fixtures/signature/methodNotClosed.php b/fixtures/signature/methodNotClosed.php new file mode 100644 index 0000000..d5ce4cc --- /dev/null +++ b/fixtures/signature/methodNotClosed.php @@ -0,0 +1,17 @@ +method(1,1); + } +} +$a = new HelpClass2; +$a + ->method( + 1, + array(), diff --git a/fixtures/signature/staticClosed.php b/fixtures/signature/staticClosed.php new file mode 100644 index 0000000..301009f --- /dev/null +++ b/fixtures/signature/staticClosed.php @@ -0,0 +1,10 @@ +documentation = $this->getDocumentationFromNode($node); } + $def->parameters = []; + if (($node instanceof MethodDeclaration || + $node instanceof FunctionDeclaration || + $node instanceof AnonymousFunctionCreationExpression) && + $node->parameters !== null + ) { + foreach ($node->parameters->getElements() as $param) { + $def->parameters[] = new ParameterInformation( + $this->getDeclarationLineFromNode($param), + $this->getDocumentationFromNode($param) + ); + } + } + return $def; } diff --git a/src/LanguageServer.php b/src/LanguageServer.php index 73560f4..5835bfe 100644 --- a/src/LanguageServer.php +++ b/src/LanguageServer.php @@ -9,7 +9,8 @@ use LanguageServer\Protocol\{ TextDocumentSyncKind, Message, InitializeResult, - CompletionOptions + CompletionOptions, + SignatureHelpOptions }; use LanguageServer\FilesFinder\{FilesFinder, ClientFilesFinder, FileSystemFilesFinder}; use LanguageServer\ContentRetriever\{ContentRetriever, ClientContentRetriever, FileSystemContentRetriever}; @@ -275,6 +276,9 @@ class LanguageServer extends AdvancedJsonRpc\Dispatcher $serverCapabilities->completionProvider = new CompletionOptions; $serverCapabilities->completionProvider->resolveProvider = false; $serverCapabilities->completionProvider->triggerCharacters = ['$', '>']; + // support signature help + $serverCapabilities->signatureHelpProvider = new SignatureHelpOptions; + $serverCapabilities->signatureHelpProvider->triggerCharacters = ['(',',']; // Support global references $serverCapabilities->xworkspaceReferencesProvider = true; $serverCapabilities->xdefinitionProvider = true; diff --git a/src/Protocol/ParameterInformation.php b/src/Protocol/ParameterInformation.php index 89b5e53..98c6c87 100644 --- a/src/Protocol/ParameterInformation.php +++ b/src/Protocol/ParameterInformation.php @@ -23,4 +23,13 @@ class ParameterInformation * @var string|null */ public $documentation; + /** + * @param string $label The label of this signature. Will be shown in the UI. + * @param string|null $documentation The human-readable doc-comment of this signature. + */ + public function __construct(string $label = null, string $documentation = null) + { + $this->label = $label; + $this->documentation = $documentation; + } } diff --git a/src/Protocol/SignatureHelp.php b/src/Protocol/SignatureHelp.php index 407b25a..a99ef58 100644 --- a/src/Protocol/SignatureHelp.php +++ b/src/Protocol/SignatureHelp.php @@ -29,4 +29,15 @@ class SignatureHelp * @var int|null */ public $activeParameter; + /** + * @param SignatureInformation[] $signatures The signatures. + * @param int|null $activeSignature The active signature. + * @param int|null $activeParameter The active parameter of the active signature. + */ + public function __construct(array $signatures = [], int $activeSignature = null, int $activeParameter = null) + { + $this->signatures = $signatures; + $this->activeSignature = $activeSignature; + $this->activeParameter = $activeParameter; + } } diff --git a/src/Protocol/SignatureInformation.php b/src/Protocol/SignatureInformation.php index 77e152c..e1d4273 100644 --- a/src/Protocol/SignatureInformation.php +++ b/src/Protocol/SignatureInformation.php @@ -31,4 +31,16 @@ class SignatureInformation * @var ParameterInformation[]|null */ public $parameters; + + /** + * @param string $label The label of this signature. Will be shown in the UI. + * @param string|null $documentation The human-readable doc-comment of this signature. + * @param ParameterInformation[]|null $parameters The parameters of this signature. + */ + public function __construct(string $label = null, string $documentation = null, array $parameters = null) + { + $this->label = $label; + $this->documentation = $documentation; + $this->parameters = $parameters; + } } diff --git a/src/Server/TextDocument.php b/src/Server/TextDocument.php index 3209438..656227c 100644 --- a/src/Server/TextDocument.php +++ b/src/Server/TextDocument.php @@ -4,7 +4,7 @@ declare(strict_types = 1); namespace LanguageServer\Server; use LanguageServer\{ - CompletionProvider, LanguageClient, PhpDocument, PhpDocumentLoader, DefinitionResolver + CompletionProvider, LanguageClient, PhpDocument, PhpDocumentLoader, DefinitionResolver, SignatureHelpProvider }; use LanguageServer\Index\ReadableIndex; use LanguageServer\Protocol\{ @@ -73,6 +73,10 @@ class TextDocument * @var \stdClass|null */ protected $composerLock; + /** + * @var SignatureHelpProvider + */ + protected $signatureHelpProvider; /** * @param PhpDocumentLoader $documentLoader @@ -94,6 +98,7 @@ class TextDocument $this->client = $client; $this->definitionResolver = $definitionResolver; $this->completionProvider = new CompletionProvider($this->definitionResolver, $index); + $this->signatureHelpProvider = new SignatureHelpProvider($this->definitionResolver, $index); $this->index = $index; $this->composerJson = $composerJson; $this->composerLock = $composerLock; @@ -399,4 +404,20 @@ class TextDocument return [new SymbolLocationInformation($descriptor, $def->symbolInformation->location)]; }); } + + /** + * The signature help request is sent from the client to the server to request signature information + * at a given cursor position. + * + * @param TextDocumentIdentifier $textDocument The text document + * @param Position $position The position inside the text document + * @return Promise + */ + public function signatureHelp(TextDocumentIdentifier $textDocument, Position $position): Promise + { + return coroutine(function () use ($textDocument, $position) { + $document = yield $this->documentLoader->getOrLoad($textDocument->uri); + return $this->signatureHelpProvider->provideSignature($document, $position); + }); + } } diff --git a/src/SignatureHelpProvider.php b/src/SignatureHelpProvider.php new file mode 100644 index 0000000..916d177 --- /dev/null +++ b/src/SignatureHelpProvider.php @@ -0,0 +1,111 @@ +definitionResolver = $definitionResolver; + $this->index = $index; + } + + /** + * Get the short declaration for a callable (class modifiers, function keyword, etc are stripped) + * + * @param string $declaration + * @return string + */ + protected function getShortDeclaration(string $declaration): string + { + $parts = explode('(', $declaration, 2); + $name = array_reverse(explode(' ', trim($parts[0])))[0]; + return $name . '(' . $parts[1]; + } + + /** + * Returns signature help for a specific cursor position in a document + * + * @param PhpDocument $doc The opened document + * @param Position $pos The cursor position + * @return SignatureHelp + */ + public function provideSignature(PhpDocument $doc, Position $pos) : SignatureHelp + { + $node = $doc->getNodeAtPosition($pos); + $arge = null; + while ($node && + !($node instanceof ArgumentExpressionList) && + !($node instanceof CallExpression) && + $node->parent + ) { + if ($node instanceof ArgumentExpression) { + $arge = $node; + } + $node = $node->parent; + } + if (!($node instanceof ArgumentExpressionList) && + !($node instanceof CallExpression) + ) { + return new SignatureHelp; + } + $count = null; + if ($node instanceof ArgumentExpressionList) { + $count = 0; + foreach ($node->getElements() as $param) { + if ($param === $arge) { + break; + } + $count ++; + } + while ($node && !($node instanceof CallExpression) && $node->parent) { + $node = $node->parent; + } + if (!($node instanceof CallExpression)) { + return new SignatureHelp; + } + } + $def = $this->definitionResolver->resolveReferenceNodeToDefinition($node->callableExpression); + if (!$def) { + return new SignatureHelp; + } + return new SignatureHelp( + [ + new SignatureInformation( + $this->getShortDeclaration($def->declarationLine), + $def->documentation, + $def->parameters + ) + ], + 0, + $count !== null && $def->parameters !== null && $count < count($def->parameters) ? $count : null + ); + } +} diff --git a/tests/LanguageServerTest.php b/tests/LanguageServerTest.php index 5d58172..a8e1620 100644 --- a/tests/LanguageServerTest.php +++ b/tests/LanguageServerTest.php @@ -14,7 +14,8 @@ use LanguageServer\Protocol\{ TextDocumentIdentifier, InitializeResult, ServerCapabilities, - CompletionOptions + CompletionOptions, + SignatureHelpOptions }; use AdvancedJsonRpc; use Webmozart\Glob\Glob; @@ -40,6 +41,8 @@ class LanguageServerTest extends TestCase $serverCapabilities->completionProvider = new CompletionOptions; $serverCapabilities->completionProvider->resolveProvider = false; $serverCapabilities->completionProvider->triggerCharacters = ['$', '>']; + $serverCapabilities->signatureHelpProvider = new SignatureHelpOptions; + $serverCapabilities->signatureHelpProvider->triggerCharacters = ['(',',']; $serverCapabilities->xworkspaceReferencesProvider = true; $serverCapabilities->xdefinitionProvider = true; $serverCapabilities->xdependenciesProvider = true; diff --git a/tests/Server/TextDocument/SignatureHelpTest.php b/tests/Server/TextDocument/SignatureHelpTest.php new file mode 100644 index 0000000..832a88e --- /dev/null +++ b/tests/Server/TextDocument/SignatureHelpTest.php @@ -0,0 +1,248 @@ +loader = new PhpDocumentLoader($contentRetriever, $projectIndex, $definitionResolver); + $this->loader->load(pathToUri(__DIR__ . '/../../../fixtures/global_symbols.php'))->wait(); + $this->loader->load(pathToUri(__DIR__ . '/../../../fixtures/symbols.php'))->wait(); + $this->textDocument = new Server\TextDocument($this->loader, $definitionResolver, $client, $projectIndex); + } + + public function testMethodClosed() + { + $completionUri = pathToUri(__DIR__ . '/../../../fixtures/signature/methodClosed.php'); + $this->loader->open($completionUri, file_get_contents($completionUri)); + $result = $this->textDocument->signatureHelp( + new TextDocumentIdentifier($completionUri), + new Position(9, 22) + )->wait(); + + $this->assertEquals(new SignatureHelp( + [ + new SignatureInformation( + 'method(string $param = "")', + null, + [ + new ParameterInformation('string $param = ""') + ] + ) + ] + ), $result); + } + + public function testMethodClosedReference() + { + $completionUri = pathToUri(__DIR__ . '/../../../fixtures/signature/methodClosed.php'); + $this->loader->open($completionUri, file_get_contents($completionUri)); + $result = $this->textDocument->signatureHelp( + new TextDocumentIdentifier($completionUri), + new Position(14, 11) + )->wait(); + + $this->assertEquals(new SignatureHelp( + [ + new SignatureInformation( + 'method(string $param = "")', + null, + [ + new ParameterInformation('string $param = ""') + ] + ) + ] + ), $result); + } + + public function testMethodNotClosed() + { + $completionUri = pathToUri(__DIR__ . '/../../../fixtures/signature/methodNotClosed.php'); + $this->loader->open($completionUri, file_get_contents($completionUri)); + $result = $this->textDocument->signatureHelp( + new TextDocumentIdentifier($completionUri), + new Position(9, 22) + )->wait(); + + $this->assertEquals(new SignatureHelp( + [ + new SignatureInformation( + 'method(string $param = "")', + null, + [ + new ParameterInformation('string $param = ""') + ] + ) + ] + ), $result); + } + + public function testMethodNotClosedReference() + { + $completionUri = pathToUri(__DIR__ . '/../../../fixtures/signature/methodNotClosed.php'); + $this->loader->open($completionUri, file_get_contents($completionUri)); + $result = $this->textDocument->signatureHelp( + new TextDocumentIdentifier($completionUri), + new Position(14, 14) + )->wait(); + + $this->assertEquals(new SignatureHelp( + [ + new SignatureInformation( + 'method(string $param = "")', + null, + [ + new ParameterInformation('string $param = ""') + ] + ) + ] + ), $result); + } + + public function testFuncClosed() + { + $completionUri = pathToUri(__DIR__ . '/../../../fixtures/signature/funcClosed.php'); + $this->loader->open($completionUri, file_get_contents($completionUri)); + $result = $this->textDocument->signatureHelp( + new TextDocumentIdentifier($completionUri), + new Position(6, 10) + )->wait(); + + $this->assertEquals(new SignatureHelp( + [ + new SignatureInformation( + 'helpFunc1(int $count = 0)', + null, + [ + new ParameterInformation('int $count = 0') + ] + ) + ] + ), $result); + } + + public function testFuncNotClosed() + { + $completionUri = pathToUri(__DIR__ . '/../../../fixtures/signature/funcNotClosed.php'); + $this->loader->open($completionUri, file_get_contents($completionUri)); + $result = $this->textDocument->signatureHelp( + new TextDocumentIdentifier($completionUri), + new Position(6, 10) + )->wait(); + + $this->assertEquals(new SignatureHelp( + [ + new SignatureInformation( + 'helpFunc2(int $count = 0)', + null, + [ + new ParameterInformation('int $count = 0') + ] + ) + ] + ), $result); + } + + public function testStaticClosed() + { + $completionUri = pathToUri(__DIR__ . '/../../../fixtures/signature/staticClosed.php'); + $this->loader->open($completionUri, file_get_contents($completionUri)); + $result = $this->textDocument->signatureHelp( + new TextDocumentIdentifier($completionUri), + new Position(9, 19) + )->wait(); + + $this->assertEquals(new SignatureHelp( + [ + new SignatureInformation( + 'method(string $param = "")', + null, + [ + new ParameterInformation('string $param = ""') + ] + ) + ] + ), $result); + } + + public function testStaticNotClosed() + { + $completionUri = pathToUri(__DIR__ . '/../../../fixtures/signature/staticNotClosed.php'); + $this->loader->open($completionUri, file_get_contents($completionUri)); + $result = $this->textDocument->signatureHelp( + new TextDocumentIdentifier($completionUri), + new Position(9, 19) + )->wait(); + + $this->assertEquals(new SignatureHelp( + [ + new SignatureInformation( + 'method(string $param = "")', + null, + [ + new ParameterInformation('string $param = ""') + ] + ) + ] + ), $result); + } + + public function testMethodActiveParam() + { + $completionUri = pathToUri(__DIR__ . '/../../../fixtures/signature/methodActiveParam.php'); + $this->loader->open($completionUri, file_get_contents($completionUri)); + $result = $this->textDocument->signatureHelp( + new TextDocumentIdentifier($completionUri), + new Position(14, 21) + )->wait(); + + $this->assertEquals(new SignatureHelp( + [ + new SignatureInformation( + 'method(string $param = "", int $count = 0, bool $test = null)', + null, + [ + new ParameterInformation('string $param = ""'), + new ParameterInformation('int $count = 0'), + new ParameterInformation('bool $test = null') + ] + ) + ], + 0, + 1 + ), $result); + } +} diff --git a/tests/Validation/cases/WithReturnTypehints.php.expected.json b/tests/Validation/cases/WithReturnTypehints.php.expected.json index 8c6b092..3025bb9 100644 --- a/tests/Validation/cases/WithReturnTypehints.php.expected.json +++ b/tests/Validation/cases/WithReturnTypehints.php.expected.json @@ -31,7 +31,8 @@ }, "type": null, "declarationLine": "namespace Fixtures\\Prophecy;", - "documentation": null + "documentation": null, + "parameters": [] }, "Fixtures\\Prophecy\\WithReturnTypehints": { "fqn": "Fixtures\\Prophecy\\WithReturnTypehints", @@ -52,7 +53,8 @@ }, "type": null, "declarationLine": "class WithReturnTypehints extends EmptyClass", - "documentation": null + "documentation": null, + "parameters": [] }, "Fixtures\\Prophecy\\WithReturnTypehints->getSelf()": { "fqn": "Fixtures\\Prophecy\\WithReturnTypehints->getSelf()", @@ -72,7 +74,8 @@ "type__tostring": "\\self", "type": {}, "declarationLine": "public function getSelf(): self {", - "documentation": null + "documentation": null, + "parameters": [] }, "Fixtures\\Prophecy\\WithReturnTypehints->getName()": { "fqn": "Fixtures\\Prophecy\\WithReturnTypehints->getName()", @@ -92,7 +95,8 @@ "type__tostring": "string", "type": {}, "declarationLine": "public function getName(): string {", - "documentation": null + "documentation": null, + "parameters": [] }, "Fixtures\\Prophecy\\WithReturnTypehints->getParent()": { "fqn": "Fixtures\\Prophecy\\WithReturnTypehints->getParent()", @@ -112,7 +116,8 @@ "type__tostring": "\\parent", "type": {}, "declarationLine": "public function getParent(): parent {", - "documentation": null + "documentation": null, + "parameters": [] } } } \ No newline at end of file diff --git a/tests/Validation/cases/anonymousClassMembersShouldNotBeSymbols.php.expected.json b/tests/Validation/cases/anonymousClassMembersShouldNotBeSymbols.php.expected.json index 51343f1..fe0af66 100644 --- a/tests/Validation/cases/anonymousClassMembersShouldNotBeSymbols.php.expected.json +++ b/tests/Validation/cases/anonymousClassMembersShouldNotBeSymbols.php.expected.json @@ -18,7 +18,8 @@ }, "type": null, "declarationLine": "namespace MyNamespace;", - "documentation": null + "documentation": null, + "parameters": [] } } } \ No newline at end of file diff --git a/tests/Validation/cases/arrayValueShouldBeBoolean.php.expected.json b/tests/Validation/cases/arrayValueShouldBeBoolean.php.expected.json index 107877e..e3f07b0 100644 --- a/tests/Validation/cases/arrayValueShouldBeBoolean.php.expected.json +++ b/tests/Validation/cases/arrayValueShouldBeBoolean.php.expected.json @@ -18,7 +18,8 @@ }, "type": null, "declarationLine": "class A {", - "documentation": null + "documentation": null, + "parameters": [] }, "A->foo": { "fqn": "A->foo", @@ -38,7 +39,8 @@ "type__tostring": "string[]", "type": {}, "declarationLine": "protected $foo;", - "documentation": null + "documentation": null, + "parameters": [] } } } \ No newline at end of file diff --git a/tests/Validation/cases/caseStatement1.php.expected.json b/tests/Validation/cases/caseStatement1.php.expected.json index 9746749..3e72842 100644 --- a/tests/Validation/cases/caseStatement1.php.expected.json +++ b/tests/Validation/cases/caseStatement1.php.expected.json @@ -25,7 +25,8 @@ }, "type": null, "declarationLine": "namespace MyNamespace;", - "documentation": null + "documentation": null, + "parameters": [] } } } \ No newline at end of file diff --git a/tests/Validation/cases/classDefinition1.php.expected.json b/tests/Validation/cases/classDefinition1.php.expected.json index 670b5de..5f78572 100644 --- a/tests/Validation/cases/classDefinition1.php.expected.json +++ b/tests/Validation/cases/classDefinition1.php.expected.json @@ -25,7 +25,8 @@ }, "type": null, "declarationLine": "namespace TestNamespace;", - "documentation": null + "documentation": null, + "parameters": [] }, "TestNamespace\\A": { "fqn": "TestNamespace\\A", @@ -44,7 +45,8 @@ }, "type": null, "declarationLine": "class A {", - "documentation": null + "documentation": null, + "parameters": [] }, "TestNamespace\\A->a": { "fqn": "TestNamespace\\A->a", @@ -64,7 +66,8 @@ "type__tostring": "int", "type": {}, "declarationLine": "public $a;", - "documentation": null + "documentation": null, + "parameters": [] } } } \ No newline at end of file diff --git a/tests/Validation/cases/classProperty1.php.expected.json b/tests/Validation/cases/classProperty1.php.expected.json index 921bf0b..2925697 100644 --- a/tests/Validation/cases/classProperty1.php.expected.json +++ b/tests/Validation/cases/classProperty1.php.expected.json @@ -25,7 +25,8 @@ }, "type": null, "declarationLine": "namespace TestNamespace;", - "documentation": null + "documentation": null, + "parameters": [] }, "TestNamespace\\TestClass": { "fqn": "TestNamespace\\TestClass", @@ -44,7 +45,8 @@ }, "type": null, "declarationLine": "class TestClass", - "documentation": null + "documentation": null, + "parameters": [] }, "TestNamespace\\TestClass->testProperty": { "fqn": "TestNamespace\\TestClass->testProperty", @@ -64,7 +66,8 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "public $testProperty;", - "documentation": null + "documentation": null, + "parameters": [] }, "TestNamespace\\TestClass->testMethod()": { "fqn": "TestNamespace\\TestClass->testMethod()", @@ -84,7 +87,13 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "public function testMethod($testParameter)", - "documentation": null + "documentation": null, + "parameters": [ + { + "label": "$testParameter", + "documentation": null + } + ] } } } \ No newline at end of file diff --git a/tests/Validation/cases/constants.php.expected.json b/tests/Validation/cases/constants.php.expected.json index a76c059..ae72c11 100644 --- a/tests/Validation/cases/constants.php.expected.json +++ b/tests/Validation/cases/constants.php.expected.json @@ -25,7 +25,8 @@ }, "type": null, "declarationLine": "namespace MyNamespace;", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\A": { "fqn": "MyNamespace\\A", @@ -44,7 +45,8 @@ }, "type": null, "declarationLine": "class A", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\A::suite()": { "fqn": "MyNamespace\\A::suite()", @@ -64,7 +66,8 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "public static function suite()", - "documentation": null + "documentation": null, + "parameters": [] } } } \ No newline at end of file diff --git a/tests/Validation/cases/constants2.php.expected.json b/tests/Validation/cases/constants2.php.expected.json index ae5a2ce..4d375ed 100644 --- a/tests/Validation/cases/constants2.php.expected.json +++ b/tests/Validation/cases/constants2.php.expected.json @@ -25,7 +25,8 @@ }, "type": null, "declarationLine": "namespace MyNamespace;", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\A": { "fqn": "MyNamespace\\A", @@ -44,7 +45,8 @@ }, "type": null, "declarationLine": "class A", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\A::suite()": { "fqn": "MyNamespace\\A::suite()", @@ -64,7 +66,8 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "public static function suite()", - "documentation": null + "documentation": null, + "parameters": [] } } } \ No newline at end of file diff --git a/tests/Validation/cases/constants3.php.expected.json b/tests/Validation/cases/constants3.php.expected.json index c6ad922..6c7a09a 100644 --- a/tests/Validation/cases/constants3.php.expected.json +++ b/tests/Validation/cases/constants3.php.expected.json @@ -25,7 +25,8 @@ }, "type": null, "declarationLine": "namespace MyNamespace;", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\A": { "fqn": "MyNamespace\\A", @@ -44,7 +45,8 @@ }, "type": null, "declarationLine": "class A", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\A::suite()": { "fqn": "MyNamespace\\A::suite()", @@ -64,7 +66,8 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "public static function suite()", - "documentation": null + "documentation": null, + "parameters": [] } } } \ No newline at end of file diff --git a/tests/Validation/cases/constants4.php.expected.json b/tests/Validation/cases/constants4.php.expected.json index bc46cf1..ae04d1a 100644 --- a/tests/Validation/cases/constants4.php.expected.json +++ b/tests/Validation/cases/constants4.php.expected.json @@ -25,7 +25,8 @@ }, "type": null, "declarationLine": "namespace MyNamespace;", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\A": { "fqn": "MyNamespace\\A", @@ -44,7 +45,8 @@ }, "type": null, "declarationLine": "class A", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\A->suite()": { "fqn": "MyNamespace\\A->suite()", @@ -64,7 +66,8 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "public function suite()", - "documentation": null + "documentation": null, + "parameters": [] } } } \ No newline at end of file diff --git a/tests/Validation/cases/constants5.php.expected.json b/tests/Validation/cases/constants5.php.expected.json index 6bd7b8e..099ee92 100644 --- a/tests/Validation/cases/constants5.php.expected.json +++ b/tests/Validation/cases/constants5.php.expected.json @@ -22,7 +22,8 @@ }, "type": null, "declarationLine": "namespace MyNamespace;", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\Mbstring": { "fqn": "MyNamespace\\Mbstring", @@ -41,7 +42,8 @@ }, "type": null, "declarationLine": "class Mbstring", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\Mbstring::MB_CASE_FOLD": { "fqn": "MyNamespace\\Mbstring::MB_CASE_FOLD", @@ -61,7 +63,8 @@ "type__tostring": "\\MyNamespace\\PHP_INT_MAX", "type": {}, "declarationLine": "const MB_CASE_FOLD = PHP_INT_MAX;", - "documentation": null + "documentation": null, + "parameters": [] } } } \ No newline at end of file diff --git a/tests/Validation/cases/constantsInFunctionParamDefault.php.expected.json b/tests/Validation/cases/constantsInFunctionParamDefault.php.expected.json index b49f5a9..4eda839 100644 --- a/tests/Validation/cases/constantsInFunctionParamDefault.php.expected.json +++ b/tests/Validation/cases/constantsInFunctionParamDefault.php.expected.json @@ -22,7 +22,8 @@ }, "type": null, "declarationLine": "interface A {", - "documentation": null + "documentation": null, + "parameters": [] }, "A->b()": { "fqn": "A->b()", @@ -42,7 +43,13 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "function b ($a = MY_CONSTANT);", - "documentation": null + "documentation": null, + "parameters": [ + { + "label": "$a = MY_CONSTANT", + "documentation": null + } + ] } } } \ No newline at end of file diff --git a/tests/Validation/cases/docBlocksOnNamespaceDefinition.php.expected.json b/tests/Validation/cases/docBlocksOnNamespaceDefinition.php.expected.json index dd1737a..46702a4 100644 --- a/tests/Validation/cases/docBlocksOnNamespaceDefinition.php.expected.json +++ b/tests/Validation/cases/docBlocksOnNamespaceDefinition.php.expected.json @@ -18,7 +18,8 @@ }, "type": null, "declarationLine": "namespace MyNamespace;", - "documentation": null + "documentation": null, + "parameters": [] } } } \ No newline at end of file diff --git a/tests/Validation/cases/exceptions1.php.expected.json b/tests/Validation/cases/exceptions1.php.expected.json index c1ee1bd..aa5d581 100644 --- a/tests/Validation/cases/exceptions1.php.expected.json +++ b/tests/Validation/cases/exceptions1.php.expected.json @@ -22,7 +22,8 @@ }, "type": null, "declarationLine": "namespace MyNamespace;", - "documentation": null + "documentation": null, + "parameters": [] } } } \ No newline at end of file diff --git a/tests/Validation/cases/ifStatement1.php.expected.json b/tests/Validation/cases/ifStatement1.php.expected.json index 98e6572..e8dae26 100644 --- a/tests/Validation/cases/ifStatement1.php.expected.json +++ b/tests/Validation/cases/ifStatement1.php.expected.json @@ -25,7 +25,8 @@ }, "type": null, "declarationLine": "namespace MyNamespace;", - "documentation": null + "documentation": null, + "parameters": [] } } } \ No newline at end of file diff --git a/tests/Validation/cases/interfaceProperty.php.expected.json b/tests/Validation/cases/interfaceProperty.php.expected.json index 10c49f0..d143e3e 100644 --- a/tests/Validation/cases/interfaceProperty.php.expected.json +++ b/tests/Validation/cases/interfaceProperty.php.expected.json @@ -18,7 +18,8 @@ }, "type": null, "declarationLine": "interface A {", - "documentation": null + "documentation": null, + "parameters": [] } } } \ No newline at end of file diff --git a/tests/Validation/cases/magicConstantsShouldBeGlobal.php.expected.json b/tests/Validation/cases/magicConstantsShouldBeGlobal.php.expected.json index a9c2162..e39498e 100644 --- a/tests/Validation/cases/magicConstantsShouldBeGlobal.php.expected.json +++ b/tests/Validation/cases/magicConstantsShouldBeGlobal.php.expected.json @@ -25,7 +25,8 @@ }, "type": null, "declarationLine": "namespace B;", - "documentation": null + "documentation": null, + "parameters": [] } } } \ No newline at end of file diff --git a/tests/Validation/cases/magicConsts.php.expected.json b/tests/Validation/cases/magicConsts.php.expected.json index 6f863b9..5132f21 100644 --- a/tests/Validation/cases/magicConsts.php.expected.json +++ b/tests/Validation/cases/magicConsts.php.expected.json @@ -22,7 +22,8 @@ }, "type": null, "declarationLine": "class A {", - "documentation": null + "documentation": null, + "parameters": [] }, "A::$deprecationsTriggered": { "fqn": "A::$deprecationsTriggered", @@ -42,7 +43,8 @@ "type__tostring": "\\__CLASS__[]", "type": {}, "declarationLine": "private static $deprecationsTriggered;", - "documentation": null + "documentation": null, + "parameters": [] } } } \ No newline at end of file diff --git a/tests/Validation/cases/memberAccess1.php.expected.json b/tests/Validation/cases/memberAccess1.php.expected.json index c039e5e..edb64f7 100644 --- a/tests/Validation/cases/memberAccess1.php.expected.json +++ b/tests/Validation/cases/memberAccess1.php.expected.json @@ -25,7 +25,8 @@ }, "type": null, "declarationLine": "namespace MyNamespace;", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\A": { "fqn": "MyNamespace\\A", @@ -44,7 +45,8 @@ }, "type": null, "declarationLine": "class A {", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\A::a()": { "fqn": "MyNamespace\\A::a()", @@ -64,7 +66,8 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "static function a() {", - "documentation": null + "documentation": null, + "parameters": [] } } } \ No newline at end of file diff --git a/tests/Validation/cases/memberAccess2.php.expected.json b/tests/Validation/cases/memberAccess2.php.expected.json index 50902a1..aa257b7 100644 --- a/tests/Validation/cases/memberAccess2.php.expected.json +++ b/tests/Validation/cases/memberAccess2.php.expected.json @@ -25,7 +25,8 @@ }, "type": null, "declarationLine": "namespace MyNamespace;", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\A": { "fqn": "MyNamespace\\A", @@ -44,7 +45,8 @@ }, "type": null, "declarationLine": "class A {", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\A::a()": { "fqn": "MyNamespace\\A::a()", @@ -64,7 +66,8 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "static function a() {", - "documentation": null + "documentation": null, + "parameters": [] } } } \ No newline at end of file diff --git a/tests/Validation/cases/memberAccess3.php.expected.json b/tests/Validation/cases/memberAccess3.php.expected.json index d91b27d..fa90d45 100644 --- a/tests/Validation/cases/memberAccess3.php.expected.json +++ b/tests/Validation/cases/memberAccess3.php.expected.json @@ -40,7 +40,8 @@ }, "type": null, "declarationLine": "namespace MyNamespace;", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\A": { "fqn": "MyNamespace\\A", @@ -59,7 +60,8 @@ }, "type": null, "declarationLine": "class A {", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\A::getInitializer()": { "fqn": "MyNamespace\\A::getInitializer()", @@ -79,7 +81,13 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "public static function getInitializer(ClassLoader $loader)", - "documentation": null + "documentation": null, + "parameters": [ + { + "label": "ClassLoader $loader", + "documentation": null + } + ] } } } \ No newline at end of file diff --git a/tests/Validation/cases/memberAccess4.php.expected.json b/tests/Validation/cases/memberAccess4.php.expected.json index 0b7e1bf..4b13849 100644 --- a/tests/Validation/cases/memberAccess4.php.expected.json +++ b/tests/Validation/cases/memberAccess4.php.expected.json @@ -31,7 +31,8 @@ }, "type": null, "declarationLine": "namespace MyNamespace;", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\A": { "fqn": "MyNamespace\\A", @@ -50,7 +51,8 @@ }, "type": null, "declarationLine": "class A {", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\A->testRequest()": { "fqn": "MyNamespace\\A->testRequest()", @@ -70,7 +72,8 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "public function testRequest()", - "documentation": null + "documentation": null, + "parameters": [] } } } \ No newline at end of file diff --git a/tests/Validation/cases/memberAccess5.php.expected.json b/tests/Validation/cases/memberAccess5.php.expected.json index 050cf3b..3e889fe 100644 --- a/tests/Validation/cases/memberAccess5.php.expected.json +++ b/tests/Validation/cases/memberAccess5.php.expected.json @@ -22,7 +22,8 @@ }, "type": null, "declarationLine": "namespace MyNamespace;", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\ParseErrorsTest": { "fqn": "MyNamespace\\ParseErrorsTest", @@ -41,7 +42,8 @@ }, "type": null, "declarationLine": "class ParseErrorsTest {", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\ParseErrorsTest->setUp()": { "fqn": "MyNamespace\\ParseErrorsTest->setUp()", @@ -61,7 +63,8 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "public function setUp()", - "documentation": null + "documentation": null, + "parameters": [] } } } \ No newline at end of file diff --git a/tests/Validation/cases/memberCall1.php.expected.json b/tests/Validation/cases/memberCall1.php.expected.json index d02d7e3..b492993 100644 --- a/tests/Validation/cases/memberCall1.php.expected.json +++ b/tests/Validation/cases/memberCall1.php.expected.json @@ -28,7 +28,8 @@ }, "type": null, "declarationLine": "namespace MyNamespace;", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\ParseErrorsTest": { "fqn": "MyNamespace\\ParseErrorsTest", @@ -47,7 +48,8 @@ }, "type": null, "declarationLine": "class ParseErrorsTest", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\ParseErrorsTest->setAccount()": { "fqn": "MyNamespace\\ParseErrorsTest->setAccount()", @@ -67,7 +69,13 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "public function setAccount(AccountInterface $account)", - "documentation": null + "documentation": null, + "parameters": [ + { + "label": "AccountInterface $account", + "documentation": null + } + ] } } } \ No newline at end of file diff --git a/tests/Validation/cases/methodReturnType.php.expected.json b/tests/Validation/cases/methodReturnType.php.expected.json index 2c89994..7d526f6 100644 --- a/tests/Validation/cases/methodReturnType.php.expected.json +++ b/tests/Validation/cases/methodReturnType.php.expected.json @@ -22,7 +22,8 @@ }, "type": null, "declarationLine": "class FooClass {", - "documentation": null + "documentation": null, + "parameters": [] }, "FooClass->foo()": { "fqn": "FooClass->foo()", @@ -42,7 +43,8 @@ "type__tostring": "\\FooClass", "type": {}, "declarationLine": "public function foo(): FooClass {", - "documentation": null + "documentation": null, + "parameters": [] } } } \ No newline at end of file diff --git a/tests/Validation/cases/multipleNamespaces.php.expected.json b/tests/Validation/cases/multipleNamespaces.php.expected.json index fa51f2d..cc332aa 100644 --- a/tests/Validation/cases/multipleNamespaces.php.expected.json +++ b/tests/Validation/cases/multipleNamespaces.php.expected.json @@ -31,7 +31,8 @@ }, "type": null, "declarationLine": "namespace MyNamespace1;", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace1\\B": { "fqn": "MyNamespace1\\B", @@ -50,7 +51,8 @@ }, "type": null, "declarationLine": "class B {", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace1\\B->b()": { "fqn": "MyNamespace1\\B->b()", @@ -70,7 +72,8 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "function b() {", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace2": { "fqn": "MyNamespace2", @@ -89,7 +92,8 @@ }, "type": null, "declarationLine": "namespace MyNamespace2;", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace2\\A": { "fqn": "MyNamespace2\\A", @@ -110,7 +114,8 @@ }, "type": null, "declarationLine": "class A extends MyNamespace1\\B {", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace2\\A->a()": { "fqn": "MyNamespace2\\A->a()", @@ -130,7 +135,8 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "function a () {", - "documentation": null + "documentation": null, + "parameters": [] } } } \ No newline at end of file diff --git a/tests/Validation/cases/multiplePreceedingComments.php.expected.json b/tests/Validation/cases/multiplePreceedingComments.php.expected.json index 96cbb4a..43ac574 100644 --- a/tests/Validation/cases/multiplePreceedingComments.php.expected.json +++ b/tests/Validation/cases/multiplePreceedingComments.php.expected.json @@ -18,7 +18,8 @@ }, "type": null, "declarationLine": "class Foo", - "documentation": null + "documentation": null, + "parameters": [] }, "Foo->fn()": { "fqn": "Foo->fn()", @@ -38,7 +39,8 @@ "type__tostring": "\\Iterator", "type": {}, "declarationLine": "public function fn()", - "documentation": "Foo" + "documentation": "Foo", + "parameters": [] } } } \ No newline at end of file diff --git a/tests/Validation/cases/nameToken.php.expected.json b/tests/Validation/cases/nameToken.php.expected.json index 37cb4ca..ecd6b17 100644 --- a/tests/Validation/cases/nameToken.php.expected.json +++ b/tests/Validation/cases/nameToken.php.expected.json @@ -22,7 +22,8 @@ }, "type": null, "declarationLine": "class A {", - "documentation": null + "documentation": null, + "parameters": [] }, "A->b()": { "fqn": "A->b()", @@ -42,7 +43,8 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "function b() {", - "documentation": null + "documentation": null, + "parameters": [] } } } \ No newline at end of file diff --git a/tests/Validation/cases/namespaces2.php.expected.json b/tests/Validation/cases/namespaces2.php.expected.json index 0dffc9f..0de42d0 100644 --- a/tests/Validation/cases/namespaces2.php.expected.json +++ b/tests/Validation/cases/namespaces2.php.expected.json @@ -31,7 +31,8 @@ }, "type": null, "declarationLine": "namespace MyNamespace1;", - "documentation": null + "documentation": null, + "parameters": [] } } } \ No newline at end of file diff --git a/tests/Validation/cases/namespaces5.php.expected.json b/tests/Validation/cases/namespaces5.php.expected.json index e609ca2..cba87f3 100644 --- a/tests/Validation/cases/namespaces5.php.expected.json +++ b/tests/Validation/cases/namespaces5.php.expected.json @@ -40,7 +40,8 @@ }, "type": null, "declarationLine": "namespace B;", - "documentation": null + "documentation": null, + "parameters": [] } } } \ No newline at end of file diff --git a/tests/Validation/cases/namespaces6.php.expected.json b/tests/Validation/cases/namespaces6.php.expected.json index bf5a045..dfe8e8f 100644 --- a/tests/Validation/cases/namespaces6.php.expected.json +++ b/tests/Validation/cases/namespaces6.php.expected.json @@ -18,7 +18,8 @@ }, "type": null, "declarationLine": "namespace A \\ B;", - "documentation": null + "documentation": null, + "parameters": [] } } } \ No newline at end of file diff --git a/tests/Validation/cases/namespaces8.php.expected.json b/tests/Validation/cases/namespaces8.php.expected.json index d303647..2e4c973 100644 --- a/tests/Validation/cases/namespaces8.php.expected.json +++ b/tests/Validation/cases/namespaces8.php.expected.json @@ -28,7 +28,8 @@ }, "type": null, "declarationLine": "namespace LanguageServer\\Tests\\Utils;", - "documentation": null + "documentation": null, + "parameters": [] } } } \ No newline at end of file diff --git a/tests/Validation/cases/objectCreation.php.expected.json b/tests/Validation/cases/objectCreation.php.expected.json index 8fec38f..a8a9443 100644 --- a/tests/Validation/cases/objectCreation.php.expected.json +++ b/tests/Validation/cases/objectCreation.php.expected.json @@ -22,7 +22,8 @@ }, "type": null, "declarationLine": "namespace MyNamespace;", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\A": { "fqn": "MyNamespace\\A", @@ -41,7 +42,8 @@ }, "type": null, "declarationLine": "class A {", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\A->a()": { "fqn": "MyNamespace\\A->a()", @@ -61,7 +63,8 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "function a () {", - "documentation": null + "documentation": null, + "parameters": [] } } } \ No newline at end of file diff --git a/tests/Validation/cases/objectCreation2.php.expected.json b/tests/Validation/cases/objectCreation2.php.expected.json index e546528..10806b8 100644 --- a/tests/Validation/cases/objectCreation2.php.expected.json +++ b/tests/Validation/cases/objectCreation2.php.expected.json @@ -25,7 +25,8 @@ }, "type": null, "declarationLine": "namespace MyNamespace;", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\B": { "fqn": "MyNamespace\\B", @@ -44,7 +45,8 @@ }, "type": null, "declarationLine": "class B {", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\A": { "fqn": "MyNamespace\\A", @@ -63,7 +65,8 @@ }, "type": null, "declarationLine": "class A {", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\A->a()": { "fqn": "MyNamespace\\A->a()", @@ -83,7 +86,8 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "function a () {", - "documentation": null + "documentation": null, + "parameters": [] } } } \ No newline at end of file diff --git a/tests/Validation/cases/objectCreation3.php.expected.json b/tests/Validation/cases/objectCreation3.php.expected.json index d2d3e2f..3e65075 100644 --- a/tests/Validation/cases/objectCreation3.php.expected.json +++ b/tests/Validation/cases/objectCreation3.php.expected.json @@ -22,7 +22,8 @@ }, "type": null, "declarationLine": "class A {", - "documentation": null + "documentation": null, + "parameters": [] }, "A->a()": { "fqn": "A->a()", @@ -42,7 +43,8 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "function a () {", - "documentation": null + "documentation": null, + "parameters": [] } } } \ No newline at end of file diff --git a/tests/Validation/cases/param1.php.expected.json b/tests/Validation/cases/param1.php.expected.json index 40cfbd1..42fcb5b 100644 --- a/tests/Validation/cases/param1.php.expected.json +++ b/tests/Validation/cases/param1.php.expected.json @@ -22,7 +22,8 @@ }, "type": null, "declarationLine": "namespace MyNamespace;", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\init()": { "fqn": "MyNamespace\\init()", @@ -42,7 +43,13 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "function init(Hi $view)", - "documentation": null + "documentation": null, + "parameters": [ + { + "label": "Hi $view", + "documentation": null + } + ] } } } \ No newline at end of file diff --git a/tests/Validation/cases/parent1.php.expected.json b/tests/Validation/cases/parent1.php.expected.json index 56d7e61..cf5740f 100644 --- a/tests/Validation/cases/parent1.php.expected.json +++ b/tests/Validation/cases/parent1.php.expected.json @@ -22,7 +22,8 @@ }, "type": null, "declarationLine": "namespace MyNamespace;", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\B": { "fqn": "MyNamespace\\B", @@ -41,7 +42,8 @@ }, "type": null, "declarationLine": "class B {", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\B->b()": { "fqn": "MyNamespace\\B->b()", @@ -61,7 +63,8 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "function b() {", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\A": { "fqn": "MyNamespace\\A", @@ -82,7 +85,8 @@ }, "type": null, "declarationLine": "class A extends B {", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\A->a()": { "fqn": "MyNamespace\\A->a()", @@ -102,7 +106,8 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "function a () {", - "documentation": null + "documentation": null, + "parameters": [] } } } \ No newline at end of file diff --git a/tests/Validation/cases/parent3.php.expected.json b/tests/Validation/cases/parent3.php.expected.json index 3954754..d4b879f 100644 --- a/tests/Validation/cases/parent3.php.expected.json +++ b/tests/Validation/cases/parent3.php.expected.json @@ -25,7 +25,8 @@ }, "type": null, "declarationLine": "namespace MyNamespace;", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\B": { "fqn": "MyNamespace\\B", @@ -44,7 +45,8 @@ }, "type": null, "declarationLine": "class B {", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\B->b()": { "fqn": "MyNamespace\\B->b()", @@ -64,7 +66,8 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "function b() {", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\A": { "fqn": "MyNamespace\\A", @@ -85,7 +88,8 @@ }, "type": null, "declarationLine": "class A extends B {", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\A->a()": { "fqn": "MyNamespace\\A->a()", @@ -105,7 +109,8 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "function a () {", - "documentation": null + "documentation": null, + "parameters": [] } } } \ No newline at end of file diff --git a/tests/Validation/cases/propertyName1.php.expected.json b/tests/Validation/cases/propertyName1.php.expected.json index cc31ed6..ca59223 100644 --- a/tests/Validation/cases/propertyName1.php.expected.json +++ b/tests/Validation/cases/propertyName1.php.expected.json @@ -18,7 +18,8 @@ }, "type": null, "declarationLine": "class MyClass", - "documentation": null + "documentation": null, + "parameters": [] }, "MyClass->mainPropertyName": { "fqn": "MyClass->mainPropertyName", @@ -38,7 +39,8 @@ "type__tostring": "string", "type": {}, "declarationLine": "protected $mainPropertyName;", - "documentation": "The name of the main property, or NULL if there is none." + "documentation": "The name of the main property, or NULL if there is none.", + "parameters": [] } } } \ No newline at end of file diff --git a/tests/Validation/cases/propertyName2.php.expected.json b/tests/Validation/cases/propertyName2.php.expected.json index d4efb42..89fb2e2 100644 --- a/tests/Validation/cases/propertyName2.php.expected.json +++ b/tests/Validation/cases/propertyName2.php.expected.json @@ -18,7 +18,8 @@ }, "type": null, "declarationLine": "class MyClass", - "documentation": null + "documentation": null, + "parameters": [] }, "MyClass->mainPropertyName": { "fqn": "MyClass->mainPropertyName", @@ -38,7 +39,8 @@ "type__tostring": "string", "type": {}, "declarationLine": "protected $mainPropertyName;", - "documentation": "The name of the main property, or NULL if there is none." + "documentation": "The name of the main property, or NULL if there is none.", + "parameters": [] } } } \ No newline at end of file diff --git a/tests/Validation/cases/returnType.php.expected.json b/tests/Validation/cases/returnType.php.expected.json index 20cdadf..17514a5 100644 --- a/tests/Validation/cases/returnType.php.expected.json +++ b/tests/Validation/cases/returnType.php.expected.json @@ -25,7 +25,8 @@ }, "type": null, "declarationLine": "namespace TestNamespace;", - "documentation": null + "documentation": null, + "parameters": [] }, "TestNamespace\\whatever()": { "fqn": "TestNamespace\\whatever()", @@ -45,7 +46,13 @@ "type__tostring": "\\TestNamespace\\TestClass", "type": {}, "declarationLine": "function whatever(TestClass $param): TestClass2 {", - "documentation": "Aute duis elit reprehenderit tempor cillum proident anim laborum eu laboris reprehenderit ea incididunt." + "documentation": "Aute duis elit reprehenderit tempor cillum proident anim laborum eu laboris reprehenderit ea incididunt.", + "parameters": [ + { + "label": "TestClass $param", + "documentation": "Adipisicing non non cillum sint incididunt cillum enim mollit." + } + ] } } } \ No newline at end of file diff --git a/tests/Validation/cases/scopedPropertyAccess.php.expected.json b/tests/Validation/cases/scopedPropertyAccess.php.expected.json index ec50c7a..6053848 100644 --- a/tests/Validation/cases/scopedPropertyAccess.php.expected.json +++ b/tests/Validation/cases/scopedPropertyAccess.php.expected.json @@ -25,7 +25,8 @@ }, "type": null, "declarationLine": "namespace MyNamespace;", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\A": { "fqn": "MyNamespace\\A", @@ -44,7 +45,8 @@ }, "type": null, "declarationLine": "class A {", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\A::a()": { "fqn": "MyNamespace\\A::a()", @@ -64,7 +66,8 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "static function a() {", - "documentation": null + "documentation": null, + "parameters": [] } } } \ No newline at end of file diff --git a/tests/Validation/cases/scopedPropertyAccess2.php.expected.json b/tests/Validation/cases/scopedPropertyAccess2.php.expected.json index e1712cd..5792927 100644 --- a/tests/Validation/cases/scopedPropertyAccess2.php.expected.json +++ b/tests/Validation/cases/scopedPropertyAccess2.php.expected.json @@ -22,7 +22,8 @@ }, "type": null, "declarationLine": "namespace MyNamespace;", - "documentation": null + "documentation": null, + "parameters": [] } } } \ No newline at end of file diff --git a/tests/Validation/cases/scopedPropertyAccess3.php.expected.json b/tests/Validation/cases/scopedPropertyAccess3.php.expected.json index 913721b..bd8e7a8 100644 --- a/tests/Validation/cases/scopedPropertyAccess3.php.expected.json +++ b/tests/Validation/cases/scopedPropertyAccess3.php.expected.json @@ -25,7 +25,8 @@ }, "type": null, "declarationLine": "class A {", - "documentation": null + "documentation": null, + "parameters": [] }, "A::$a": { "fqn": "A::$a", @@ -45,7 +46,8 @@ "type__tostring": "string", "type": {}, "declarationLine": "static $a;", - "documentation": null + "documentation": null, + "parameters": [] } } } \ No newline at end of file diff --git a/tests/Validation/cases/scopedPropertyAccess5.php.expected.json b/tests/Validation/cases/scopedPropertyAccess5.php.expected.json index 7e56123..c0ad235 100644 --- a/tests/Validation/cases/scopedPropertyAccess5.php.expected.json +++ b/tests/Validation/cases/scopedPropertyAccess5.php.expected.json @@ -31,7 +31,8 @@ }, "type": null, "declarationLine": "class TestClass implements TestInterface {", - "documentation": null + "documentation": null, + "parameters": [] }, "TestClass::$testProperty": { "fqn": "TestClass::$testProperty", @@ -51,7 +52,8 @@ "type__tostring": "\\TestClass[]", "type": {}, "declarationLine": "public static $testProperty;", - "documentation": "Lorem excepteur officia sit anim velit veniam enim." + "documentation": "Lorem excepteur officia sit anim velit veniam enim.", + "parameters": [] } } } \ No newline at end of file diff --git a/tests/Validation/cases/self1.php.expected.json b/tests/Validation/cases/self1.php.expected.json index fe2bc63..1acd5e5 100644 --- a/tests/Validation/cases/self1.php.expected.json +++ b/tests/Validation/cases/self1.php.expected.json @@ -28,7 +28,8 @@ }, "type": null, "declarationLine": "namespace MyNamespace;", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\B": { "fqn": "MyNamespace\\B", @@ -47,7 +48,8 @@ }, "type": null, "declarationLine": "class B {", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\B->b()": { "fqn": "MyNamespace\\B->b()", @@ -67,7 +69,8 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "function b() {", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\A": { "fqn": "MyNamespace\\A", @@ -88,7 +91,8 @@ }, "type": null, "declarationLine": "class A extends B {", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\A->a()": { "fqn": "MyNamespace\\A->a()", @@ -108,7 +112,8 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "function a () {", - "documentation": null + "documentation": null, + "parameters": [] } } } \ No newline at end of file diff --git a/tests/Validation/cases/self2.php.expected.json b/tests/Validation/cases/self2.php.expected.json index 60ab062..d2d0669 100644 --- a/tests/Validation/cases/self2.php.expected.json +++ b/tests/Validation/cases/self2.php.expected.json @@ -28,7 +28,8 @@ }, "type": null, "declarationLine": "namespace MyNamespace;", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\B": { "fqn": "MyNamespace\\B", @@ -47,7 +48,8 @@ }, "type": null, "declarationLine": "class B {", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\B->b()": { "fqn": "MyNamespace\\B->b()", @@ -67,7 +69,8 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "function b() {", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\A": { "fqn": "MyNamespace\\A", @@ -88,7 +91,8 @@ }, "type": null, "declarationLine": "class A extends B {", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\A->a()": { "fqn": "MyNamespace\\A->a()", @@ -108,7 +112,8 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "function a () {", - "documentation": null + "documentation": null, + "parameters": [] } } } \ No newline at end of file diff --git a/tests/Validation/cases/self3.php.expected.json b/tests/Validation/cases/self3.php.expected.json index 7d66c2b..03e9c6c 100644 --- a/tests/Validation/cases/self3.php.expected.json +++ b/tests/Validation/cases/self3.php.expected.json @@ -28,7 +28,8 @@ }, "type": null, "declarationLine": "namespace MyNamespace;", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\B": { "fqn": "MyNamespace\\B", @@ -47,7 +48,8 @@ }, "type": null, "declarationLine": "class B {", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\B->b()": { "fqn": "MyNamespace\\B->b()", @@ -67,7 +69,8 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "function b() {", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\A": { "fqn": "MyNamespace\\A", @@ -88,7 +91,8 @@ }, "type": null, "declarationLine": "class A extends B {", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\A->a()": { "fqn": "MyNamespace\\A->a()", @@ -108,7 +112,8 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "function a () {", - "documentation": null + "documentation": null, + "parameters": [] } } } \ No newline at end of file diff --git a/tests/Validation/cases/self4.php.expected.json b/tests/Validation/cases/self4.php.expected.json index 64765b7..113eb32 100644 --- a/tests/Validation/cases/self4.php.expected.json +++ b/tests/Validation/cases/self4.php.expected.json @@ -37,7 +37,8 @@ }, "type": null, "declarationLine": "namespace MyNamespace;", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\A": { "fqn": "MyNamespace\\A", @@ -56,7 +57,8 @@ }, "type": null, "declarationLine": "class A", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\A::suite()": { "fqn": "MyNamespace\\A::suite()", @@ -76,7 +78,8 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "public static function suite()", - "documentation": null + "documentation": null, + "parameters": [] } } } \ No newline at end of file diff --git a/tests/Validation/cases/self5.php.expected.json b/tests/Validation/cases/self5.php.expected.json index eb41832..d19f105 100644 --- a/tests/Validation/cases/self5.php.expected.json +++ b/tests/Validation/cases/self5.php.expected.json @@ -22,7 +22,8 @@ }, "type": null, "declarationLine": "namespace MyNamespace;", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\A": { "fqn": "MyNamespace\\A", @@ -41,7 +42,8 @@ }, "type": null, "declarationLine": "class A", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\A->typesProvider()": { "fqn": "MyNamespace\\A->typesProvider()", @@ -61,7 +63,8 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "public function typesProvider()", - "documentation": null + "documentation": null, + "parameters": [] } } } \ No newline at end of file diff --git a/tests/Validation/cases/static1.php.expected.json b/tests/Validation/cases/static1.php.expected.json index db1a0d2..f96d35a 100644 --- a/tests/Validation/cases/static1.php.expected.json +++ b/tests/Validation/cases/static1.php.expected.json @@ -28,7 +28,8 @@ }, "type": null, "declarationLine": "namespace MyNamespace;", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\B": { "fqn": "MyNamespace\\B", @@ -47,7 +48,8 @@ }, "type": null, "declarationLine": "class B {", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\B->b()": { "fqn": "MyNamespace\\B->b()", @@ -67,7 +69,8 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "function b() {", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\A": { "fqn": "MyNamespace\\A", @@ -88,7 +91,8 @@ }, "type": null, "declarationLine": "class A extends B {", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\A->a()": { "fqn": "MyNamespace\\A->a()", @@ -108,7 +112,8 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "function a () {", - "documentation": null + "documentation": null, + "parameters": [] } } } \ No newline at end of file diff --git a/tests/Validation/cases/static2.php.expected.json b/tests/Validation/cases/static2.php.expected.json index bb662cb..f67d26a 100644 --- a/tests/Validation/cases/static2.php.expected.json +++ b/tests/Validation/cases/static2.php.expected.json @@ -28,7 +28,8 @@ }, "type": null, "declarationLine": "namespace MyNamespace;", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\B": { "fqn": "MyNamespace\\B", @@ -47,7 +48,8 @@ }, "type": null, "declarationLine": "class B {", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\B->b()": { "fqn": "MyNamespace\\B->b()", @@ -67,7 +69,8 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "function b() {", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\A": { "fqn": "MyNamespace\\A", @@ -88,7 +91,8 @@ }, "type": null, "declarationLine": "class A extends B {", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\A->a()": { "fqn": "MyNamespace\\A->a()", @@ -108,7 +112,8 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "function a () {", - "documentation": null + "documentation": null, + "parameters": [] } } } \ No newline at end of file diff --git a/tests/Validation/cases/static3.php.expected.json b/tests/Validation/cases/static3.php.expected.json index 34d3851..6ba1aa3 100644 --- a/tests/Validation/cases/static3.php.expected.json +++ b/tests/Validation/cases/static3.php.expected.json @@ -28,7 +28,8 @@ }, "type": null, "declarationLine": "namespace MyNamespace;", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\B": { "fqn": "MyNamespace\\B", @@ -47,7 +48,8 @@ }, "type": null, "declarationLine": "class B {", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\B->b()": { "fqn": "MyNamespace\\B->b()", @@ -67,7 +69,8 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "function b() {", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\A": { "fqn": "MyNamespace\\A", @@ -88,7 +91,8 @@ }, "type": null, "declarationLine": "class A extends B {", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\A->a()": { "fqn": "MyNamespace\\A->a()", @@ -108,7 +112,8 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "function a () {", - "documentation": null + "documentation": null, + "parameters": [] } } } \ No newline at end of file diff --git a/tests/Validation/cases/static4.php.expected.json b/tests/Validation/cases/static4.php.expected.json index de71d41..27fbfec 100644 --- a/tests/Validation/cases/static4.php.expected.json +++ b/tests/Validation/cases/static4.php.expected.json @@ -25,7 +25,8 @@ }, "type": null, "declarationLine": "namespace MyNamespace;", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\A": { "fqn": "MyNamespace\\A", @@ -46,7 +47,8 @@ }, "type": null, "declarationLine": "class A extends B {", - "documentation": null + "documentation": null, + "parameters": [] }, "MyNamespace\\A->a()": { "fqn": "MyNamespace\\A->a()", @@ -66,7 +68,8 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "function a () {", - "documentation": null + "documentation": null, + "parameters": [] } } } \ No newline at end of file diff --git a/tests/Validation/cases/staticMethodReturnType.php.expected.json b/tests/Validation/cases/staticMethodReturnType.php.expected.json index e6661ec..cbd886f 100644 --- a/tests/Validation/cases/staticMethodReturnType.php.expected.json +++ b/tests/Validation/cases/staticMethodReturnType.php.expected.json @@ -22,7 +22,8 @@ }, "type": null, "declarationLine": "class FooClass {", - "documentation": null + "documentation": null, + "parameters": [] }, "FooClass::staticFoo()": { "fqn": "FooClass::staticFoo()", @@ -42,7 +43,8 @@ "type__tostring": "\\FooClass", "type": {}, "declarationLine": "public static function staticFoo(): FooClass {", - "documentation": null + "documentation": null, + "parameters": [] }, "FooClass->bar()": { "fqn": "FooClass->bar()", @@ -62,7 +64,8 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "public function bar() { }", - "documentation": null + "documentation": null, + "parameters": [] } } } \ No newline at end of file diff --git a/tests/Validation/cases/stringVariable.php.expected.json b/tests/Validation/cases/stringVariable.php.expected.json index 1d4c7e3..44f362a 100644 --- a/tests/Validation/cases/stringVariable.php.expected.json +++ b/tests/Validation/cases/stringVariable.php.expected.json @@ -22,7 +22,8 @@ }, "type": null, "declarationLine": "class B", - "documentation": null + "documentation": null, + "parameters": [] }, "B->hi": { "fqn": "B->hi", @@ -42,7 +43,8 @@ "type__tostring": "int", "type": {}, "declarationLine": "public $hi;", - "documentation": null + "documentation": null, + "parameters": [] }, "B->a()": { "fqn": "B->a()", @@ -62,7 +64,8 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "function a () {", - "documentation": null + "documentation": null, + "parameters": [] } } } \ No newline at end of file diff --git a/tests/Validation/cases/testQualifiedNameOutsideOfNamespace.php.expected.json b/tests/Validation/cases/testQualifiedNameOutsideOfNamespace.php.expected.json index 509907c..fe037c6 100644 --- a/tests/Validation/cases/testQualifiedNameOutsideOfNamespace.php.expected.json +++ b/tests/Validation/cases/testQualifiedNameOutsideOfNamespace.php.expected.json @@ -22,7 +22,8 @@ }, "type": null, "declarationLine": "namespace SomeNamespace { }", - "documentation": null + "documentation": null, + "parameters": [] } } } \ No newline at end of file diff --git a/tests/Validation/cases/verifyFqsenOnClassProperty.php.expected.json b/tests/Validation/cases/verifyFqsenOnClassProperty.php.expected.json index 662a7ed..e381968 100644 --- a/tests/Validation/cases/verifyFqsenOnClassProperty.php.expected.json +++ b/tests/Validation/cases/verifyFqsenOnClassProperty.php.expected.json @@ -25,7 +25,8 @@ }, "type": null, "declarationLine": "class Foo {", - "documentation": null + "documentation": null, + "parameters": [] }, "Foo->bar": { "fqn": "Foo->bar", @@ -45,7 +46,8 @@ "type__tostring": "\\", "type": {}, "declarationLine": "protected $bar;", - "documentation": null + "documentation": null, + "parameters": [] }, "Foo->foo()": { "fqn": "Foo->foo()", @@ -65,7 +67,8 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "public function foo () {", - "documentation": null + "documentation": null, + "parameters": [] } } } \ No newline at end of file