diff --git a/fixtures/signature_help/calls.php b/fixtures/signature_help/calls.php index 511725b..17001a2 100644 --- a/fixtures/signature_help/calls.php +++ b/fixtures/signature_help/calls.php @@ -40,8 +40,9 @@ class Test /** * @param int $i Global function param one * @param bool $b Default false param + * @param Test|null ...$things Test things */ -function foo(int $i, bool $b = false) +function foo(int $i, bool $b = false, Test ...$things = null) { } @@ -51,6 +52,9 @@ $t->foo(1, $t->foo(1,); $t->baz(); -foo(); +foo( + 1, + foo(1, 2, +); Test::bar(); diff --git a/src/Definition.php b/src/Definition.php index c27f871..0d157cb 100644 --- a/src/Definition.php +++ b/src/Definition.php @@ -99,6 +99,13 @@ class Definition */ public $documentation; + /** + * Signature information if this definition is for a FunctionLike, for use in textDocument/signatureHelp + * + * @var SignatureInformation + */ + public $signatureInformation; + /** * Yields the definitons of all ancestor classes (the Definition fqn is yielded as key) * diff --git a/src/DefinitionResolver.php b/src/DefinitionResolver.php index c9d1400..2c1f67d 100644 --- a/src/DefinitionResolver.php +++ b/src/DefinitionResolver.php @@ -7,6 +7,7 @@ use LanguageServer\Index\ReadableIndex; use LanguageServer\Protocol\SymbolInformation; use Microsoft\PhpParser; use Microsoft\PhpParser\Node; +use Microsoft\PhpParser\FunctionLike; use phpDocumentor\Reflection\{ DocBlock, DocBlockFactory, Fqsen, Type, TypeResolver, Types }; @@ -34,6 +35,13 @@ class DefinitionResolver */ private $docBlockFactory; + /** + * Creates SignatureInformation + * + * @var SignatureInformationFactory + */ + private $signatureInformationFactory; + /** * @param ReadableIndex $index */ @@ -42,6 +50,7 @@ class DefinitionResolver $this->index = $index; $this->typeResolver = new TypeResolver; $this->docBlockFactory = DocBlockFactory::createInstance(); + $this->signatureInformationFactory = new SignatureInformationFactory($this); } /** @@ -232,6 +241,10 @@ class DefinitionResolver $def->documentation = $this->getDocumentationFromNode($node); } + if ($node instanceof FunctionLike) { + $def->signatureInformation = $this->signatureInformationFactory->create($node); + } + return $def; } diff --git a/src/SignatureHelpProvider.php b/src/SignatureHelpProvider.php index ca25e53..aba02b4 100644 --- a/src/SignatureHelpProvider.php +++ b/src/SignatureHelpProvider.php @@ -55,34 +55,18 @@ class SignatureHelpProvider $node = $doc->getNodeAtPosition($position); // Find the definition of the item being called - list($def, $argumentExpressionList) = $this->getCallingInfo($node); + list($def, $argumentExpressionList) = yield $this->getCallingInfo($node); - if (!$def) { + if (!$def || !$def->signatureInformation) { return new SignatureHelp(); } - // Get information from the item being called to build the signature information - $calledDoc = yield $this->documentLoader->getOrLoad($def->symbolInformation->location->uri); - if (!$calledDoc) { - return new SignatureHelp(); - } - $calledNode = $calledDoc->getNodeAtPosition($def->symbolInformation->location->range->start); - $params = $this->getParameters($calledNode, $calledDoc); - $label = $this->getLabel($calledNode, $params, $calledDoc); - // Find the active parameter $activeParam = $argumentExpressionList ? $this->findActiveParameter($argumentExpressionList, $position, $doc) : 0; - $signatureInformation = new SignatureInformation( - $label, - $params, - $this->definitionResolver->getDocumentationFromNode($calledNode) - ); - $signatureHelp = new SignatureHelp([$signatureInformation], 0, $activeParam); - - return $signatureHelp; + return new SignatureHelp([$def->signatureInformation], 0, $activeParam); }); } @@ -92,115 +76,75 @@ class SignatureHelpProvider * * @param Node $node The node to find calling information from * - * @return array|null + * @return Promise */ private function getCallingInfo(Node $node) { - $fqn = null; - $callingNode = null; - if ($node instanceof Node\DelimitedList\ArgumentExpressionList) { - // Cursor is already inside a ( - $argumentExpressionList = $node; - if ($node->parent instanceof Node\Expression\ObjectCreationExpression) { - // Constructing something - $callingNode = $node->parent->classTypeDesignator; - if (!$callingNode instanceof Node\QualifiedName) { - // We only support constructing from a QualifiedName - return null; + return coroutine(function () use ($node) { + $fqn = null; + $callingNode = null; + if ($node instanceof Node\DelimitedList\ArgumentExpressionList) { + // Cursor is already inside a ( + $argumentExpressionList = $node; + if ($node->parent instanceof Node\Expression\ObjectCreationExpression) { + // Constructing something + $callingNode = $node->parent->classTypeDesignator; + if (!$callingNode instanceof Node\QualifiedName) { + // We only support constructing from a QualifiedName + return null; + } + $fqn = $this->definitionResolver->resolveReferenceNodeToFqn($callingNode); + $fqn = "{$fqn}->__construct()"; + } else { + $callingNode = $node->parent->getFirstChildNode( + Node\Expression\MemberAccessExpression::class, + Node\Expression\ScopedPropertyAccessExpression::class, + Node\QualifiedName::class + ); } - $fqn = $this->definitionResolver->resolveReferenceNodeToFqn($callingNode); - $fqn = "{$fqn}->__construct()"; - } else { - $callingNode = $node->parent->getFirstChildNode( + } elseif ($node instanceof Node\Expression\CallExpression) { + $argumentExpressionList = $node->getFirstChildNode(Node\DelimitedList\ArgumentExpressionList::class); + $callingNode = $node->getFirstChildNode( Node\Expression\MemberAccessExpression::class, Node\Expression\ScopedPropertyAccessExpression::class, Node\QualifiedName::class ); + } elseif ($node instanceof Node\Expression\ObjectCreationExpression) { + $argumentExpressionList = $node->getFirstChildNode(Node\DelimitedList\ArgumentExpressionList::class); + $callingNode = $node->classTypeDesignator; + if (!$callingNode instanceof Node\QualifiedName) { + // We only support constructing from a QualifiedName + return null; + } + // Manually build the __construct fqn + $fqn = $this->definitionResolver->resolveReferenceNodeToFqn($callingNode); + $fqn = "{$fqn}->__construct()"; } - } elseif ($node instanceof Node\Expression\CallExpression) { - $argumentExpressionList = $node->getFirstChildNode(Node\DelimitedList\ArgumentExpressionList::class); - $callingNode = $node->getFirstChildNode( - Node\Expression\MemberAccessExpression::class, - Node\Expression\ScopedPropertyAccessExpression::class, - Node\QualifiedName::class - ); - } elseif ($node instanceof Node\Expression\ObjectCreationExpression) { - $argumentExpressionList = $node->getFirstChildNode(Node\DelimitedList\ArgumentExpressionList::class); - $callingNode = $node->classTypeDesignator; - if (!$callingNode instanceof Node\QualifiedName) { - // We only support constructing from a QualifiedName + + if (!$callingNode) { return null; } - // Manually build the __construct fqn - $fqn = $this->definitionResolver->resolveReferenceNodeToFqn($callingNode); - $fqn = "{$fqn}->__construct()"; - } - if (!$callingNode) { - return null; - } - - // Now find the definition of the call - $fqn = $fqn ?: DefinitionResolver::getDefinedFqn($callingNode); - if ($fqn) { - $def = $this->index->getDefinition($fqn); - } else { - $def = $this->definitionResolver->resolveReferenceNodeToDefinition($callingNode); - } - - if (!$def) { - return null; - } - return [$def, $argumentExpressionList]; - } - - /** - * Creates a label for SignatureInformation - * - * @param Node\MethodDeclaration|Node\Statement\FunctionDeclaration $node The method/function declaration node - * we are building the label for - * @param ParameterInformation[] $params Parameters that belong to the node - * - * @return string - */ - private function getLabel($node, array $params): string - { - $label = '('; - if ($params) { - foreach ($params as $param) { - $label .= $param->label . ', '; - } - $label = substr($label, 0, -2); - } - $label .= ')'; - return $label; - } - - /** - * Builds ParameterInformation from a node - * - * @param Node\MethodDeclaration|Node\Statement\FunctionDeclaration $node The node to build parameters from - * @param PhpDocument $doc The document the node belongs to - * - * @return ParameterInformation[] - */ - private function getParameters($node, PhpDocument $doc): array - { - $params = []; - if ($node->parameters) { - foreach ($node->parameters->getElements() as $element) { - $param = (string) $this->definitionResolver->getTypeFromNode($element); - $param .= ' ' . $element->variableName->getText($doc->getContent()); - if ($element->default) { - $param .= ' = ' . $element->default->getText($doc->getContent()); + // Now find the definition of the call + $fqn = $fqn ?: DefinitionResolver::getDefinedFqn($callingNode); + while (true) { + if ($fqn) { + $def = $this->index->getDefinition($fqn); + } else { + $def = $this->definitionResolver->resolveReferenceNodeToDefinition($callingNode); } - $params[] = new ParameterInformation( - $param, - $this->definitionResolver->getDocumentationFromNode($element) - ); + if ($def !== null || $this->index->isComplete()) { + break; + } + yield waitForEvent($this->index, 'definition-added'); } - } - return $params; + + if (!$def) { + return null; + } + + return [$def, $argumentExpressionList]; + }); } /** diff --git a/src/SignatureInformationFactory.php b/src/SignatureInformationFactory.php new file mode 100644 index 0000000..0095d5c --- /dev/null +++ b/src/SignatureInformationFactory.php @@ -0,0 +1,91 @@ +definitionResolver = $definitionResolver; + } + + /** + * Create a SignatureInformation from a FunctionLike node + * + * @param FunctionLike $node Node to create signature information from + * + * @return SignatureInformation + */ + public function create(FunctionLike $node): SignatureInformation + { + $params = $this->createParameters($node); + $label = $this->createLabel($params); + return new SignatureInformation( + $label, + $params, + $this->definitionResolver->getDocumentationFromNode($node) + ); + } + + /** + * Gets parameters from a FunctionLike node + * + * @param FunctionLike $node Node to get parameters from + * + * @return ParameterInformation[] + */ + private function createParameters(FunctionLike $node): array + { + $params = []; + if ($node->parameters) { + foreach ($node->parameters->getElements() as $element) { + $param = (string) $this->definitionResolver->getTypeFromNode($element); + $param .= ' '; + if ($element->dotDotDotToken) { + $param .= '...'; + } + $param .= '$' . $element->getName(); + if ($element->default) { + $param .= ' = ' . $element->default->getText(); + } + $params[] = new ParameterInformation( + $param, + $this->definitionResolver->getDocumentationFromNode($element) + ); + } + } + return $params; + } + + /** + * Creates a signature information label from parameters + * + * @param ParameterInformation[] $params Parameters to create the label from + * + * @return string + */ + private function createLabel(array $params): string + { + $label = '('; + if ($params) { + foreach ($params as $param) { + $label .= $param->label . ', '; + } + $label = substr($label, 0, -2); + } + $label .= ')'; + return $label; + } +} diff --git a/tests/Server/TextDocument/SignatureHelpTest.php b/tests/Server/TextDocument/SignatureHelpTest.php index ef984d5..7d073c0 100644 --- a/tests/Server/TextDocument/SignatureHelpTest.php +++ b/tests/Server/TextDocument/SignatureHelpTest.php @@ -61,7 +61,7 @@ class SignatureHelpTest extends TestCase { return [ 'member call' => [ - new Position(48, 9), + new Position(49, 9), new SignatureHelp( [ new SignatureInformation( @@ -78,7 +78,7 @@ class SignatureHelpTest extends TestCase ), ], 'member call 2nd param active' => [ - new Position(49, 12), + new Position(50, 12), new SignatureHelp( [ new SignatureInformation( @@ -95,7 +95,7 @@ class SignatureHelpTest extends TestCase ), ], 'member call 2nd param active and closing )' => [ - new Position(50, 11), + new Position(51, 11), new SignatureHelp( [ new SignatureInformation( @@ -112,11 +112,11 @@ class SignatureHelpTest extends TestCase ), ], 'method with no params' => [ - new Position(51, 9), + new Position(52, 9), new SignatureHelp([new SignatureInformation('()', [], 'Method with no params', 0, 0)]), ], 'constructor' => [ - new Position(47, 14), + new Position(48, 14), new SignatureHelp( [ new SignatureInformation( @@ -134,23 +134,24 @@ class SignatureHelpTest extends TestCase ), ], 'global function' => [ - new Position(53, 4), + new Position(56, 15), new SignatureHelp( [ new SignatureInformation( - '(int $i, bool $b = false)', + '(int $i, bool $b = false, \Foo\Test|null ...$things = null)', [ new ParameterInformation('int $i', 'Global function param one'), new ParameterInformation('bool $b = false', 'Default false param'), + new ParameterInformation('\Foo\Test|null ...$things = null', 'Test things'), ] ), ], 0, - 0 + 2 ) ], 'static method' => [ - new Position(55, 10), + new Position(59, 10), new SignatureHelp( [new SignatureInformation('(mixed $a)', [new ParameterInformation('mixed $a')])], 0, diff --git a/tests/Validation/cases/WithReturnTypehints.php.expected.json b/tests/Validation/cases/WithReturnTypehints.php.expected.json index 8c6b092..a037d6c 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, + "signatureInformation": null }, "Fixtures\\Prophecy\\WithReturnTypehints": { "fqn": "Fixtures\\Prophecy\\WithReturnTypehints", @@ -52,7 +53,8 @@ }, "type": null, "declarationLine": "class WithReturnTypehints extends EmptyClass", - "documentation": null + "documentation": null, + "signatureInformation": null }, "Fixtures\\Prophecy\\WithReturnTypehints->getSelf()": { "fqn": "Fixtures\\Prophecy\\WithReturnTypehints->getSelf()", @@ -72,7 +74,12 @@ "type__tostring": "\\self", "type": {}, "declarationLine": "public function getSelf(): self {", - "documentation": null + "documentation": null, + "signatureInformation": { + "label": "()", + "documentation": null, + "parameters": [] + } }, "Fixtures\\Prophecy\\WithReturnTypehints->getName()": { "fqn": "Fixtures\\Prophecy\\WithReturnTypehints->getName()", @@ -92,7 +99,12 @@ "type__tostring": "string", "type": {}, "declarationLine": "public function getName(): string {", - "documentation": null + "documentation": null, + "signatureInformation": { + "label": "()", + "documentation": null, + "parameters": [] + } }, "Fixtures\\Prophecy\\WithReturnTypehints->getParent()": { "fqn": "Fixtures\\Prophecy\\WithReturnTypehints->getParent()", @@ -112,7 +124,12 @@ "type__tostring": "\\parent", "type": {}, "declarationLine": "public function getParent(): parent {", - "documentation": null + "documentation": null, + "signatureInformation": { + "label": "()", + "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..f5fbba9 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, + "signatureInformation": null } } } \ 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..1f40635 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, + "signatureInformation": null }, "A->foo": { "fqn": "A->foo", @@ -38,7 +39,8 @@ "type__tostring": "string[]", "type": {}, "declarationLine": "protected $foo;", - "documentation": null + "documentation": null, + "signatureInformation": null } } } \ 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..4b2f07b 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, + "signatureInformation": null } } } \ 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..211a12f 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, + "signatureInformation": null }, "TestNamespace\\A": { "fqn": "TestNamespace\\A", @@ -44,7 +45,8 @@ }, "type": null, "declarationLine": "class A {", - "documentation": null + "documentation": null, + "signatureInformation": null }, "TestNamespace\\A->a": { "fqn": "TestNamespace\\A->a", @@ -64,7 +66,8 @@ "type__tostring": "int", "type": {}, "declarationLine": "public $a;", - "documentation": null + "documentation": null, + "signatureInformation": null } } } \ 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..f5ae22a 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, + "signatureInformation": null }, "TestNamespace\\TestClass": { "fqn": "TestNamespace\\TestClass", @@ -44,7 +45,8 @@ }, "type": null, "declarationLine": "class TestClass", - "documentation": null + "documentation": null, + "signatureInformation": null }, "TestNamespace\\TestClass->testProperty": { "fqn": "TestNamespace\\TestClass->testProperty", @@ -64,7 +66,8 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "public $testProperty;", - "documentation": null + "documentation": null, + "signatureInformation": null }, "TestNamespace\\TestClass->testMethod()": { "fqn": "TestNamespace\\TestClass->testMethod()", @@ -84,7 +87,17 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "public function testMethod($testParameter)", - "documentation": null + "documentation": null, + "signatureInformation": { + "label": "(mixed $testParameter)", + "documentation": null, + "parameters": [ + { + "label": "mixed $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..3fcc367 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, + "signatureInformation": null }, "MyNamespace\\A": { "fqn": "MyNamespace\\A", @@ -44,7 +45,8 @@ }, "type": null, "declarationLine": "class A", - "documentation": null + "documentation": null, + "signatureInformation": null }, "MyNamespace\\A::suite()": { "fqn": "MyNamespace\\A::suite()", @@ -64,7 +66,12 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "public static function suite()", - "documentation": null + "documentation": null, + "signatureInformation": { + "label": "()", + "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..0837b67 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, + "signatureInformation": null }, "MyNamespace\\A": { "fqn": "MyNamespace\\A", @@ -44,7 +45,8 @@ }, "type": null, "declarationLine": "class A", - "documentation": null + "documentation": null, + "signatureInformation": null }, "MyNamespace\\A::suite()": { "fqn": "MyNamespace\\A::suite()", @@ -64,7 +66,12 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "public static function suite()", - "documentation": null + "documentation": null, + "signatureInformation": { + "label": "()", + "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..4b780a0 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, + "signatureInformation": null }, "MyNamespace\\A": { "fqn": "MyNamespace\\A", @@ -44,7 +45,8 @@ }, "type": null, "declarationLine": "class A", - "documentation": null + "documentation": null, + "signatureInformation": null }, "MyNamespace\\A::suite()": { "fqn": "MyNamespace\\A::suite()", @@ -64,7 +66,12 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "public static function suite()", - "documentation": null + "documentation": null, + "signatureInformation": { + "label": "()", + "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..1f2bcd5 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, + "signatureInformation": null }, "MyNamespace\\A": { "fqn": "MyNamespace\\A", @@ -44,7 +45,8 @@ }, "type": null, "declarationLine": "class A", - "documentation": null + "documentation": null, + "signatureInformation": null }, "MyNamespace\\A->suite()": { "fqn": "MyNamespace\\A->suite()", @@ -64,7 +66,12 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "public function suite()", - "documentation": null + "documentation": null, + "signatureInformation": { + "label": "()", + "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..6b93043 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, + "signatureInformation": null }, "MyNamespace\\Mbstring": { "fqn": "MyNamespace\\Mbstring", @@ -41,7 +42,8 @@ }, "type": null, "declarationLine": "class Mbstring", - "documentation": null + "documentation": null, + "signatureInformation": null }, "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, + "signatureInformation": null } } } \ 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..0a34c36 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, + "signatureInformation": null }, "A->b()": { "fqn": "A->b()", @@ -42,7 +43,17 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "function b ($a = MY_CONSTANT);", - "documentation": null + "documentation": null, + "signatureInformation": { + "label": "(\\MY_CONSTANT $a = MY_CONSTANT)", + "documentation": null, + "parameters": [ + { + "label": "\\MY_CONSTANT $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..27f5df9 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, + "signatureInformation": null } } } \ 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..2dc57b3 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, + "signatureInformation": null } } } \ 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..e422270 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, + "signatureInformation": null } } } \ 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..d22d028 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, + "signatureInformation": null } } } \ 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..5b04b54 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, + "signatureInformation": null } } } \ 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..545f1cb 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, + "signatureInformation": null }, "A::$deprecationsTriggered": { "fqn": "A::$deprecationsTriggered", @@ -42,7 +43,8 @@ "type__tostring": "\\__CLASS__[]", "type": {}, "declarationLine": "private static $deprecationsTriggered;", - "documentation": null + "documentation": null, + "signatureInformation": null } } } \ 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..f0286c3 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, + "signatureInformation": null }, "MyNamespace\\A": { "fqn": "MyNamespace\\A", @@ -44,7 +45,8 @@ }, "type": null, "declarationLine": "class A {", - "documentation": null + "documentation": null, + "signatureInformation": null }, "MyNamespace\\A::a()": { "fqn": "MyNamespace\\A::a()", @@ -64,7 +66,12 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "static function a() {", - "documentation": null + "documentation": null, + "signatureInformation": { + "label": "()", + "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..6060e8e 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, + "signatureInformation": null }, "MyNamespace\\A": { "fqn": "MyNamespace\\A", @@ -44,7 +45,8 @@ }, "type": null, "declarationLine": "class A {", - "documentation": null + "documentation": null, + "signatureInformation": null }, "MyNamespace\\A::a()": { "fqn": "MyNamespace\\A::a()", @@ -64,7 +66,12 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "static function a() {", - "documentation": null + "documentation": null, + "signatureInformation": { + "label": "()", + "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..b0af5aa 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, + "signatureInformation": null }, "MyNamespace\\A": { "fqn": "MyNamespace\\A", @@ -59,7 +60,8 @@ }, "type": null, "declarationLine": "class A {", - "documentation": null + "documentation": null, + "signatureInformation": null }, "MyNamespace\\A::getInitializer()": { "fqn": "MyNamespace\\A::getInitializer()", @@ -79,7 +81,17 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "public static function getInitializer(ClassLoader $loader)", - "documentation": null + "documentation": null, + "signatureInformation": { + "label": "(\\MyNamespace\\ClassLoader $loader)", + "documentation": null, + "parameters": [ + { + "label": "\\MyNamespace\\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..951cacd 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, + "signatureInformation": null }, "MyNamespace\\A": { "fqn": "MyNamespace\\A", @@ -50,7 +51,8 @@ }, "type": null, "declarationLine": "class A {", - "documentation": null + "documentation": null, + "signatureInformation": null }, "MyNamespace\\A->testRequest()": { "fqn": "MyNamespace\\A->testRequest()", @@ -70,7 +72,12 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "public function testRequest()", - "documentation": null + "documentation": null, + "signatureInformation": { + "label": "()", + "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..d4e9104 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, + "signatureInformation": null }, "MyNamespace\\ParseErrorsTest": { "fqn": "MyNamespace\\ParseErrorsTest", @@ -41,7 +42,8 @@ }, "type": null, "declarationLine": "class ParseErrorsTest {", - "documentation": null + "documentation": null, + "signatureInformation": null }, "MyNamespace\\ParseErrorsTest->setUp()": { "fqn": "MyNamespace\\ParseErrorsTest->setUp()", @@ -61,7 +63,12 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "public function setUp()", - "documentation": null + "documentation": null, + "signatureInformation": { + "label": "()", + "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..50e91d1 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, + "signatureInformation": null }, "MyNamespace\\ParseErrorsTest": { "fqn": "MyNamespace\\ParseErrorsTest", @@ -47,7 +48,8 @@ }, "type": null, "declarationLine": "class ParseErrorsTest", - "documentation": null + "documentation": null, + "signatureInformation": null }, "MyNamespace\\ParseErrorsTest->setAccount()": { "fqn": "MyNamespace\\ParseErrorsTest->setAccount()", @@ -67,7 +69,17 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "public function setAccount(AccountInterface $account)", - "documentation": null + "documentation": null, + "signatureInformation": { + "label": "(\\MyNamespace\\AccountInterface $account)", + "documentation": null, + "parameters": [ + { + "label": "\\MyNamespace\\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..0d537c5 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, + "signatureInformation": null }, "FooClass->foo()": { "fqn": "FooClass->foo()", @@ -42,7 +43,12 @@ "type__tostring": "\\FooClass", "type": {}, "declarationLine": "public function foo(): FooClass {", - "documentation": null + "documentation": null, + "signatureInformation": { + "label": "()", + "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..c308cf9 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, + "signatureInformation": null }, "MyNamespace1\\B": { "fqn": "MyNamespace1\\B", @@ -50,7 +51,8 @@ }, "type": null, "declarationLine": "class B {", - "documentation": null + "documentation": null, + "signatureInformation": null }, "MyNamespace1\\B->b()": { "fqn": "MyNamespace1\\B->b()", @@ -70,7 +72,12 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "function b() {", - "documentation": null + "documentation": null, + "signatureInformation": { + "label": "()", + "documentation": null, + "parameters": [] + } }, "MyNamespace2": { "fqn": "MyNamespace2", @@ -89,7 +96,8 @@ }, "type": null, "declarationLine": "namespace MyNamespace2;", - "documentation": null + "documentation": null, + "signatureInformation": null }, "MyNamespace2\\A": { "fqn": "MyNamespace2\\A", @@ -110,7 +118,8 @@ }, "type": null, "declarationLine": "class A extends MyNamespace1\\B {", - "documentation": null + "documentation": null, + "signatureInformation": null }, "MyNamespace2\\A->a()": { "fqn": "MyNamespace2\\A->a()", @@ -130,7 +139,12 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "function a () {", - "documentation": null + "documentation": null, + "signatureInformation": { + "label": "()", + "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..2bca2b6 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, + "signatureInformation": null }, "Foo->fn()": { "fqn": "Foo->fn()", @@ -38,7 +39,12 @@ "type__tostring": "\\Iterator", "type": {}, "declarationLine": "public function fn()", - "documentation": "Foo" + "documentation": "Foo", + "signatureInformation": { + "label": "()", + "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..c52d483 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, + "signatureInformation": null }, "A->b()": { "fqn": "A->b()", @@ -42,7 +43,12 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "function b() {", - "documentation": null + "documentation": null, + "signatureInformation": { + "label": "()", + "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..cd0ade5 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, + "signatureInformation": null } } } \ 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..7ad96f3 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, + "signatureInformation": null } } } \ 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..6c559a3 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, + "signatureInformation": null } } } \ 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..95c5019 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, + "signatureInformation": null } } } \ 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..90ad0f5 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, + "signatureInformation": null }, "MyNamespace\\A": { "fqn": "MyNamespace\\A", @@ -41,7 +42,8 @@ }, "type": null, "declarationLine": "class A {", - "documentation": null + "documentation": null, + "signatureInformation": null }, "MyNamespace\\A->a()": { "fqn": "MyNamespace\\A->a()", @@ -61,7 +63,12 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "function a () {", - "documentation": null + "documentation": null, + "signatureInformation": { + "label": "()", + "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..b6f69a3 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, + "signatureInformation": null }, "MyNamespace\\B": { "fqn": "MyNamespace\\B", @@ -44,7 +45,8 @@ }, "type": null, "declarationLine": "class B {", - "documentation": null + "documentation": null, + "signatureInformation": null }, "MyNamespace\\A": { "fqn": "MyNamespace\\A", @@ -63,7 +65,8 @@ }, "type": null, "declarationLine": "class A {", - "documentation": null + "documentation": null, + "signatureInformation": null }, "MyNamespace\\A->a()": { "fqn": "MyNamespace\\A->a()", @@ -83,7 +86,12 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "function a () {", - "documentation": null + "documentation": null, + "signatureInformation": { + "label": "()", + "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..a5f389b 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, + "signatureInformation": null }, "A->a()": { "fqn": "A->a()", @@ -42,7 +43,12 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "function a () {", - "documentation": null + "documentation": null, + "signatureInformation": { + "label": "()", + "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..dd7c2a6 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, + "signatureInformation": null }, "MyNamespace\\init()": { "fqn": "MyNamespace\\init()", @@ -42,7 +43,17 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "function init(Hi $view)", - "documentation": null + "documentation": null, + "signatureInformation": { + "label": "(\\MyNamespace\\Hi $view)", + "documentation": null, + "parameters": [ + { + "label": "\\MyNamespace\\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..661f631 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, + "signatureInformation": null }, "MyNamespace\\B": { "fqn": "MyNamespace\\B", @@ -41,7 +42,8 @@ }, "type": null, "declarationLine": "class B {", - "documentation": null + "documentation": null, + "signatureInformation": null }, "MyNamespace\\B->b()": { "fqn": "MyNamespace\\B->b()", @@ -61,7 +63,12 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "function b() {", - "documentation": null + "documentation": null, + "signatureInformation": { + "label": "()", + "documentation": null, + "parameters": [] + } }, "MyNamespace\\A": { "fqn": "MyNamespace\\A", @@ -82,7 +89,8 @@ }, "type": null, "declarationLine": "class A extends B {", - "documentation": null + "documentation": null, + "signatureInformation": null }, "MyNamespace\\A->a()": { "fqn": "MyNamespace\\A->a()", @@ -102,7 +110,12 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "function a () {", - "documentation": null + "documentation": null, + "signatureInformation": { + "label": "()", + "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..9ad39f8 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, + "signatureInformation": null }, "MyNamespace\\B": { "fqn": "MyNamespace\\B", @@ -44,7 +45,8 @@ }, "type": null, "declarationLine": "class B {", - "documentation": null + "documentation": null, + "signatureInformation": null }, "MyNamespace\\B->b()": { "fqn": "MyNamespace\\B->b()", @@ -64,7 +66,12 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "function b() {", - "documentation": null + "documentation": null, + "signatureInformation": { + "label": "()", + "documentation": null, + "parameters": [] + } }, "MyNamespace\\A": { "fqn": "MyNamespace\\A", @@ -85,7 +92,8 @@ }, "type": null, "declarationLine": "class A extends B {", - "documentation": null + "documentation": null, + "signatureInformation": null }, "MyNamespace\\A->a()": { "fqn": "MyNamespace\\A->a()", @@ -105,7 +113,12 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "function a () {", - "documentation": null + "documentation": null, + "signatureInformation": { + "label": "()", + "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..d43cabf 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, + "signatureInformation": null }, "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.", + "signatureInformation": null } } } \ 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..4b5bd9b 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, + "signatureInformation": null }, "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.", + "signatureInformation": null } } } \ 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..17a4802 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, + "signatureInformation": null }, "TestNamespace\\whatever()": { "fqn": "TestNamespace\\whatever()", @@ -45,7 +46,17 @@ "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.", + "signatureInformation": { + "label": "(\\TestNamespace\\TestClass $param)", + "documentation": "Aute duis elit reprehenderit tempor cillum proident anim laborum eu laboris reprehenderit ea incididunt.", + "parameters": [ + { + "label": "\\TestNamespace\\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..6020ee8 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, + "signatureInformation": null }, "MyNamespace\\A": { "fqn": "MyNamespace\\A", @@ -44,7 +45,8 @@ }, "type": null, "declarationLine": "class A {", - "documentation": null + "documentation": null, + "signatureInformation": null }, "MyNamespace\\A::a()": { "fqn": "MyNamespace\\A::a()", @@ -64,7 +66,12 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "static function a() {", - "documentation": null + "documentation": null, + "signatureInformation": { + "label": "()", + "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..664d790 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, + "signatureInformation": null } } } \ 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..54ca5f1 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, + "signatureInformation": null }, "A::$a": { "fqn": "A::$a", @@ -45,7 +46,8 @@ "type__tostring": "string", "type": {}, "declarationLine": "static $a;", - "documentation": null + "documentation": null, + "signatureInformation": null } } } \ 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..ee944ed 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, + "signatureInformation": null }, "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.", + "signatureInformation": null } } } \ 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..899df1c 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, + "signatureInformation": null }, "MyNamespace\\B": { "fqn": "MyNamespace\\B", @@ -47,7 +48,8 @@ }, "type": null, "declarationLine": "class B {", - "documentation": null + "documentation": null, + "signatureInformation": null }, "MyNamespace\\B->b()": { "fqn": "MyNamespace\\B->b()", @@ -67,7 +69,12 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "function b() {", - "documentation": null + "documentation": null, + "signatureInformation": { + "label": "()", + "documentation": null, + "parameters": [] + } }, "MyNamespace\\A": { "fqn": "MyNamespace\\A", @@ -88,7 +95,8 @@ }, "type": null, "declarationLine": "class A extends B {", - "documentation": null + "documentation": null, + "signatureInformation": null }, "MyNamespace\\A->a()": { "fqn": "MyNamespace\\A->a()", @@ -108,7 +116,12 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "function a () {", - "documentation": null + "documentation": null, + "signatureInformation": { + "label": "()", + "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..1c1ef87 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, + "signatureInformation": null }, "MyNamespace\\B": { "fqn": "MyNamespace\\B", @@ -47,7 +48,8 @@ }, "type": null, "declarationLine": "class B {", - "documentation": null + "documentation": null, + "signatureInformation": null }, "MyNamespace\\B->b()": { "fqn": "MyNamespace\\B->b()", @@ -67,7 +69,12 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "function b() {", - "documentation": null + "documentation": null, + "signatureInformation": { + "label": "()", + "documentation": null, + "parameters": [] + } }, "MyNamespace\\A": { "fqn": "MyNamespace\\A", @@ -88,7 +95,8 @@ }, "type": null, "declarationLine": "class A extends B {", - "documentation": null + "documentation": null, + "signatureInformation": null }, "MyNamespace\\A->a()": { "fqn": "MyNamespace\\A->a()", @@ -108,7 +116,12 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "function a () {", - "documentation": null + "documentation": null, + "signatureInformation": { + "label": "()", + "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..0a43146 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, + "signatureInformation": null }, "MyNamespace\\B": { "fqn": "MyNamespace\\B", @@ -47,7 +48,8 @@ }, "type": null, "declarationLine": "class B {", - "documentation": null + "documentation": null, + "signatureInformation": null }, "MyNamespace\\B->b()": { "fqn": "MyNamespace\\B->b()", @@ -67,7 +69,12 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "function b() {", - "documentation": null + "documentation": null, + "signatureInformation": { + "label": "()", + "documentation": null, + "parameters": [] + } }, "MyNamespace\\A": { "fqn": "MyNamespace\\A", @@ -88,7 +95,8 @@ }, "type": null, "declarationLine": "class A extends B {", - "documentation": null + "documentation": null, + "signatureInformation": null }, "MyNamespace\\A->a()": { "fqn": "MyNamespace\\A->a()", @@ -108,7 +116,12 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "function a () {", - "documentation": null + "documentation": null, + "signatureInformation": { + "label": "()", + "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..b925fdd 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, + "signatureInformation": null }, "MyNamespace\\A": { "fqn": "MyNamespace\\A", @@ -56,7 +57,8 @@ }, "type": null, "declarationLine": "class A", - "documentation": null + "documentation": null, + "signatureInformation": null }, "MyNamespace\\A::suite()": { "fqn": "MyNamespace\\A::suite()", @@ -76,7 +78,12 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "public static function suite()", - "documentation": null + "documentation": null, + "signatureInformation": { + "label": "()", + "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..10ba7fb 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, + "signatureInformation": null }, "MyNamespace\\A": { "fqn": "MyNamespace\\A", @@ -41,7 +42,8 @@ }, "type": null, "declarationLine": "class A", - "documentation": null + "documentation": null, + "signatureInformation": null }, "MyNamespace\\A->typesProvider()": { "fqn": "MyNamespace\\A->typesProvider()", @@ -61,7 +63,12 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "public function typesProvider()", - "documentation": null + "documentation": null, + "signatureInformation": { + "label": "()", + "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..c71c7c2 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, + "signatureInformation": null }, "MyNamespace\\B": { "fqn": "MyNamespace\\B", @@ -47,7 +48,8 @@ }, "type": null, "declarationLine": "class B {", - "documentation": null + "documentation": null, + "signatureInformation": null }, "MyNamespace\\B->b()": { "fqn": "MyNamespace\\B->b()", @@ -67,7 +69,12 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "function b() {", - "documentation": null + "documentation": null, + "signatureInformation": { + "label": "()", + "documentation": null, + "parameters": [] + } }, "MyNamespace\\A": { "fqn": "MyNamespace\\A", @@ -88,7 +95,8 @@ }, "type": null, "declarationLine": "class A extends B {", - "documentation": null + "documentation": null, + "signatureInformation": null }, "MyNamespace\\A->a()": { "fqn": "MyNamespace\\A->a()", @@ -108,7 +116,12 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "function a () {", - "documentation": null + "documentation": null, + "signatureInformation": { + "label": "()", + "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..5b5a706 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, + "signatureInformation": null }, "MyNamespace\\B": { "fqn": "MyNamespace\\B", @@ -47,7 +48,8 @@ }, "type": null, "declarationLine": "class B {", - "documentation": null + "documentation": null, + "signatureInformation": null }, "MyNamespace\\B->b()": { "fqn": "MyNamespace\\B->b()", @@ -67,7 +69,12 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "function b() {", - "documentation": null + "documentation": null, + "signatureInformation": { + "label": "()", + "documentation": null, + "parameters": [] + } }, "MyNamespace\\A": { "fqn": "MyNamespace\\A", @@ -88,7 +95,8 @@ }, "type": null, "declarationLine": "class A extends B {", - "documentation": null + "documentation": null, + "signatureInformation": null }, "MyNamespace\\A->a()": { "fqn": "MyNamespace\\A->a()", @@ -108,7 +116,12 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "function a () {", - "documentation": null + "documentation": null, + "signatureInformation": { + "label": "()", + "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..a88f554 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, + "signatureInformation": null }, "MyNamespace\\B": { "fqn": "MyNamespace\\B", @@ -47,7 +48,8 @@ }, "type": null, "declarationLine": "class B {", - "documentation": null + "documentation": null, + "signatureInformation": null }, "MyNamespace\\B->b()": { "fqn": "MyNamespace\\B->b()", @@ -67,7 +69,12 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "function b() {", - "documentation": null + "documentation": null, + "signatureInformation": { + "label": "()", + "documentation": null, + "parameters": [] + } }, "MyNamespace\\A": { "fqn": "MyNamespace\\A", @@ -88,7 +95,8 @@ }, "type": null, "declarationLine": "class A extends B {", - "documentation": null + "documentation": null, + "signatureInformation": null }, "MyNamespace\\A->a()": { "fqn": "MyNamespace\\A->a()", @@ -108,7 +116,12 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "function a () {", - "documentation": null + "documentation": null, + "signatureInformation": { + "label": "()", + "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..adc75a9 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, + "signatureInformation": null }, "MyNamespace\\A": { "fqn": "MyNamespace\\A", @@ -46,7 +47,8 @@ }, "type": null, "declarationLine": "class A extends B {", - "documentation": null + "documentation": null, + "signatureInformation": null }, "MyNamespace\\A->a()": { "fqn": "MyNamespace\\A->a()", @@ -66,7 +68,12 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "function a () {", - "documentation": null + "documentation": null, + "signatureInformation": { + "label": "()", + "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..8de5673 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, + "signatureInformation": null }, "FooClass::staticFoo()": { "fqn": "FooClass::staticFoo()", @@ -42,7 +43,12 @@ "type__tostring": "\\FooClass", "type": {}, "declarationLine": "public static function staticFoo(): FooClass {", - "documentation": null + "documentation": null, + "signatureInformation": { + "label": "()", + "documentation": null, + "parameters": [] + } }, "FooClass->bar()": { "fqn": "FooClass->bar()", @@ -62,7 +68,12 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "public function bar() { }", - "documentation": null + "documentation": null, + "signatureInformation": { + "label": "()", + "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..6372c89 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, + "signatureInformation": null }, "B->hi": { "fqn": "B->hi", @@ -42,7 +43,8 @@ "type__tostring": "int", "type": {}, "declarationLine": "public $hi;", - "documentation": null + "documentation": null, + "signatureInformation": null }, "B->a()": { "fqn": "B->a()", @@ -62,7 +64,12 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "function a () {", - "documentation": null + "documentation": null, + "signatureInformation": { + "label": "()", + "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..7966afb 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, + "signatureInformation": null } } } \ 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..a434cf2 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, + "signatureInformation": null }, "Foo->bar": { "fqn": "Foo->bar", @@ -45,7 +46,8 @@ "type__tostring": "\\", "type": {}, "declarationLine": "protected $bar;", - "documentation": null + "documentation": null, + "signatureInformation": null }, "Foo->foo()": { "fqn": "Foo->foo()", @@ -65,7 +67,12 @@ "type__tostring": "mixed", "type": {}, "declarationLine": "public function foo () {", - "documentation": null + "documentation": null, + "signatureInformation": { + "label": "()", + "documentation": null, + "parameters": [] + } } } } \ No newline at end of file