From 3d6682a12ce350de7c8cdffbbd264e4329b7f3e8 Mon Sep 17 00:00:00 2001 From: ADmad Date: Fri, 14 Jul 2017 02:31:36 +0530 Subject: [PATCH] Append backlash to namespace identifer in IdentifierResolver. Refs #400. --- src/DefinitionResolver.php | 4 ++-- tests/NodeVisitor/DefinitionCollectorTest.php | 6 +++--- tests/Server/TextDocument/DocumentSymbolTest.php | 2 +- tests/Server/Workspace/SymbolTest.php | 4 ++-- .../cases/WithReturnTypehints.php.expected.json | 6 +++--- ...sClassMembersShouldNotBeSymbols.php.expected.json | 6 +++--- .../cases/caseStatement1.php.expected.json | 6 +++--- .../cases/classDefinition1.php.expected.json | 6 +++--- .../cases/classProperty1.php.expected.json | 6 +++--- tests/Validation/cases/constants.php.expected.json | 6 +++--- tests/Validation/cases/constants2.php.expected.json | 6 +++--- tests/Validation/cases/constants3.php.expected.json | 6 +++--- tests/Validation/cases/constants4.php.expected.json | 6 +++--- tests/Validation/cases/constants5.php.expected.json | 6 +++--- .../docBlocksOnNamespaceDefinition.php.expected.json | 6 +++--- tests/Validation/cases/exceptions1.php.expected.json | 6 +++--- .../Validation/cases/ifStatement1.php.expected.json | 6 +++--- .../magicConstantsShouldBeGlobal.php.expected.json | 6 +++--- .../Validation/cases/memberAccess1.php.expected.json | 6 +++--- .../Validation/cases/memberAccess2.php.expected.json | 6 +++--- .../Validation/cases/memberAccess3.php.expected.json | 6 +++--- .../Validation/cases/memberAccess4.php.expected.json | 6 +++--- .../Validation/cases/memberAccess5.php.expected.json | 6 +++--- tests/Validation/cases/memberCall1.php.expected.json | 6 +++--- .../cases/multipleNamespaces.php.expected.json | 12 ++++++------ tests/Validation/cases/namespaces2.php.expected.json | 6 +++--- tests/Validation/cases/namespaces5.php.expected.json | 6 +++--- tests/Validation/cases/namespaces6.php.expected.json | 6 +++--- tests/Validation/cases/namespaces8.php.expected.json | 6 +++--- .../cases/objectCreation.php.expected.json | 6 +++--- .../cases/objectCreation2.php.expected.json | 6 +++--- tests/Validation/cases/param1.php.expected.json | 6 +++--- tests/Validation/cases/parent1.php.expected.json | 6 +++--- tests/Validation/cases/parent3.php.expected.json | 6 +++--- tests/Validation/cases/returnType.php.expected.json | 6 +++--- .../cases/scopedPropertyAccess.php.expected.json | 6 +++--- .../cases/scopedPropertyAccess2.php.expected.json | 6 +++--- tests/Validation/cases/self1.php.expected.json | 6 +++--- tests/Validation/cases/self2.php.expected.json | 6 +++--- tests/Validation/cases/self3.php.expected.json | 6 +++--- tests/Validation/cases/self4.php.expected.json | 6 +++--- tests/Validation/cases/self5.php.expected.json | 6 +++--- tests/Validation/cases/static1.php.expected.json | 6 +++--- tests/Validation/cases/static2.php.expected.json | 6 +++--- tests/Validation/cases/static3.php.expected.json | 6 +++--- tests/Validation/cases/static4.php.expected.json | 6 +++--- ...QualifiedNameOutsideOfNamespace.php.expected.json | 6 +++--- 47 files changed, 140 insertions(+), 140 deletions(-) diff --git a/src/DefinitionResolver.php b/src/DefinitionResolver.php index 51c5955..a8c5411 100644 --- a/src/DefinitionResolver.php +++ b/src/DefinitionResolver.php @@ -1109,10 +1109,10 @@ class DefinitionResolver } // INPUT OUTPUT: - // namespace A\B; A\B + // namespace A\B; A\B\ if ($node instanceof Node\Statement\NamespaceDefinition && $node->name instanceof Node\QualifiedName) { $name = (string) PhpParser\ResolvedName::buildName($node->name->nameParts, $node->getFileContents()); - return $name === "" ? null : $name; + return $name === "" ? null : $name . '\\'; } // INPUT OUTPUT: diff --git a/tests/NodeVisitor/DefinitionCollectorTest.php b/tests/NodeVisitor/DefinitionCollectorTest.php index a092b62..e7788da 100644 --- a/tests/NodeVisitor/DefinitionCollectorTest.php +++ b/tests/NodeVisitor/DefinitionCollectorTest.php @@ -21,7 +21,7 @@ class DefinitionCollectorTest extends TestCase $defNodes = $this->collectDefinitions($path); $this->assertEquals([ - 'TestNamespace', + 'TestNamespace\\', 'TestNamespace\\TEST_CONST', 'TestNamespace\\TestClass', 'TestNamespace\\TestClass::TEST_CLASS_CONST', @@ -60,8 +60,8 @@ class DefinitionCollectorTest extends TestCase $path = realpath(__DIR__ . '/../../fixtures/references.php'); $defNodes = $this->collectDefinitions($path); - $this->assertEquals(['TestNamespace', 'TestNamespace\\whatever()'], array_keys($defNodes)); - $this->assertInstanceOf(Node\Statement\NamespaceDefinition::class, $defNodes['TestNamespace']); + $this->assertEquals(['TestNamespace\\', 'TestNamespace\\whatever()'], array_keys($defNodes)); + $this->assertInstanceOf(Node\Statement\NamespaceDefinition::class, $defNodes['TestNamespace\\']); $this->assertInstanceOf(Node\Statement\FunctionDeclaration::class, $defNodes['TestNamespace\\whatever()']); } diff --git a/tests/Server/TextDocument/DocumentSymbolTest.php b/tests/Server/TextDocument/DocumentSymbolTest.php index 155e4a2..db8d2d9 100644 --- a/tests/Server/TextDocument/DocumentSymbolTest.php +++ b/tests/Server/TextDocument/DocumentSymbolTest.php @@ -18,7 +18,7 @@ class DocumentSymbolTest extends ServerTestCase $result = $this->textDocument->documentSymbol(new TextDocumentIdentifier($uri))->wait(); // @codingStandardsIgnoreStart $this->assertEquals([ - new SymbolInformation('TestNamespace', SymbolKind::NAMESPACE, $this->getDefinitionLocation('TestNamespace'), ''), + new SymbolInformation('TestNamespace', SymbolKind::NAMESPACE, $this->getDefinitionLocation('TestNamespace'), 'TestNamespace'), new SymbolInformation('TEST_CONST', SymbolKind::CONSTANT, $this->getDefinitionLocation('TestNamespace\\TEST_CONST'), 'TestNamespace'), new SymbolInformation('TestClass', SymbolKind::CLASS_, $this->getDefinitionLocation('TestNamespace\\TestClass'), 'TestNamespace'), new SymbolInformation('TEST_CLASS_CONST', SymbolKind::CONSTANT, $this->getDefinitionLocation('TestNamespace\\TestClass::TEST_CLASS_CONST'), 'TestNamespace\\TestClass'), diff --git a/tests/Server/Workspace/SymbolTest.php b/tests/Server/Workspace/SymbolTest.php index 765841b..d6d74a6 100644 --- a/tests/Server/Workspace/SymbolTest.php +++ b/tests/Server/Workspace/SymbolTest.php @@ -30,7 +30,7 @@ class SymbolTest extends ServerTestCase // @codingStandardsIgnoreStart $this->assertEquals([ - new SymbolInformation('TestNamespace', SymbolKind::NAMESPACE, new Location($referencesUri, new Range(new Position(2, 0), new Position(2, 24))), ''), + new SymbolInformation('TestNamespace', SymbolKind::NAMESPACE, new Location($referencesUri, new Range(new Position(2, 0), new Position(2, 24))), 'TestNamespace'), // Namespaced new SymbolInformation('TEST_CONST', SymbolKind::CONSTANT, $this->getDefinitionLocation('TestNamespace\\TEST_CONST'), 'TestNamespace'), new SymbolInformation('TestClass', SymbolKind::CLASS_, $this->getDefinitionLocation('TestNamespace\\TestClass'), 'TestNamespace'), @@ -65,7 +65,7 @@ class SymbolTest extends ServerTestCase new SymbolInformation('unusedMethod', SymbolKind::METHOD, $this->getDefinitionLocation('UnusedClass::unusedMethod'), 'UnusedClass'), new SymbolInformation('whatever', SymbolKind::FUNCTION, $this->getDefinitionLocation('whatever()'), ''), - new SymbolInformation('SecondTestNamespace', SymbolKind::NAMESPACE, $this->getDefinitionLocation('SecondTestNamespace'), ''), + new SymbolInformation('SecondTestNamespace', SymbolKind::NAMESPACE, $this->getDefinitionLocation('SecondTestNamespace'), 'SecondTestNamespace'), ], $result); // @codingStandardsIgnoreEnd } diff --git a/tests/Validation/cases/WithReturnTypehints.php.expected.json b/tests/Validation/cases/WithReturnTypehints.php.expected.json index 26b00e2..5b3c3d9 100644 --- a/tests/Validation/cases/WithReturnTypehints.php.expected.json +++ b/tests/Validation/cases/WithReturnTypehints.php.expected.json @@ -17,8 +17,8 @@ ] }, "definitions": { - "Fixtures\\Prophecy": { - "fqn": "Fixtures\\Prophecy", + "Fixtures\\Prophecy\\": { + "fqn": "Fixtures\\Prophecy\\", "extends": [], "isGlobal": true, "roamed": false, @@ -30,7 +30,7 @@ "location": { "uri": "./WithReturnTypehints.php" }, - "containerName": "Fixtures" + "containerName": "Fixtures\\Prophecy" }, "type": null, "declarationLine": "namespace Fixtures\\Prophecy;", diff --git a/tests/Validation/cases/anonymousClassMembersShouldNotBeSymbols.php.expected.json b/tests/Validation/cases/anonymousClassMembersShouldNotBeSymbols.php.expected.json index b0625d7..b3d546c 100644 --- a/tests/Validation/cases/anonymousClassMembersShouldNotBeSymbols.php.expected.json +++ b/tests/Validation/cases/anonymousClassMembersShouldNotBeSymbols.php.expected.json @@ -1,8 +1,8 @@ { "references": [], "definitions": { - "MyNamespace": { - "fqn": "MyNamespace", + "MyNamespace\\": { + "fqn": "MyNamespace\\", "extends": [], "isGlobal": true, "roamed": false, @@ -14,7 +14,7 @@ "location": { "uri": "./anonymousClassMembersShouldNotBeSymbols.php" }, - "containerName": "" + "containerName": "MyNamespace" }, "type": null, "declarationLine": "namespace MyNamespace;", diff --git a/tests/Validation/cases/caseStatement1.php.expected.json b/tests/Validation/cases/caseStatement1.php.expected.json index 573dd17..0772acb 100644 --- a/tests/Validation/cases/caseStatement1.php.expected.json +++ b/tests/Validation/cases/caseStatement1.php.expected.json @@ -8,8 +8,8 @@ ] }, "definitions": { - "MyNamespace": { - "fqn": "MyNamespace", + "MyNamespace\\": { + "fqn": "MyNamespace\\", "extends": [], "isGlobal": true, "roamed": false, @@ -21,7 +21,7 @@ "location": { "uri": "./caseStatement1.php" }, - "containerName": "" + "containerName": "MyNamespace" }, "type": null, "declarationLine": "namespace MyNamespace;", diff --git a/tests/Validation/cases/classDefinition1.php.expected.json b/tests/Validation/cases/classDefinition1.php.expected.json index 6c418b7..0f0f7e2 100644 --- a/tests/Validation/cases/classDefinition1.php.expected.json +++ b/tests/Validation/cases/classDefinition1.php.expected.json @@ -8,8 +8,8 @@ ] }, "definitions": { - "TestNamespace": { - "fqn": "TestNamespace", + "TestNamespace\\": { + "fqn": "TestNamespace\\", "extends": [], "isGlobal": true, "roamed": false, @@ -21,7 +21,7 @@ "location": { "uri": "./classDefinition1.php" }, - "containerName": "" + "containerName": "TestNamespace" }, "type": null, "declarationLine": "namespace TestNamespace;", diff --git a/tests/Validation/cases/classProperty1.php.expected.json b/tests/Validation/cases/classProperty1.php.expected.json index e00107e..824b3f3 100644 --- a/tests/Validation/cases/classProperty1.php.expected.json +++ b/tests/Validation/cases/classProperty1.php.expected.json @@ -8,8 +8,8 @@ ] }, "definitions": { - "TestNamespace": { - "fqn": "TestNamespace", + "TestNamespace\\": { + "fqn": "TestNamespace\\", "extends": [], "isGlobal": true, "roamed": false, @@ -21,7 +21,7 @@ "location": { "uri": "./classProperty1.php" }, - "containerName": "" + "containerName": "TestNamespace" }, "type": null, "declarationLine": "namespace TestNamespace;", diff --git a/tests/Validation/cases/constants.php.expected.json b/tests/Validation/cases/constants.php.expected.json index d629870..6f439d0 100644 --- a/tests/Validation/cases/constants.php.expected.json +++ b/tests/Validation/cases/constants.php.expected.json @@ -8,8 +8,8 @@ ] }, "definitions": { - "MyNamespace": { - "fqn": "MyNamespace", + "MyNamespace\\": { + "fqn": "MyNamespace\\", "extends": [], "isGlobal": true, "roamed": false, @@ -21,7 +21,7 @@ "location": { "uri": "./constants.php" }, - "containerName": "" + "containerName": "MyNamespace" }, "type": null, "declarationLine": "namespace MyNamespace;", diff --git a/tests/Validation/cases/constants2.php.expected.json b/tests/Validation/cases/constants2.php.expected.json index 66c678f..ffbd1d0 100644 --- a/tests/Validation/cases/constants2.php.expected.json +++ b/tests/Validation/cases/constants2.php.expected.json @@ -8,8 +8,8 @@ ] }, "definitions": { - "MyNamespace": { - "fqn": "MyNamespace", + "MyNamespace\\": { + "fqn": "MyNamespace\\", "extends": [], "isGlobal": true, "roamed": false, @@ -21,7 +21,7 @@ "location": { "uri": "./constants2.php" }, - "containerName": "" + "containerName": "MyNamespace" }, "type": null, "declarationLine": "namespace MyNamespace;", diff --git a/tests/Validation/cases/constants3.php.expected.json b/tests/Validation/cases/constants3.php.expected.json index 03f00ba..b422a28 100644 --- a/tests/Validation/cases/constants3.php.expected.json +++ b/tests/Validation/cases/constants3.php.expected.json @@ -8,8 +8,8 @@ ] }, "definitions": { - "MyNamespace": { - "fqn": "MyNamespace", + "MyNamespace\\": { + "fqn": "MyNamespace\\", "extends": [], "isGlobal": true, "roamed": false, @@ -21,7 +21,7 @@ "location": { "uri": "./constants3.php" }, - "containerName": "" + "containerName": "MyNamespace" }, "type": null, "declarationLine": "namespace MyNamespace;", diff --git a/tests/Validation/cases/constants4.php.expected.json b/tests/Validation/cases/constants4.php.expected.json index 62ce430..29d4d7a 100644 --- a/tests/Validation/cases/constants4.php.expected.json +++ b/tests/Validation/cases/constants4.php.expected.json @@ -8,8 +8,8 @@ ] }, "definitions": { - "MyNamespace": { - "fqn": "MyNamespace", + "MyNamespace\\": { + "fqn": "MyNamespace\\", "extends": [], "isGlobal": true, "roamed": false, @@ -21,7 +21,7 @@ "location": { "uri": "./constants4.php" }, - "containerName": "" + "containerName": "MyNamespace" }, "type": null, "declarationLine": "namespace MyNamespace;", diff --git a/tests/Validation/cases/constants5.php.expected.json b/tests/Validation/cases/constants5.php.expected.json index bb441c8..d8cce64 100644 --- a/tests/Validation/cases/constants5.php.expected.json +++ b/tests/Validation/cases/constants5.php.expected.json @@ -5,8 +5,8 @@ ] }, "definitions": { - "MyNamespace": { - "fqn": "MyNamespace", + "MyNamespace\\": { + "fqn": "MyNamespace\\", "extends": [], "isGlobal": true, "roamed": false, @@ -18,7 +18,7 @@ "location": { "uri": "./constants5.php" }, - "containerName": "" + "containerName": "MyNamespace" }, "type": null, "declarationLine": "namespace MyNamespace;", diff --git a/tests/Validation/cases/docBlocksOnNamespaceDefinition.php.expected.json b/tests/Validation/cases/docBlocksOnNamespaceDefinition.php.expected.json index 73f6bee..bfbad86 100644 --- a/tests/Validation/cases/docBlocksOnNamespaceDefinition.php.expected.json +++ b/tests/Validation/cases/docBlocksOnNamespaceDefinition.php.expected.json @@ -1,8 +1,8 @@ { "references": [], "definitions": { - "MyNamespace": { - "fqn": "MyNamespace", + "MyNamespace\\": { + "fqn": "MyNamespace\\", "extends": [], "isGlobal": true, "roamed": false, @@ -14,7 +14,7 @@ "location": { "uri": "./docBlocksOnNamespaceDefinition.php" }, - "containerName": "" + "containerName": "MyNamespace" }, "type": null, "declarationLine": "namespace MyNamespace;", diff --git a/tests/Validation/cases/exceptions1.php.expected.json b/tests/Validation/cases/exceptions1.php.expected.json index a4a71d1..d346ec6 100644 --- a/tests/Validation/cases/exceptions1.php.expected.json +++ b/tests/Validation/cases/exceptions1.php.expected.json @@ -5,8 +5,8 @@ ] }, "definitions": { - "MyNamespace": { - "fqn": "MyNamespace", + "MyNamespace\\": { + "fqn": "MyNamespace\\", "extends": [], "isGlobal": true, "roamed": false, @@ -18,7 +18,7 @@ "location": { "uri": "./exceptions1.php" }, - "containerName": "" + "containerName": "MyNamespace" }, "type": null, "declarationLine": "namespace MyNamespace;", diff --git a/tests/Validation/cases/ifStatement1.php.expected.json b/tests/Validation/cases/ifStatement1.php.expected.json index 18efe9f..aadd2cd 100644 --- a/tests/Validation/cases/ifStatement1.php.expected.json +++ b/tests/Validation/cases/ifStatement1.php.expected.json @@ -8,8 +8,8 @@ ] }, "definitions": { - "MyNamespace": { - "fqn": "MyNamespace", + "MyNamespace\\": { + "fqn": "MyNamespace\\", "extends": [], "isGlobal": true, "roamed": false, @@ -21,7 +21,7 @@ "location": { "uri": "./ifStatement1.php" }, - "containerName": "" + "containerName": "MyNamespace" }, "type": null, "declarationLine": "namespace MyNamespace;", diff --git a/tests/Validation/cases/magicConstantsShouldBeGlobal.php.expected.json b/tests/Validation/cases/magicConstantsShouldBeGlobal.php.expected.json index f62d214..94c3c0e 100644 --- a/tests/Validation/cases/magicConstantsShouldBeGlobal.php.expected.json +++ b/tests/Validation/cases/magicConstantsShouldBeGlobal.php.expected.json @@ -8,8 +8,8 @@ ] }, "definitions": { - "B": { - "fqn": "B", + "B\\": { + "fqn": "B\\", "extends": [], "isGlobal": true, "roamed": false, @@ -21,7 +21,7 @@ "location": { "uri": "./magicConstantsShouldBeGlobal.php" }, - "containerName": "" + "containerName": "B" }, "type": null, "declarationLine": "namespace B;", diff --git a/tests/Validation/cases/memberAccess1.php.expected.json b/tests/Validation/cases/memberAccess1.php.expected.json index 7f9630a..46192ec 100644 --- a/tests/Validation/cases/memberAccess1.php.expected.json +++ b/tests/Validation/cases/memberAccess1.php.expected.json @@ -8,8 +8,8 @@ ] }, "definitions": { - "MyNamespace": { - "fqn": "MyNamespace", + "MyNamespace\\": { + "fqn": "MyNamespace\\", "extends": [], "isGlobal": true, "roamed": false, @@ -21,7 +21,7 @@ "location": { "uri": "./memberAccess1.php" }, - "containerName": "" + "containerName": "MyNamespace" }, "type": null, "declarationLine": "namespace MyNamespace;", diff --git a/tests/Validation/cases/memberAccess2.php.expected.json b/tests/Validation/cases/memberAccess2.php.expected.json index 7b3ce1d..fd842c7 100644 --- a/tests/Validation/cases/memberAccess2.php.expected.json +++ b/tests/Validation/cases/memberAccess2.php.expected.json @@ -8,8 +8,8 @@ ] }, "definitions": { - "MyNamespace": { - "fqn": "MyNamespace", + "MyNamespace\\": { + "fqn": "MyNamespace\\", "extends": [], "isGlobal": true, "roamed": false, @@ -21,7 +21,7 @@ "location": { "uri": "./memberAccess2.php" }, - "containerName": "" + "containerName": "MyNamespace" }, "type": null, "declarationLine": "namespace MyNamespace;", diff --git a/tests/Validation/cases/memberAccess3.php.expected.json b/tests/Validation/cases/memberAccess3.php.expected.json index 520dae8..296558e 100644 --- a/tests/Validation/cases/memberAccess3.php.expected.json +++ b/tests/Validation/cases/memberAccess3.php.expected.json @@ -23,8 +23,8 @@ ] }, "definitions": { - "MyNamespace": { - "fqn": "MyNamespace", + "MyNamespace\\": { + "fqn": "MyNamespace\\", "extends": [], "isGlobal": true, "roamed": false, @@ -36,7 +36,7 @@ "location": { "uri": "./memberAccess3.php" }, - "containerName": "" + "containerName": "MyNamespace" }, "type": null, "declarationLine": "namespace MyNamespace;", diff --git a/tests/Validation/cases/memberAccess4.php.expected.json b/tests/Validation/cases/memberAccess4.php.expected.json index 1d51b85..ec4ec5b 100644 --- a/tests/Validation/cases/memberAccess4.php.expected.json +++ b/tests/Validation/cases/memberAccess4.php.expected.json @@ -14,8 +14,8 @@ ] }, "definitions": { - "MyNamespace": { - "fqn": "MyNamespace", + "MyNamespace\\": { + "fqn": "MyNamespace\\", "extends": [], "isGlobal": true, "roamed": false, @@ -27,7 +27,7 @@ "location": { "uri": "./memberAccess4.php" }, - "containerName": "" + "containerName": "MyNamespace" }, "type": null, "declarationLine": "namespace MyNamespace;", diff --git a/tests/Validation/cases/memberAccess5.php.expected.json b/tests/Validation/cases/memberAccess5.php.expected.json index 57aca0a..aeaacc9 100644 --- a/tests/Validation/cases/memberAccess5.php.expected.json +++ b/tests/Validation/cases/memberAccess5.php.expected.json @@ -5,8 +5,8 @@ ] }, "definitions": { - "MyNamespace": { - "fqn": "MyNamespace", + "MyNamespace\\": { + "fqn": "MyNamespace\\", "extends": [], "isGlobal": true, "roamed": false, @@ -18,7 +18,7 @@ "location": { "uri": "./memberAccess5.php" }, - "containerName": "" + "containerName": "MyNamespace" }, "type": null, "declarationLine": "namespace MyNamespace;", diff --git a/tests/Validation/cases/memberCall1.php.expected.json b/tests/Validation/cases/memberCall1.php.expected.json index 416a705..89989e5 100644 --- a/tests/Validation/cases/memberCall1.php.expected.json +++ b/tests/Validation/cases/memberCall1.php.expected.json @@ -11,8 +11,8 @@ ] }, "definitions": { - "MyNamespace": { - "fqn": "MyNamespace", + "MyNamespace\\": { + "fqn": "MyNamespace\\", "extends": [], "isGlobal": true, "roamed": false, @@ -24,7 +24,7 @@ "location": { "uri": "./memberCall1.php" }, - "containerName": "" + "containerName": "MyNamespace" }, "type": null, "declarationLine": "namespace MyNamespace;", diff --git a/tests/Validation/cases/multipleNamespaces.php.expected.json b/tests/Validation/cases/multipleNamespaces.php.expected.json index 30fe596..8fcf198 100644 --- a/tests/Validation/cases/multipleNamespaces.php.expected.json +++ b/tests/Validation/cases/multipleNamespaces.php.expected.json @@ -14,8 +14,8 @@ ] }, "definitions": { - "MyNamespace1": { - "fqn": "MyNamespace1", + "MyNamespace1\\": { + "fqn": "MyNamespace1\\", "extends": [], "isGlobal": true, "roamed": false, @@ -27,7 +27,7 @@ "location": { "uri": "./multipleNamespaces.php" }, - "containerName": "" + "containerName": "MyNamespace1" }, "type": null, "declarationLine": "namespace MyNamespace1;", @@ -72,8 +72,8 @@ "declarationLine": "function b() {", "documentation": null }, - "MyNamespace2": { - "fqn": "MyNamespace2", + "MyNamespace2\\": { + "fqn": "MyNamespace2\\", "extends": [], "isGlobal": true, "roamed": false, @@ -85,7 +85,7 @@ "location": { "uri": "./multipleNamespaces.php" }, - "containerName": "" + "containerName": "MyNamespace2" }, "type": null, "declarationLine": "namespace MyNamespace2;", diff --git a/tests/Validation/cases/namespaces2.php.expected.json b/tests/Validation/cases/namespaces2.php.expected.json index 42243e5..05dd8a6 100644 --- a/tests/Validation/cases/namespaces2.php.expected.json +++ b/tests/Validation/cases/namespaces2.php.expected.json @@ -14,8 +14,8 @@ ] }, "definitions": { - "MyNamespace1": { - "fqn": "MyNamespace1", + "MyNamespace1\\": { + "fqn": "MyNamespace1\\", "extends": [], "isGlobal": true, "roamed": false, @@ -27,7 +27,7 @@ "location": { "uri": "./namespaces2.php" }, - "containerName": "" + "containerName": "MyNamespace1" }, "type": null, "declarationLine": "namespace MyNamespace1;", diff --git a/tests/Validation/cases/namespaces5.php.expected.json b/tests/Validation/cases/namespaces5.php.expected.json index 5ffe02d..a1c8207 100644 --- a/tests/Validation/cases/namespaces5.php.expected.json +++ b/tests/Validation/cases/namespaces5.php.expected.json @@ -23,8 +23,8 @@ ] }, "definitions": { - "B": { - "fqn": "B", + "B\\": { + "fqn": "B\\", "extends": [], "isGlobal": true, "roamed": false, @@ -36,7 +36,7 @@ "location": { "uri": "./namespaces5.php" }, - "containerName": "" + "containerName": "B" }, "type": null, "declarationLine": "namespace B;", diff --git a/tests/Validation/cases/namespaces6.php.expected.json b/tests/Validation/cases/namespaces6.php.expected.json index 1657f28..bbf5874 100644 --- a/tests/Validation/cases/namespaces6.php.expected.json +++ b/tests/Validation/cases/namespaces6.php.expected.json @@ -1,8 +1,8 @@ { "references": [], "definitions": { - "A\\B": { - "fqn": "A\\B", + "A\\B\\": { + "fqn": "A\\B\\", "extends": [], "isGlobal": true, "roamed": false, @@ -14,7 +14,7 @@ "location": { "uri": "./namespaces6.php" }, - "containerName": "A" + "containerName": "A\\B" }, "type": null, "declarationLine": "namespace A \\ B;", diff --git a/tests/Validation/cases/namespaces8.php.expected.json b/tests/Validation/cases/namespaces8.php.expected.json index 71017d9..a41d38f 100644 --- a/tests/Validation/cases/namespaces8.php.expected.json +++ b/tests/Validation/cases/namespaces8.php.expected.json @@ -11,8 +11,8 @@ ] }, "definitions": { - "LanguageServer\\Tests\\Utils": { - "fqn": "LanguageServer\\Tests\\Utils", + "LanguageServer\\Tests\\Utils\\": { + "fqn": "LanguageServer\\Tests\\Utils\\", "extends": [], "isGlobal": true, "roamed": false, @@ -24,7 +24,7 @@ "location": { "uri": "./namespaces8.php" }, - "containerName": "LanguageServer\\Tests" + "containerName": "LanguageServer\\Tests\\Utils" }, "type": null, "declarationLine": "namespace LanguageServer\\Tests\\Utils;", diff --git a/tests/Validation/cases/objectCreation.php.expected.json b/tests/Validation/cases/objectCreation.php.expected.json index a8fce0f..315f881 100644 --- a/tests/Validation/cases/objectCreation.php.expected.json +++ b/tests/Validation/cases/objectCreation.php.expected.json @@ -5,8 +5,8 @@ ] }, "definitions": { - "MyNamespace": { - "fqn": "MyNamespace", + "MyNamespace\\": { + "fqn": "MyNamespace\\", "extends": [], "isGlobal": true, "roamed": false, @@ -18,7 +18,7 @@ "location": { "uri": "./objectCreation.php" }, - "containerName": "" + "containerName": "MyNamespace" }, "type": null, "declarationLine": "namespace MyNamespace;", diff --git a/tests/Validation/cases/objectCreation2.php.expected.json b/tests/Validation/cases/objectCreation2.php.expected.json index 2ec8314..66dd8a8 100644 --- a/tests/Validation/cases/objectCreation2.php.expected.json +++ b/tests/Validation/cases/objectCreation2.php.expected.json @@ -8,8 +8,8 @@ ] }, "definitions": { - "MyNamespace": { - "fqn": "MyNamespace", + "MyNamespace\\": { + "fqn": "MyNamespace\\", "extends": [], "isGlobal": true, "roamed": false, @@ -21,7 +21,7 @@ "location": { "uri": "./objectCreation2.php" }, - "containerName": "" + "containerName": "MyNamespace" }, "type": null, "declarationLine": "namespace MyNamespace;", diff --git a/tests/Validation/cases/param1.php.expected.json b/tests/Validation/cases/param1.php.expected.json index 33c99db..899fcad 100644 --- a/tests/Validation/cases/param1.php.expected.json +++ b/tests/Validation/cases/param1.php.expected.json @@ -5,8 +5,8 @@ ] }, "definitions": { - "MyNamespace": { - "fqn": "MyNamespace", + "MyNamespace\\": { + "fqn": "MyNamespace\\", "extends": [], "isGlobal": true, "roamed": false, @@ -18,7 +18,7 @@ "location": { "uri": "./param1.php" }, - "containerName": "" + "containerName": "MyNamespace" }, "type": null, "declarationLine": "namespace MyNamespace;", diff --git a/tests/Validation/cases/parent1.php.expected.json b/tests/Validation/cases/parent1.php.expected.json index eab232e..44de2f5 100644 --- a/tests/Validation/cases/parent1.php.expected.json +++ b/tests/Validation/cases/parent1.php.expected.json @@ -8,8 +8,8 @@ ] }, "definitions": { - "MyNamespace": { - "fqn": "MyNamespace", + "MyNamespace\\": { + "fqn": "MyNamespace\\", "extends": [], "isGlobal": true, "roamed": false, @@ -21,7 +21,7 @@ "location": { "uri": "./parent1.php" }, - "containerName": "" + "containerName": "MyNamespace" }, "type": null, "declarationLine": "namespace MyNamespace;", diff --git a/tests/Validation/cases/parent3.php.expected.json b/tests/Validation/cases/parent3.php.expected.json index aedb4b2..70a796d 100644 --- a/tests/Validation/cases/parent3.php.expected.json +++ b/tests/Validation/cases/parent3.php.expected.json @@ -11,8 +11,8 @@ ] }, "definitions": { - "MyNamespace": { - "fqn": "MyNamespace", + "MyNamespace\\": { + "fqn": "MyNamespace\\", "extends": [], "isGlobal": true, "roamed": false, @@ -24,7 +24,7 @@ "location": { "uri": "./parent3.php" }, - "containerName": "" + "containerName": "MyNamespace" }, "type": null, "declarationLine": "namespace MyNamespace;", diff --git a/tests/Validation/cases/returnType.php.expected.json b/tests/Validation/cases/returnType.php.expected.json index cf9cc63..eed7ae8 100644 --- a/tests/Validation/cases/returnType.php.expected.json +++ b/tests/Validation/cases/returnType.php.expected.json @@ -8,8 +8,8 @@ ] }, "definitions": { - "TestNamespace": { - "fqn": "TestNamespace", + "TestNamespace\\": { + "fqn": "TestNamespace\\", "extends": [], "isGlobal": true, "roamed": false, @@ -21,7 +21,7 @@ "location": { "uri": "./returnType.php" }, - "containerName": "" + "containerName": "TestNamespace" }, "type": null, "declarationLine": "namespace TestNamespace;", diff --git a/tests/Validation/cases/scopedPropertyAccess.php.expected.json b/tests/Validation/cases/scopedPropertyAccess.php.expected.json index 52b6e7a..0c3966d 100644 --- a/tests/Validation/cases/scopedPropertyAccess.php.expected.json +++ b/tests/Validation/cases/scopedPropertyAccess.php.expected.json @@ -8,8 +8,8 @@ ] }, "definitions": { - "MyNamespace": { - "fqn": "MyNamespace", + "MyNamespace\\": { + "fqn": "MyNamespace\\", "extends": [], "isGlobal": true, "roamed": false, @@ -21,7 +21,7 @@ "location": { "uri": "./scopedPropertyAccess.php" }, - "containerName": "" + "containerName": "MyNamespace" }, "type": null, "declarationLine": "namespace MyNamespace;", diff --git a/tests/Validation/cases/scopedPropertyAccess2.php.expected.json b/tests/Validation/cases/scopedPropertyAccess2.php.expected.json index e5f6850..f910320 100644 --- a/tests/Validation/cases/scopedPropertyAccess2.php.expected.json +++ b/tests/Validation/cases/scopedPropertyAccess2.php.expected.json @@ -5,8 +5,8 @@ ] }, "definitions": { - "MyNamespace": { - "fqn": "MyNamespace", + "MyNamespace\\": { + "fqn": "MyNamespace\\", "extends": [], "isGlobal": true, "roamed": false, @@ -18,7 +18,7 @@ "location": { "uri": "./scopedPropertyAccess2.php" }, - "containerName": "" + "containerName": "MyNamespace" }, "type": null, "declarationLine": "namespace MyNamespace;", diff --git a/tests/Validation/cases/self1.php.expected.json b/tests/Validation/cases/self1.php.expected.json index eb37fc7..38738a3 100644 --- a/tests/Validation/cases/self1.php.expected.json +++ b/tests/Validation/cases/self1.php.expected.json @@ -11,8 +11,8 @@ ] }, "definitions": { - "MyNamespace": { - "fqn": "MyNamespace", + "MyNamespace\\": { + "fqn": "MyNamespace\\", "extends": [], "isGlobal": true, "roamed": false, @@ -24,7 +24,7 @@ "location": { "uri": "./self1.php" }, - "containerName": "" + "containerName": "MyNamespace" }, "type": null, "declarationLine": "namespace MyNamespace;", diff --git a/tests/Validation/cases/self2.php.expected.json b/tests/Validation/cases/self2.php.expected.json index 2280b1a..2511d8c 100644 --- a/tests/Validation/cases/self2.php.expected.json +++ b/tests/Validation/cases/self2.php.expected.json @@ -11,8 +11,8 @@ ] }, "definitions": { - "MyNamespace": { - "fqn": "MyNamespace", + "MyNamespace\\": { + "fqn": "MyNamespace\\", "extends": [], "isGlobal": true, "roamed": false, @@ -24,7 +24,7 @@ "location": { "uri": "./self2.php" }, - "containerName": "" + "containerName": "MyNamespace" }, "type": null, "declarationLine": "namespace MyNamespace;", diff --git a/tests/Validation/cases/self3.php.expected.json b/tests/Validation/cases/self3.php.expected.json index 3f69299..60c0940 100644 --- a/tests/Validation/cases/self3.php.expected.json +++ b/tests/Validation/cases/self3.php.expected.json @@ -11,8 +11,8 @@ ] }, "definitions": { - "MyNamespace": { - "fqn": "MyNamespace", + "MyNamespace\\": { + "fqn": "MyNamespace\\", "extends": [], "isGlobal": true, "roamed": false, @@ -24,7 +24,7 @@ "location": { "uri": "./self3.php" }, - "containerName": "" + "containerName": "MyNamespace" }, "type": null, "declarationLine": "namespace MyNamespace;", diff --git a/tests/Validation/cases/self4.php.expected.json b/tests/Validation/cases/self4.php.expected.json index ec3ae07..5887d8b 100644 --- a/tests/Validation/cases/self4.php.expected.json +++ b/tests/Validation/cases/self4.php.expected.json @@ -20,8 +20,8 @@ ] }, "definitions": { - "MyNamespace": { - "fqn": "MyNamespace", + "MyNamespace\\": { + "fqn": "MyNamespace\\", "extends": [], "isGlobal": true, "roamed": false, @@ -33,7 +33,7 @@ "location": { "uri": "./self4.php" }, - "containerName": "" + "containerName": "MyNamespace" }, "type": null, "declarationLine": "namespace MyNamespace;", diff --git a/tests/Validation/cases/self5.php.expected.json b/tests/Validation/cases/self5.php.expected.json index 6727689..722d0bf 100644 --- a/tests/Validation/cases/self5.php.expected.json +++ b/tests/Validation/cases/self5.php.expected.json @@ -5,8 +5,8 @@ ] }, "definitions": { - "MyNamespace": { - "fqn": "MyNamespace", + "MyNamespace\\": { + "fqn": "MyNamespace\\", "extends": [], "isGlobal": true, "roamed": false, @@ -18,7 +18,7 @@ "location": { "uri": "./self5.php" }, - "containerName": "" + "containerName": "MyNamespace" }, "type": null, "declarationLine": "namespace MyNamespace;", diff --git a/tests/Validation/cases/static1.php.expected.json b/tests/Validation/cases/static1.php.expected.json index 69f8de0..a8ef8c8 100644 --- a/tests/Validation/cases/static1.php.expected.json +++ b/tests/Validation/cases/static1.php.expected.json @@ -11,8 +11,8 @@ ] }, "definitions": { - "MyNamespace": { - "fqn": "MyNamespace", + "MyNamespace\\": { + "fqn": "MyNamespace\\", "extends": [], "isGlobal": true, "roamed": false, @@ -24,7 +24,7 @@ "location": { "uri": "./static1.php" }, - "containerName": "" + "containerName": "MyNamespace" }, "type": null, "declarationLine": "namespace MyNamespace;", diff --git a/tests/Validation/cases/static2.php.expected.json b/tests/Validation/cases/static2.php.expected.json index 17f9a66..c275c54 100644 --- a/tests/Validation/cases/static2.php.expected.json +++ b/tests/Validation/cases/static2.php.expected.json @@ -11,8 +11,8 @@ ] }, "definitions": { - "MyNamespace": { - "fqn": "MyNamespace", + "MyNamespace\\": { + "fqn": "MyNamespace\\", "extends": [], "isGlobal": true, "roamed": false, @@ -24,7 +24,7 @@ "location": { "uri": "./static2.php" }, - "containerName": "" + "containerName": "MyNamespace" }, "type": null, "declarationLine": "namespace MyNamespace;", diff --git a/tests/Validation/cases/static3.php.expected.json b/tests/Validation/cases/static3.php.expected.json index f6e5189..32b6131 100644 --- a/tests/Validation/cases/static3.php.expected.json +++ b/tests/Validation/cases/static3.php.expected.json @@ -11,8 +11,8 @@ ] }, "definitions": { - "MyNamespace": { - "fqn": "MyNamespace", + "MyNamespace\\": { + "fqn": "MyNamespace\\", "extends": [], "isGlobal": true, "roamed": false, @@ -24,7 +24,7 @@ "location": { "uri": "./static3.php" }, - "containerName": "" + "containerName": "MyNamespace" }, "type": null, "declarationLine": "namespace MyNamespace;", diff --git a/tests/Validation/cases/static4.php.expected.json b/tests/Validation/cases/static4.php.expected.json index 3d05ede..f472283 100644 --- a/tests/Validation/cases/static4.php.expected.json +++ b/tests/Validation/cases/static4.php.expected.json @@ -5,8 +5,8 @@ ] }, "definitions": { - "MyNamespace": { - "fqn": "MyNamespace", + "MyNamespace\\": { + "fqn": "MyNamespace\\", "extends": [], "isGlobal": true, "roamed": false, @@ -18,7 +18,7 @@ "location": { "uri": "./static4.php" }, - "containerName": "" + "containerName": "MyNamespace" }, "type": null, "declarationLine": "namespace MyNamespace;", diff --git a/tests/Validation/cases/testQualifiedNameOutsideOfNamespace.php.expected.json b/tests/Validation/cases/testQualifiedNameOutsideOfNamespace.php.expected.json index f686093..089d120 100644 --- a/tests/Validation/cases/testQualifiedNameOutsideOfNamespace.php.expected.json +++ b/tests/Validation/cases/testQualifiedNameOutsideOfNamespace.php.expected.json @@ -5,8 +5,8 @@ ] }, "definitions": { - "SomeNamespace": { - "fqn": "SomeNamespace", + "SomeNamespace\\": { + "fqn": "SomeNamespace\\", "extends": [], "isGlobal": true, "roamed": false, @@ -18,7 +18,7 @@ "location": { "uri": "./testQualifiedNameOutsideOfNamespace.php" }, - "containerName": "" + "containerName": "SomeNamespace" }, "type": null, "declarationLine": "namespace SomeNamespace { }",