From fc7d7f419edbac4d5dfa6ec94f191042a18bbd22 Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Wed, 7 Jun 2017 14:23:51 -0700 Subject: [PATCH] Use reflection to get Definition props (now includes fqn and declarationLine) --- tests/Validation/ValidationTest.php | 9 ++++----- .../cases/WithReturnTypehints.php.expected.json | 10 ++++++++++ ...sClassMembersShouldNotBeSymbols.php.expected.json | 2 ++ .../arrayValueShouldBeBoolean.php.expected.json | 4 ++++ .../cases/caseStatement1.php.expected.json | 2 ++ .../cases/classDefinition1.php.expected.json | 6 ++++++ .../cases/classProperty1.php.expected.json | 8 ++++++++ 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 ++++++ ...constantsInFunctionParamDefault.php.expected.json | 4 ++++ .../docBlocksOnNamespaceDefinition.php.expected.json | 2 ++ tests/Validation/cases/exceptions1.php.expected.json | 2 ++ .../Validation/cases/ifStatement1.php.expected.json | 2 ++ .../cases/interfaceProperty.php.expected.json | 2 ++ .../magicConstantsShouldBeGlobal.php.expected.json | 2 ++ tests/Validation/cases/magicConsts.php.expected.json | 4 ++++ .../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 ++++++++++++ .../multiplePreceedingComments.php.expected.json | 4 ++++ tests/Validation/cases/nameToken.php.expected.json | 4 ++++ tests/Validation/cases/namespaces2.php.expected.json | 2 ++ tests/Validation/cases/namespaces5.php.expected.json | 2 ++ tests/Validation/cases/namespaces6.php.expected.json | 2 ++ tests/Validation/cases/namespaces8.php.expected.json | 2 ++ .../cases/objectCreation.php.expected.json | 6 ++++++ .../cases/objectCreation2.php.expected.json | 8 ++++++++ .../cases/objectCreation3.php.expected.json | 4 ++++ tests/Validation/cases/param1.php.expected.json | 4 ++++ tests/Validation/cases/parent1.php.expected.json | 10 ++++++++++ tests/Validation/cases/parent3.php.expected.json | 10 ++++++++++ .../Validation/cases/propertyName1.php.expected.json | 4 ++++ .../Validation/cases/propertyName2.php.expected.json | 4 ++++ tests/Validation/cases/returnType.php.expected.json | 4 ++++ .../cases/scopedPropertyAccess.php.expected.json | 6 ++++++ .../cases/scopedPropertyAccess2.php.expected.json | 2 ++ .../cases/scopedPropertyAccess3.php.expected.json | 4 ++++ .../cases/scopedPropertyAccess5.php.expected.json | 4 ++++ tests/Validation/cases/self1.php.expected.json | 10 ++++++++++ tests/Validation/cases/self2.php.expected.json | 10 ++++++++++ tests/Validation/cases/self3.php.expected.json | 10 ++++++++++ tests/Validation/cases/self4.php.expected.json | 6 ++++++ tests/Validation/cases/self5.php.expected.json | 6 ++++++ tests/Validation/cases/static1.php.expected.json | 10 ++++++++++ tests/Validation/cases/static2.php.expected.json | 10 ++++++++++ tests/Validation/cases/static3.php.expected.json | 10 ++++++++++ tests/Validation/cases/static4.php.expected.json | 6 ++++++ .../cases/stringVariable.php.expected.json | 6 ++++++ ...QualifiedNameOutsideOfNamespace.php.expected.json | 2 ++ .../verifyFqsenOnClassProperty.php.expected.json | 6 ++++++ 57 files changed, 310 insertions(+), 5 deletions(-) diff --git a/tests/Validation/ValidationTest.php b/tests/Validation/ValidationTest.php index 5253d21..361ee5c 100644 --- a/tests/Validation/ValidationTest.php +++ b/tests/Validation/ValidationTest.php @@ -92,8 +92,8 @@ class ValidationTest extends TestCase $this->filterSkippedReferences($actualRefs); $actualDefs = $this->getTestValuesFromDefs($document->getDefinitions()); - // TODO - there's probably a more PHP-typical way to do this. Need to compare the objects parsed from json files - // to the real results. json_decode returns stdClass Objects, not arrays. + // There's probably a more PHP-typical way to do this. Need to compare the objects parsed from json files + // to the real objects. $refsAndDefs = array( 'references' => json_decode(json_encode($actualRefs)), 'definitions' => json_decode(json_encode($actualDefs)) @@ -126,14 +126,13 @@ class ValidationTest extends TestCase */ private function getTestValuesFromDefs($definitions): array { - // TODO - use reflection to read these properties - $propertyNames = ['extends', 'isGlobal', 'isStatic', 'canBeInstantiated', 'symbolInformation', 'type', 'documentation']; + $propertyNames = get_class_vars(Definition::class); $defsForAssert = []; foreach ($definitions as $definition) { $fqn = $definition->fqn; - foreach ($propertyNames as $propertyName) { + foreach ($propertyNames as $propertyName => $value) { if ($propertyName === 'symbolInformation') { // Range is very often different - don't check it, for now unset($definition->$propertyName->location->range); diff --git a/tests/Validation/cases/WithReturnTypehints.php.expected.json b/tests/Validation/cases/WithReturnTypehints.php.expected.json index 43dc4b5..50801d9 100644 --- a/tests/Validation/cases/WithReturnTypehints.php.expected.json +++ b/tests/Validation/cases/WithReturnTypehints.php.expected.json @@ -12,6 +12,7 @@ }, "definitions": { "Fixtures\\Prophecy": { + "fqn": "Fixtures\\Prophecy", "extends": [], "isGlobal": true, "isStatic": false, @@ -25,9 +26,11 @@ "containerName": "Fixtures" }, "type": null, + "declarationLine": "namespace Fixtures\\Prophecy;", "documentation": null }, "Fixtures\\Prophecy\\WithReturnTypehints": { + "fqn": "Fixtures\\Prophecy\\WithReturnTypehints", "extends": [ "Fixtures\\Prophecy\\EmptyClass" ], @@ -43,9 +46,11 @@ "containerName": "Fixtures\\Prophecy" }, "type": null, + "declarationLine": "class WithReturnTypehints extends EmptyClass", "documentation": null }, "Fixtures\\Prophecy\\WithReturnTypehints->getSelf()": { + "fqn": "Fixtures\\Prophecy\\WithReturnTypehints->getSelf()", "extends": [], "isGlobal": false, "isStatic": false, @@ -60,9 +65,11 @@ }, "type__class": "phpDocumentor\\Reflection\\Types\\Object_", "type": {}, + "declarationLine": "public function getSelf(): self {", "documentation": null }, "Fixtures\\Prophecy\\WithReturnTypehints->getName()": { + "fqn": "Fixtures\\Prophecy\\WithReturnTypehints->getName()", "extends": [], "isGlobal": false, "isStatic": false, @@ -77,9 +84,11 @@ }, "type__class": "phpDocumentor\\Reflection\\Types\\String_", "type": {}, + "declarationLine": "public function getName(): string {", "documentation": null }, "Fixtures\\Prophecy\\WithReturnTypehints->getParent()": { + "fqn": "Fixtures\\Prophecy\\WithReturnTypehints->getParent()", "extends": [], "isGlobal": false, "isStatic": false, @@ -94,6 +103,7 @@ }, "type__class": "phpDocumentor\\Reflection\\Types\\Object_", "type": {}, + "declarationLine": "public function getParent(): parent {", "documentation": null } } diff --git a/tests/Validation/cases/anonymousClassMembersShouldNotBeSymbols.php.expected.json b/tests/Validation/cases/anonymousClassMembersShouldNotBeSymbols.php.expected.json index 727210b..189d154 100644 --- a/tests/Validation/cases/anonymousClassMembersShouldNotBeSymbols.php.expected.json +++ b/tests/Validation/cases/anonymousClassMembersShouldNotBeSymbols.php.expected.json @@ -2,6 +2,7 @@ "references": [], "definitions": { "MyNamespace": { + "fqn": "MyNamespace", "extends": [], "isGlobal": true, "isStatic": false, @@ -15,6 +16,7 @@ "containerName": "" }, "type": null, + "declarationLine": "namespace MyNamespace;", "documentation": null } } diff --git a/tests/Validation/cases/arrayValueShouldBeBoolean.php.expected.json b/tests/Validation/cases/arrayValueShouldBeBoolean.php.expected.json index 4acb4ba..c9b02d0 100644 --- a/tests/Validation/cases/arrayValueShouldBeBoolean.php.expected.json +++ b/tests/Validation/cases/arrayValueShouldBeBoolean.php.expected.json @@ -2,6 +2,7 @@ "references": [], "definitions": { "A": { + "fqn": "A", "extends": [], "isGlobal": true, "isStatic": false, @@ -15,9 +16,11 @@ "containerName": "" }, "type": null, + "declarationLine": "class A {", "documentation": null }, "A->foo": { + "fqn": "A->foo", "extends": [], "isGlobal": false, "isStatic": false, @@ -32,6 +35,7 @@ }, "type__class": "phpDocumentor\\Reflection\\Types\\Array_", "type": {}, + "declarationLine": "protected $foo;", "documentation": null } } diff --git a/tests/Validation/cases/caseStatement1.php.expected.json b/tests/Validation/cases/caseStatement1.php.expected.json index 8d8d968..7b6dbf2 100644 --- a/tests/Validation/cases/caseStatement1.php.expected.json +++ b/tests/Validation/cases/caseStatement1.php.expected.json @@ -9,6 +9,7 @@ }, "definitions": { "MyNamespace": { + "fqn": "MyNamespace", "extends": [], "isGlobal": true, "isStatic": false, @@ -22,6 +23,7 @@ "containerName": "" }, "type": null, + "declarationLine": "namespace MyNamespace;", "documentation": null } } diff --git a/tests/Validation/cases/classDefinition1.php.expected.json b/tests/Validation/cases/classDefinition1.php.expected.json index f135c15..aad36bb 100644 --- a/tests/Validation/cases/classDefinition1.php.expected.json +++ b/tests/Validation/cases/classDefinition1.php.expected.json @@ -9,6 +9,7 @@ }, "definitions": { "TestNamespace": { + "fqn": "TestNamespace", "extends": [], "isGlobal": true, "isStatic": false, @@ -22,9 +23,11 @@ "containerName": "" }, "type": null, + "declarationLine": "namespace TestNamespace;", "documentation": null }, "TestNamespace\\A": { + "fqn": "TestNamespace\\A", "extends": [], "isGlobal": true, "isStatic": false, @@ -38,9 +41,11 @@ "containerName": "TestNamespace" }, "type": null, + "declarationLine": "class A {", "documentation": null }, "TestNamespace\\A->a": { + "fqn": "TestNamespace\\A->a", "extends": [], "isGlobal": false, "isStatic": false, @@ -55,6 +60,7 @@ }, "type__class": "phpDocumentor\\Reflection\\Types\\Integer", "type": {}, + "declarationLine": "public $a;", "documentation": null } } diff --git a/tests/Validation/cases/classProperty1.php.expected.json b/tests/Validation/cases/classProperty1.php.expected.json index 4469987..671c019 100644 --- a/tests/Validation/cases/classProperty1.php.expected.json +++ b/tests/Validation/cases/classProperty1.php.expected.json @@ -9,6 +9,7 @@ }, "definitions": { "TestNamespace": { + "fqn": "TestNamespace", "extends": [], "isGlobal": true, "isStatic": false, @@ -22,9 +23,11 @@ "containerName": "" }, "type": null, + "declarationLine": "namespace TestNamespace;", "documentation": null }, "TestNamespace\\TestClass": { + "fqn": "TestNamespace\\TestClass", "extends": [], "isGlobal": true, "isStatic": false, @@ -38,9 +41,11 @@ "containerName": "TestNamespace" }, "type": null, + "declarationLine": "class TestClass", "documentation": null }, "TestNamespace\\TestClass->testProperty": { + "fqn": "TestNamespace\\TestClass->testProperty", "extends": [], "isGlobal": false, "isStatic": false, @@ -55,9 +60,11 @@ }, "type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type": {}, + "declarationLine": "public $testProperty;", "documentation": null }, "TestNamespace\\TestClass->testMethod()": { + "fqn": "TestNamespace\\TestClass->testMethod()", "extends": [], "isGlobal": false, "isStatic": false, @@ -72,6 +79,7 @@ }, "type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type": {}, + "declarationLine": "public function testMethod($testParameter)", "documentation": null } } diff --git a/tests/Validation/cases/constants.php.expected.json b/tests/Validation/cases/constants.php.expected.json index b38fbb8..eef5cdd 100644 --- a/tests/Validation/cases/constants.php.expected.json +++ b/tests/Validation/cases/constants.php.expected.json @@ -9,6 +9,7 @@ }, "definitions": { "MyNamespace": { + "fqn": "MyNamespace", "extends": [], "isGlobal": true, "isStatic": false, @@ -22,9 +23,11 @@ "containerName": "" }, "type": null, + "declarationLine": "namespace MyNamespace;", "documentation": null }, "MyNamespace\\A": { + "fqn": "MyNamespace\\A", "extends": [], "isGlobal": true, "isStatic": false, @@ -38,9 +41,11 @@ "containerName": "MyNamespace" }, "type": null, + "declarationLine": "class A", "documentation": null }, "MyNamespace\\A::suite()": { + "fqn": "MyNamespace\\A::suite()", "extends": [], "isGlobal": false, "isStatic": true, @@ -55,6 +60,7 @@ }, "type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type": {}, + "declarationLine": "public static function suite()", "documentation": null } } diff --git a/tests/Validation/cases/constants2.php.expected.json b/tests/Validation/cases/constants2.php.expected.json index 978d0bf..6ecb2a6 100644 --- a/tests/Validation/cases/constants2.php.expected.json +++ b/tests/Validation/cases/constants2.php.expected.json @@ -9,6 +9,7 @@ }, "definitions": { "MyNamespace": { + "fqn": "MyNamespace", "extends": [], "isGlobal": true, "isStatic": false, @@ -22,9 +23,11 @@ "containerName": "" }, "type": null, + "declarationLine": "namespace MyNamespace;", "documentation": null }, "MyNamespace\\A": { + "fqn": "MyNamespace\\A", "extends": [], "isGlobal": true, "isStatic": false, @@ -38,9 +41,11 @@ "containerName": "MyNamespace" }, "type": null, + "declarationLine": "class A", "documentation": null }, "MyNamespace\\A::suite()": { + "fqn": "MyNamespace\\A::suite()", "extends": [], "isGlobal": false, "isStatic": true, @@ -55,6 +60,7 @@ }, "type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type": {}, + "declarationLine": "public static function suite()", "documentation": null } } diff --git a/tests/Validation/cases/constants3.php.expected.json b/tests/Validation/cases/constants3.php.expected.json index 6f8b700..d49903c 100644 --- a/tests/Validation/cases/constants3.php.expected.json +++ b/tests/Validation/cases/constants3.php.expected.json @@ -9,6 +9,7 @@ }, "definitions": { "MyNamespace": { + "fqn": "MyNamespace", "extends": [], "isGlobal": true, "isStatic": false, @@ -22,9 +23,11 @@ "containerName": "" }, "type": null, + "declarationLine": "namespace MyNamespace;", "documentation": null }, "MyNamespace\\A": { + "fqn": "MyNamespace\\A", "extends": [], "isGlobal": true, "isStatic": false, @@ -38,9 +41,11 @@ "containerName": "MyNamespace" }, "type": null, + "declarationLine": "class A", "documentation": null }, "MyNamespace\\A::suite()": { + "fqn": "MyNamespace\\A::suite()", "extends": [], "isGlobal": false, "isStatic": true, @@ -55,6 +60,7 @@ }, "type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type": {}, + "declarationLine": "public static function suite()", "documentation": null } } diff --git a/tests/Validation/cases/constants4.php.expected.json b/tests/Validation/cases/constants4.php.expected.json index 0d962ef..2c01864 100644 --- a/tests/Validation/cases/constants4.php.expected.json +++ b/tests/Validation/cases/constants4.php.expected.json @@ -9,6 +9,7 @@ }, "definitions": { "MyNamespace": { + "fqn": "MyNamespace", "extends": [], "isGlobal": true, "isStatic": false, @@ -22,9 +23,11 @@ "containerName": "" }, "type": null, + "declarationLine": "namespace MyNamespace;", "documentation": null }, "MyNamespace\\A": { + "fqn": "MyNamespace\\A", "extends": [], "isGlobal": true, "isStatic": false, @@ -38,9 +41,11 @@ "containerName": "MyNamespace" }, "type": null, + "declarationLine": "class A", "documentation": null }, "MyNamespace\\A->suite()": { + "fqn": "MyNamespace\\A->suite()", "extends": [], "isGlobal": false, "isStatic": false, @@ -55,6 +60,7 @@ }, "type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type": {}, + "declarationLine": "public function suite()", "documentation": null } } diff --git a/tests/Validation/cases/constants5.php.expected.json b/tests/Validation/cases/constants5.php.expected.json index d7a1983..a0876b5 100644 --- a/tests/Validation/cases/constants5.php.expected.json +++ b/tests/Validation/cases/constants5.php.expected.json @@ -6,6 +6,7 @@ }, "definitions": { "MyNamespace": { + "fqn": "MyNamespace", "extends": [], "isGlobal": true, "isStatic": false, @@ -19,9 +20,11 @@ "containerName": "" }, "type": null, + "declarationLine": "namespace MyNamespace;", "documentation": null }, "MyNamespace\\Mbstring": { + "fqn": "MyNamespace\\Mbstring", "extends": [], "isGlobal": true, "isStatic": false, @@ -35,9 +38,11 @@ "containerName": "MyNamespace" }, "type": null, + "declarationLine": "class Mbstring", "documentation": null }, "MyNamespace\\Mbstring::MB_CASE_FOLD": { + "fqn": "MyNamespace\\Mbstring::MB_CASE_FOLD", "extends": [], "isGlobal": false, "isStatic": false, @@ -52,6 +57,7 @@ }, "type__class": "phpDocumentor\\Reflection\\Types\\Object_", "type": {}, + "declarationLine": "const MB_CASE_FOLD = PHP_INT_MAX;", "documentation": null } } diff --git a/tests/Validation/cases/constantsInFunctionParamDefault.php.expected.json b/tests/Validation/cases/constantsInFunctionParamDefault.php.expected.json index cb24cfd..98aa7cd 100644 --- a/tests/Validation/cases/constantsInFunctionParamDefault.php.expected.json +++ b/tests/Validation/cases/constantsInFunctionParamDefault.php.expected.json @@ -6,6 +6,7 @@ }, "definitions": { "A": { + "fqn": "A", "extends": [], "isGlobal": true, "isStatic": false, @@ -19,9 +20,11 @@ "containerName": "" }, "type": null, + "declarationLine": "interface A {", "documentation": null }, "A->b()": { + "fqn": "A->b()", "extends": [], "isGlobal": false, "isStatic": false, @@ -36,6 +39,7 @@ }, "type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type": {}, + "declarationLine": "function b ($a = MY_CONSTANT);", "documentation": null } } diff --git a/tests/Validation/cases/docBlocksOnNamespaceDefinition.php.expected.json b/tests/Validation/cases/docBlocksOnNamespaceDefinition.php.expected.json index dbd85f6..d73ecb5 100644 --- a/tests/Validation/cases/docBlocksOnNamespaceDefinition.php.expected.json +++ b/tests/Validation/cases/docBlocksOnNamespaceDefinition.php.expected.json @@ -2,6 +2,7 @@ "references": [], "definitions": { "MyNamespace": { + "fqn": "MyNamespace", "extends": [], "isGlobal": true, "isStatic": false, @@ -15,6 +16,7 @@ "containerName": "" }, "type": null, + "declarationLine": "namespace MyNamespace;", "documentation": null } } diff --git a/tests/Validation/cases/exceptions1.php.expected.json b/tests/Validation/cases/exceptions1.php.expected.json index 4298194..d74deff 100644 --- a/tests/Validation/cases/exceptions1.php.expected.json +++ b/tests/Validation/cases/exceptions1.php.expected.json @@ -2,6 +2,7 @@ "references": [], "definitions": { "MyNamespace": { + "fqn": "MyNamespace", "extends": [], "isGlobal": true, "isStatic": false, @@ -15,6 +16,7 @@ "containerName": "" }, "type": null, + "declarationLine": "namespace MyNamespace;", "documentation": null } } diff --git a/tests/Validation/cases/ifStatement1.php.expected.json b/tests/Validation/cases/ifStatement1.php.expected.json index d412ee1..4375a2a 100644 --- a/tests/Validation/cases/ifStatement1.php.expected.json +++ b/tests/Validation/cases/ifStatement1.php.expected.json @@ -9,6 +9,7 @@ }, "definitions": { "MyNamespace": { + "fqn": "MyNamespace", "extends": [], "isGlobal": true, "isStatic": false, @@ -22,6 +23,7 @@ "containerName": "" }, "type": null, + "declarationLine": "namespace MyNamespace;", "documentation": null } } diff --git a/tests/Validation/cases/interfaceProperty.php.expected.json b/tests/Validation/cases/interfaceProperty.php.expected.json index 955456b..896d09e 100644 --- a/tests/Validation/cases/interfaceProperty.php.expected.json +++ b/tests/Validation/cases/interfaceProperty.php.expected.json @@ -2,6 +2,7 @@ "references": [], "definitions": { "A": { + "fqn": "A", "extends": [], "isGlobal": true, "isStatic": false, @@ -15,6 +16,7 @@ "containerName": "" }, "type": null, + "declarationLine": "interface A {", "documentation": null } } diff --git a/tests/Validation/cases/magicConstantsShouldBeGlobal.php.expected.json b/tests/Validation/cases/magicConstantsShouldBeGlobal.php.expected.json index f40036e..36a2942 100644 --- a/tests/Validation/cases/magicConstantsShouldBeGlobal.php.expected.json +++ b/tests/Validation/cases/magicConstantsShouldBeGlobal.php.expected.json @@ -2,6 +2,7 @@ "references": [], "definitions": { "B": { + "fqn": "B", "extends": [], "isGlobal": true, "isStatic": false, @@ -15,6 +16,7 @@ "containerName": "" }, "type": null, + "declarationLine": "namespace B;", "documentation": null } } diff --git a/tests/Validation/cases/magicConsts.php.expected.json b/tests/Validation/cases/magicConsts.php.expected.json index e9b187f..c017d49 100644 --- a/tests/Validation/cases/magicConsts.php.expected.json +++ b/tests/Validation/cases/magicConsts.php.expected.json @@ -2,6 +2,7 @@ "references": [], "definitions": { "A": { + "fqn": "A", "extends": [], "isGlobal": true, "isStatic": false, @@ -15,9 +16,11 @@ "containerName": "" }, "type": null, + "declarationLine": "class A {", "documentation": null }, "A::$deprecationsTriggered": { + "fqn": "A::$deprecationsTriggered", "extends": [], "isGlobal": false, "isStatic": true, @@ -32,6 +35,7 @@ }, "type__class": "phpDocumentor\\Reflection\\Types\\Array_", "type": {}, + "declarationLine": "private static $deprecationsTriggered;", "documentation": null } } diff --git a/tests/Validation/cases/memberAccess1.php.expected.json b/tests/Validation/cases/memberAccess1.php.expected.json index a8d7ff3..ff4868b 100644 --- a/tests/Validation/cases/memberAccess1.php.expected.json +++ b/tests/Validation/cases/memberAccess1.php.expected.json @@ -9,6 +9,7 @@ }, "definitions": { "MyNamespace": { + "fqn": "MyNamespace", "extends": [], "isGlobal": true, "isStatic": false, @@ -22,9 +23,11 @@ "containerName": "" }, "type": null, + "declarationLine": "namespace MyNamespace;", "documentation": null }, "MyNamespace\\A": { + "fqn": "MyNamespace\\A", "extends": [], "isGlobal": true, "isStatic": false, @@ -38,9 +41,11 @@ "containerName": "MyNamespace" }, "type": null, + "declarationLine": "class A {", "documentation": null }, "MyNamespace\\A::a()": { + "fqn": "MyNamespace\\A::a()", "extends": [], "isGlobal": false, "isStatic": true, @@ -55,6 +60,7 @@ }, "type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type": {}, + "declarationLine": "static function a() {", "documentation": null } } diff --git a/tests/Validation/cases/memberAccess2.php.expected.json b/tests/Validation/cases/memberAccess2.php.expected.json index dd2493b..a6707d0 100644 --- a/tests/Validation/cases/memberAccess2.php.expected.json +++ b/tests/Validation/cases/memberAccess2.php.expected.json @@ -9,6 +9,7 @@ }, "definitions": { "MyNamespace": { + "fqn": "MyNamespace", "extends": [], "isGlobal": true, "isStatic": false, @@ -22,9 +23,11 @@ "containerName": "" }, "type": null, + "declarationLine": "namespace MyNamespace;", "documentation": null }, "MyNamespace\\A": { + "fqn": "MyNamespace\\A", "extends": [], "isGlobal": true, "isStatic": false, @@ -38,9 +41,11 @@ "containerName": "MyNamespace" }, "type": null, + "declarationLine": "class A {", "documentation": null }, "MyNamespace\\A::a()": { + "fqn": "MyNamespace\\A::a()", "extends": [], "isGlobal": false, "isStatic": true, @@ -55,6 +60,7 @@ }, "type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type": {}, + "declarationLine": "static function a() {", "documentation": null } } diff --git a/tests/Validation/cases/memberAccess3.php.expected.json b/tests/Validation/cases/memberAccess3.php.expected.json index 60db5b5..df58d1e 100644 --- a/tests/Validation/cases/memberAccess3.php.expected.json +++ b/tests/Validation/cases/memberAccess3.php.expected.json @@ -24,6 +24,7 @@ }, "definitions": { "MyNamespace": { + "fqn": "MyNamespace", "extends": [], "isGlobal": true, "isStatic": false, @@ -37,9 +38,11 @@ "containerName": "" }, "type": null, + "declarationLine": "namespace MyNamespace;", "documentation": null }, "MyNamespace\\A": { + "fqn": "MyNamespace\\A", "extends": [], "isGlobal": true, "isStatic": false, @@ -53,9 +56,11 @@ "containerName": "MyNamespace" }, "type": null, + "declarationLine": "class A {", "documentation": null }, "MyNamespace\\A::getInitializer()": { + "fqn": "MyNamespace\\A::getInitializer()", "extends": [], "isGlobal": false, "isStatic": true, @@ -70,6 +75,7 @@ }, "type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type": {}, + "declarationLine": "public static function getInitializer(ClassLoader $loader)", "documentation": null } } diff --git a/tests/Validation/cases/memberAccess4.php.expected.json b/tests/Validation/cases/memberAccess4.php.expected.json index 78208ce..1cfabb3 100644 --- a/tests/Validation/cases/memberAccess4.php.expected.json +++ b/tests/Validation/cases/memberAccess4.php.expected.json @@ -15,6 +15,7 @@ }, "definitions": { "MyNamespace": { + "fqn": "MyNamespace", "extends": [], "isGlobal": true, "isStatic": false, @@ -28,9 +29,11 @@ "containerName": "" }, "type": null, + "declarationLine": "namespace MyNamespace;", "documentation": null }, "MyNamespace\\A": { + "fqn": "MyNamespace\\A", "extends": [], "isGlobal": true, "isStatic": false, @@ -44,9 +47,11 @@ "containerName": "MyNamespace" }, "type": null, + "declarationLine": "class A {", "documentation": null }, "MyNamespace\\A->testRequest()": { + "fqn": "MyNamespace\\A->testRequest()", "extends": [], "isGlobal": false, "isStatic": false, @@ -61,6 +66,7 @@ }, "type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type": {}, + "declarationLine": "public function testRequest()", "documentation": null } } diff --git a/tests/Validation/cases/memberAccess5.php.expected.json b/tests/Validation/cases/memberAccess5.php.expected.json index 6e23151..ae2b4ac 100644 --- a/tests/Validation/cases/memberAccess5.php.expected.json +++ b/tests/Validation/cases/memberAccess5.php.expected.json @@ -2,6 +2,7 @@ "references": [], "definitions": { "MyNamespace": { + "fqn": "MyNamespace", "extends": [], "isGlobal": true, "isStatic": false, @@ -15,9 +16,11 @@ "containerName": "" }, "type": null, + "declarationLine": "namespace MyNamespace;", "documentation": null }, "MyNamespace\\ParseErrorsTest": { + "fqn": "MyNamespace\\ParseErrorsTest", "extends": [], "isGlobal": true, "isStatic": false, @@ -31,9 +34,11 @@ "containerName": "MyNamespace" }, "type": null, + "declarationLine": "class ParseErrorsTest {", "documentation": null }, "MyNamespace\\ParseErrorsTest->setUp()": { + "fqn": "MyNamespace\\ParseErrorsTest->setUp()", "extends": [], "isGlobal": false, "isStatic": false, @@ -48,6 +53,7 @@ }, "type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type": {}, + "declarationLine": "public function setUp()", "documentation": null } } diff --git a/tests/Validation/cases/memberCall1.php.expected.json b/tests/Validation/cases/memberCall1.php.expected.json index a94a843..4cf2cd8 100644 --- a/tests/Validation/cases/memberCall1.php.expected.json +++ b/tests/Validation/cases/memberCall1.php.expected.json @@ -12,6 +12,7 @@ }, "definitions": { "MyNamespace": { + "fqn": "MyNamespace", "extends": [], "isGlobal": true, "isStatic": false, @@ -25,9 +26,11 @@ "containerName": "" }, "type": null, + "declarationLine": "namespace MyNamespace;", "documentation": null }, "MyNamespace\\ParseErrorsTest": { + "fqn": "MyNamespace\\ParseErrorsTest", "extends": [], "isGlobal": true, "isStatic": false, @@ -41,9 +44,11 @@ "containerName": "MyNamespace" }, "type": null, + "declarationLine": "class ParseErrorsTest", "documentation": null }, "MyNamespace\\ParseErrorsTest->setAccount()": { + "fqn": "MyNamespace\\ParseErrorsTest->setAccount()", "extends": [], "isGlobal": false, "isStatic": false, @@ -58,6 +63,7 @@ }, "type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type": {}, + "declarationLine": "public function setAccount(AccountInterface $account)", "documentation": null } } diff --git a/tests/Validation/cases/multipleNamespaces.php.expected.json b/tests/Validation/cases/multipleNamespaces.php.expected.json index 5bf8760..2ed59de 100644 --- a/tests/Validation/cases/multipleNamespaces.php.expected.json +++ b/tests/Validation/cases/multipleNamespaces.php.expected.json @@ -15,6 +15,7 @@ }, "definitions": { "MyNamespace1": { + "fqn": "MyNamespace1", "extends": [], "isGlobal": true, "isStatic": false, @@ -28,9 +29,11 @@ "containerName": "" }, "type": null, + "declarationLine": "namespace MyNamespace1;", "documentation": null }, "MyNamespace1\\B": { + "fqn": "MyNamespace1\\B", "extends": [], "isGlobal": true, "isStatic": false, @@ -44,9 +47,11 @@ "containerName": "MyNamespace1" }, "type": null, + "declarationLine": "class B {", "documentation": null }, "MyNamespace1\\B->b()": { + "fqn": "MyNamespace1\\B->b()", "extends": [], "isGlobal": false, "isStatic": false, @@ -61,9 +66,11 @@ }, "type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type": {}, + "declarationLine": "function b() {", "documentation": null }, "MyNamespace2": { + "fqn": "MyNamespace2", "extends": [], "isGlobal": true, "isStatic": false, @@ -77,9 +84,11 @@ "containerName": "" }, "type": null, + "declarationLine": "namespace MyNamespace2;", "documentation": null }, "MyNamespace2\\A": { + "fqn": "MyNamespace2\\A", "extends": [ "MyNamespace2\\MyNamespace1\\B" ], @@ -95,9 +104,11 @@ "containerName": "MyNamespace2" }, "type": null, + "declarationLine": "class A extends MyNamespace1\\B {", "documentation": null }, "MyNamespace2\\A->a()": { + "fqn": "MyNamespace2\\A->a()", "extends": [], "isGlobal": false, "isStatic": false, @@ -112,6 +123,7 @@ }, "type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type": {}, + "declarationLine": "function a () {", "documentation": null } } diff --git a/tests/Validation/cases/multiplePreceedingComments.php.expected.json b/tests/Validation/cases/multiplePreceedingComments.php.expected.json index fe34f9a..ca97671 100644 --- a/tests/Validation/cases/multiplePreceedingComments.php.expected.json +++ b/tests/Validation/cases/multiplePreceedingComments.php.expected.json @@ -2,6 +2,7 @@ "references": [], "definitions": { "Foo": { + "fqn": "Foo", "extends": [], "isGlobal": true, "isStatic": false, @@ -15,9 +16,11 @@ "containerName": "" }, "type": null, + "declarationLine": "class Foo", "documentation": null }, "Foo->fn()": { + "fqn": "Foo->fn()", "extends": [], "isGlobal": false, "isStatic": false, @@ -32,6 +35,7 @@ }, "type__class": "phpDocumentor\\Reflection\\Types\\Object_", "type": {}, + "declarationLine": "public function fn()", "documentation": "Foo" } } diff --git a/tests/Validation/cases/nameToken.php.expected.json b/tests/Validation/cases/nameToken.php.expected.json index 42b9a08..1bd944d 100644 --- a/tests/Validation/cases/nameToken.php.expected.json +++ b/tests/Validation/cases/nameToken.php.expected.json @@ -2,6 +2,7 @@ "references": [], "definitions": { "A": { + "fqn": "A", "extends": [], "isGlobal": true, "isStatic": false, @@ -15,9 +16,11 @@ "containerName": "" }, "type": null, + "declarationLine": "class A {", "documentation": null }, "A->b()": { + "fqn": "A->b()", "extends": [], "isGlobal": false, "isStatic": false, @@ -32,6 +35,7 @@ }, "type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type": {}, + "declarationLine": "function b() {", "documentation": null } } diff --git a/tests/Validation/cases/namespaces2.php.expected.json b/tests/Validation/cases/namespaces2.php.expected.json index d4b4034..903d544 100644 --- a/tests/Validation/cases/namespaces2.php.expected.json +++ b/tests/Validation/cases/namespaces2.php.expected.json @@ -15,6 +15,7 @@ }, "definitions": { "MyNamespace1": { + "fqn": "MyNamespace1", "extends": [], "isGlobal": true, "isStatic": false, @@ -28,6 +29,7 @@ "containerName": "" }, "type": null, + "declarationLine": "namespace MyNamespace1;", "documentation": null } } diff --git a/tests/Validation/cases/namespaces5.php.expected.json b/tests/Validation/cases/namespaces5.php.expected.json index 8c0b27d..ccc22fd 100644 --- a/tests/Validation/cases/namespaces5.php.expected.json +++ b/tests/Validation/cases/namespaces5.php.expected.json @@ -24,6 +24,7 @@ }, "definitions": { "B": { + "fqn": "B", "extends": [], "isGlobal": true, "isStatic": false, @@ -37,6 +38,7 @@ "containerName": "" }, "type": null, + "declarationLine": "namespace B;", "documentation": null } } diff --git a/tests/Validation/cases/namespaces6.php.expected.json b/tests/Validation/cases/namespaces6.php.expected.json index 6a3fa81..874ee7f 100644 --- a/tests/Validation/cases/namespaces6.php.expected.json +++ b/tests/Validation/cases/namespaces6.php.expected.json @@ -2,6 +2,7 @@ "references": [], "definitions": { "A\\B": { + "fqn": "A\\B", "extends": [], "isGlobal": true, "isStatic": false, @@ -15,6 +16,7 @@ "containerName": "A" }, "type": null, + "declarationLine": "namespace A \\ B;", "documentation": null } } diff --git a/tests/Validation/cases/namespaces8.php.expected.json b/tests/Validation/cases/namespaces8.php.expected.json index 20dd6fc..2fbd1fb 100644 --- a/tests/Validation/cases/namespaces8.php.expected.json +++ b/tests/Validation/cases/namespaces8.php.expected.json @@ -6,6 +6,7 @@ }, "definitions": { "LanguageServer\\Tests\\Utils": { + "fqn": "LanguageServer\\Tests\\Utils", "extends": [], "isGlobal": true, "isStatic": false, @@ -19,6 +20,7 @@ "containerName": "LanguageServer\\Tests" }, "type": null, + "declarationLine": "namespace LanguageServer\\Tests\\Utils;", "documentation": null } } diff --git a/tests/Validation/cases/objectCreation.php.expected.json b/tests/Validation/cases/objectCreation.php.expected.json index 2a1cfa7..cea0343 100644 --- a/tests/Validation/cases/objectCreation.php.expected.json +++ b/tests/Validation/cases/objectCreation.php.expected.json @@ -6,6 +6,7 @@ }, "definitions": { "MyNamespace": { + "fqn": "MyNamespace", "extends": [], "isGlobal": true, "isStatic": false, @@ -19,9 +20,11 @@ "containerName": "" }, "type": null, + "declarationLine": "namespace MyNamespace;", "documentation": null }, "MyNamespace\\A": { + "fqn": "MyNamespace\\A", "extends": [], "isGlobal": true, "isStatic": false, @@ -35,9 +38,11 @@ "containerName": "MyNamespace" }, "type": null, + "declarationLine": "class A {", "documentation": null }, "MyNamespace\\A->a()": { + "fqn": "MyNamespace\\A->a()", "extends": [], "isGlobal": false, "isStatic": false, @@ -52,6 +57,7 @@ }, "type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type": {}, + "declarationLine": "function a () {", "documentation": null } } diff --git a/tests/Validation/cases/objectCreation2.php.expected.json b/tests/Validation/cases/objectCreation2.php.expected.json index 3968842..7f856b1 100644 --- a/tests/Validation/cases/objectCreation2.php.expected.json +++ b/tests/Validation/cases/objectCreation2.php.expected.json @@ -9,6 +9,7 @@ }, "definitions": { "MyNamespace": { + "fqn": "MyNamespace", "extends": [], "isGlobal": true, "isStatic": false, @@ -22,9 +23,11 @@ "containerName": "" }, "type": null, + "declarationLine": "namespace MyNamespace;", "documentation": null }, "MyNamespace\\B": { + "fqn": "MyNamespace\\B", "extends": [], "isGlobal": true, "isStatic": false, @@ -38,9 +41,11 @@ "containerName": "MyNamespace" }, "type": null, + "declarationLine": "class B {", "documentation": null }, "MyNamespace\\A": { + "fqn": "MyNamespace\\A", "extends": [], "isGlobal": true, "isStatic": false, @@ -54,9 +59,11 @@ "containerName": "MyNamespace" }, "type": null, + "declarationLine": "class A {", "documentation": null }, "MyNamespace\\A->a()": { + "fqn": "MyNamespace\\A->a()", "extends": [], "isGlobal": false, "isStatic": false, @@ -71,6 +78,7 @@ }, "type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type": {}, + "declarationLine": "function a () {", "documentation": null } } diff --git a/tests/Validation/cases/objectCreation3.php.expected.json b/tests/Validation/cases/objectCreation3.php.expected.json index a411754..c6dcab9 100644 --- a/tests/Validation/cases/objectCreation3.php.expected.json +++ b/tests/Validation/cases/objectCreation3.php.expected.json @@ -6,6 +6,7 @@ }, "definitions": { "A": { + "fqn": "A", "extends": [], "isGlobal": true, "isStatic": false, @@ -19,9 +20,11 @@ "containerName": "" }, "type": null, + "declarationLine": "class A {", "documentation": null }, "A->a()": { + "fqn": "A->a()", "extends": [], "isGlobal": false, "isStatic": false, @@ -36,6 +39,7 @@ }, "type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type": {}, + "declarationLine": "function a () {", "documentation": null } } diff --git a/tests/Validation/cases/param1.php.expected.json b/tests/Validation/cases/param1.php.expected.json index c3f977e..adbe002 100644 --- a/tests/Validation/cases/param1.php.expected.json +++ b/tests/Validation/cases/param1.php.expected.json @@ -6,6 +6,7 @@ }, "definitions": { "MyNamespace": { + "fqn": "MyNamespace", "extends": [], "isGlobal": true, "isStatic": false, @@ -19,9 +20,11 @@ "containerName": "" }, "type": null, + "declarationLine": "namespace MyNamespace;", "documentation": null }, "MyNamespace\\init()": { + "fqn": "MyNamespace\\init()", "extends": [], "isGlobal": true, "isStatic": false, @@ -36,6 +39,7 @@ }, "type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type": {}, + "declarationLine": "function init(Hi $view)", "documentation": null } } diff --git a/tests/Validation/cases/parent1.php.expected.json b/tests/Validation/cases/parent1.php.expected.json index dfe8caa..3391cd4 100644 --- a/tests/Validation/cases/parent1.php.expected.json +++ b/tests/Validation/cases/parent1.php.expected.json @@ -9,6 +9,7 @@ }, "definitions": { "MyNamespace": { + "fqn": "MyNamespace", "extends": [], "isGlobal": true, "isStatic": false, @@ -22,9 +23,11 @@ "containerName": "" }, "type": null, + "declarationLine": "namespace MyNamespace;", "documentation": null }, "MyNamespace\\B": { + "fqn": "MyNamespace\\B", "extends": [], "isGlobal": true, "isStatic": false, @@ -38,9 +41,11 @@ "containerName": "MyNamespace" }, "type": null, + "declarationLine": "class B {", "documentation": null }, "MyNamespace\\B->b()": { + "fqn": "MyNamespace\\B->b()", "extends": [], "isGlobal": false, "isStatic": false, @@ -55,9 +60,11 @@ }, "type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type": {}, + "declarationLine": "function b() {", "documentation": null }, "MyNamespace\\A": { + "fqn": "MyNamespace\\A", "extends": [ "MyNamespace\\B" ], @@ -73,9 +80,11 @@ "containerName": "MyNamespace" }, "type": null, + "declarationLine": "class A extends B {", "documentation": null }, "MyNamespace\\A->a()": { + "fqn": "MyNamespace\\A->a()", "extends": [], "isGlobal": false, "isStatic": false, @@ -90,6 +99,7 @@ }, "type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type": {}, + "declarationLine": "function a () {", "documentation": null } } diff --git a/tests/Validation/cases/parent3.php.expected.json b/tests/Validation/cases/parent3.php.expected.json index 9065e30..2c4915d 100644 --- a/tests/Validation/cases/parent3.php.expected.json +++ b/tests/Validation/cases/parent3.php.expected.json @@ -12,6 +12,7 @@ }, "definitions": { "MyNamespace": { + "fqn": "MyNamespace", "extends": [], "isGlobal": true, "isStatic": false, @@ -25,9 +26,11 @@ "containerName": "" }, "type": null, + "declarationLine": "namespace MyNamespace;", "documentation": null }, "MyNamespace\\B": { + "fqn": "MyNamespace\\B", "extends": [], "isGlobal": true, "isStatic": false, @@ -41,9 +44,11 @@ "containerName": "MyNamespace" }, "type": null, + "declarationLine": "class B {", "documentation": null }, "MyNamespace\\B->b()": { + "fqn": "MyNamespace\\B->b()", "extends": [], "isGlobal": false, "isStatic": false, @@ -58,9 +63,11 @@ }, "type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type": {}, + "declarationLine": "function b() {", "documentation": null }, "MyNamespace\\A": { + "fqn": "MyNamespace\\A", "extends": [ "MyNamespace\\B" ], @@ -76,9 +83,11 @@ "containerName": "MyNamespace" }, "type": null, + "declarationLine": "class A extends B {", "documentation": null }, "MyNamespace\\A->a()": { + "fqn": "MyNamespace\\A->a()", "extends": [], "isGlobal": false, "isStatic": false, @@ -93,6 +102,7 @@ }, "type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type": {}, + "declarationLine": "function a () {", "documentation": null } } diff --git a/tests/Validation/cases/propertyName1.php.expected.json b/tests/Validation/cases/propertyName1.php.expected.json index a79f79c..8032ecc 100644 --- a/tests/Validation/cases/propertyName1.php.expected.json +++ b/tests/Validation/cases/propertyName1.php.expected.json @@ -2,6 +2,7 @@ "references": [], "definitions": { "MyClass": { + "fqn": "MyClass", "extends": [], "isGlobal": true, "isStatic": false, @@ -15,9 +16,11 @@ "containerName": "" }, "type": null, + "declarationLine": "class MyClass", "documentation": null }, "MyClass->mainPropertyName": { + "fqn": "MyClass->mainPropertyName", "extends": [], "isGlobal": false, "isStatic": false, @@ -32,6 +35,7 @@ }, "type__class": "phpDocumentor\\Reflection\\Types\\String_", "type": {}, + "declarationLine": "protected $mainPropertyName;", "documentation": "The name of the main property, or NULL if there is none." } } diff --git a/tests/Validation/cases/propertyName2.php.expected.json b/tests/Validation/cases/propertyName2.php.expected.json index 45c54a7..a70c515 100644 --- a/tests/Validation/cases/propertyName2.php.expected.json +++ b/tests/Validation/cases/propertyName2.php.expected.json @@ -2,6 +2,7 @@ "references": [], "definitions": { "MyClass": { + "fqn": "MyClass", "extends": [], "isGlobal": true, "isStatic": false, @@ -15,9 +16,11 @@ "containerName": "" }, "type": null, + "declarationLine": "class MyClass", "documentation": null }, "MyClass->mainPropertyName": { + "fqn": "MyClass->mainPropertyName", "extends": [], "isGlobal": false, "isStatic": false, @@ -32,6 +35,7 @@ }, "type__class": "phpDocumentor\\Reflection\\Types\\String_", "type": {}, + "declarationLine": "protected $mainPropertyName;", "documentation": "The name of the main property, or NULL if there is none." } } diff --git a/tests/Validation/cases/returnType.php.expected.json b/tests/Validation/cases/returnType.php.expected.json index e131837..9515a6b 100644 --- a/tests/Validation/cases/returnType.php.expected.json +++ b/tests/Validation/cases/returnType.php.expected.json @@ -9,6 +9,7 @@ }, "definitions": { "TestNamespace": { + "fqn": "TestNamespace", "extends": [], "isGlobal": true, "isStatic": false, @@ -22,9 +23,11 @@ "containerName": "" }, "type": null, + "declarationLine": "namespace TestNamespace;", "documentation": null }, "TestNamespace\\whatever()": { + "fqn": "TestNamespace\\whatever()", "extends": [], "isGlobal": true, "isStatic": false, @@ -39,6 +42,7 @@ }, "type__class": "phpDocumentor\\Reflection\\Types\\Object_", "type": {}, + "declarationLine": "function whatever(TestClass $param): TestClass2 {", "documentation": "Aute duis elit reprehenderit tempor cillum proident anim laborum eu laboris reprehenderit ea incididunt." } } diff --git a/tests/Validation/cases/scopedPropertyAccess.php.expected.json b/tests/Validation/cases/scopedPropertyAccess.php.expected.json index 9d3864b..6797a0e 100644 --- a/tests/Validation/cases/scopedPropertyAccess.php.expected.json +++ b/tests/Validation/cases/scopedPropertyAccess.php.expected.json @@ -9,6 +9,7 @@ }, "definitions": { "MyNamespace": { + "fqn": "MyNamespace", "extends": [], "isGlobal": true, "isStatic": false, @@ -22,9 +23,11 @@ "containerName": "" }, "type": null, + "declarationLine": "namespace MyNamespace;", "documentation": null }, "MyNamespace\\A": { + "fqn": "MyNamespace\\A", "extends": [], "isGlobal": true, "isStatic": false, @@ -38,9 +41,11 @@ "containerName": "MyNamespace" }, "type": null, + "declarationLine": "class A {", "documentation": null }, "MyNamespace\\A::a()": { + "fqn": "MyNamespace\\A::a()", "extends": [], "isGlobal": false, "isStatic": true, @@ -55,6 +60,7 @@ }, "type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type": {}, + "declarationLine": "static function a() {", "documentation": null } } diff --git a/tests/Validation/cases/scopedPropertyAccess2.php.expected.json b/tests/Validation/cases/scopedPropertyAccess2.php.expected.json index 9b00951..69ac4c7 100644 --- a/tests/Validation/cases/scopedPropertyAccess2.php.expected.json +++ b/tests/Validation/cases/scopedPropertyAccess2.php.expected.json @@ -6,6 +6,7 @@ }, "definitions": { "MyNamespace": { + "fqn": "MyNamespace", "extends": [], "isGlobal": true, "isStatic": false, @@ -19,6 +20,7 @@ "containerName": "" }, "type": null, + "declarationLine": "namespace MyNamespace;", "documentation": null } } diff --git a/tests/Validation/cases/scopedPropertyAccess3.php.expected.json b/tests/Validation/cases/scopedPropertyAccess3.php.expected.json index 990f381..d29387a 100644 --- a/tests/Validation/cases/scopedPropertyAccess3.php.expected.json +++ b/tests/Validation/cases/scopedPropertyAccess3.php.expected.json @@ -9,6 +9,7 @@ }, "definitions": { "A": { + "fqn": "A", "extends": [], "isGlobal": true, "isStatic": false, @@ -22,9 +23,11 @@ "containerName": "" }, "type": null, + "declarationLine": "class A {", "documentation": null }, "A::$a": { + "fqn": "A::$a", "extends": [], "isGlobal": false, "isStatic": true, @@ -39,6 +42,7 @@ }, "type__class": "phpDocumentor\\Reflection\\Types\\String_", "type": {}, + "declarationLine": "static $a;", "documentation": null } } diff --git a/tests/Validation/cases/scopedPropertyAccess5.php.expected.json b/tests/Validation/cases/scopedPropertyAccess5.php.expected.json index 1f3f3df..ab1e214 100644 --- a/tests/Validation/cases/scopedPropertyAccess5.php.expected.json +++ b/tests/Validation/cases/scopedPropertyAccess5.php.expected.json @@ -15,6 +15,7 @@ }, "definitions": { "TestClass": { + "fqn": "TestClass", "extends": [], "isGlobal": true, "isStatic": false, @@ -28,9 +29,11 @@ "containerName": "" }, "type": null, + "declarationLine": "class TestClass implements TestInterface {", "documentation": null }, "TestClass::$testProperty": { + "fqn": "TestClass::$testProperty", "extends": [], "isGlobal": false, "isStatic": true, @@ -45,6 +48,7 @@ }, "type__class": "phpDocumentor\\Reflection\\Types\\Array_", "type": {}, + "declarationLine": "public static $testProperty;", "documentation": "Lorem excepteur officia sit anim velit veniam enim." } } diff --git a/tests/Validation/cases/self1.php.expected.json b/tests/Validation/cases/self1.php.expected.json index 6d569d3..6531b53 100644 --- a/tests/Validation/cases/self1.php.expected.json +++ b/tests/Validation/cases/self1.php.expected.json @@ -12,6 +12,7 @@ }, "definitions": { "MyNamespace": { + "fqn": "MyNamespace", "extends": [], "isGlobal": true, "isStatic": false, @@ -25,9 +26,11 @@ "containerName": "" }, "type": null, + "declarationLine": "namespace MyNamespace;", "documentation": null }, "MyNamespace\\B": { + "fqn": "MyNamespace\\B", "extends": [], "isGlobal": true, "isStatic": false, @@ -41,9 +44,11 @@ "containerName": "MyNamespace" }, "type": null, + "declarationLine": "class B {", "documentation": null }, "MyNamespace\\B->b()": { + "fqn": "MyNamespace\\B->b()", "extends": [], "isGlobal": false, "isStatic": false, @@ -58,9 +63,11 @@ }, "type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type": {}, + "declarationLine": "function b() {", "documentation": null }, "MyNamespace\\A": { + "fqn": "MyNamespace\\A", "extends": [ "MyNamespace\\B" ], @@ -76,9 +83,11 @@ "containerName": "MyNamespace" }, "type": null, + "declarationLine": "class A extends B {", "documentation": null }, "MyNamespace\\A->a()": { + "fqn": "MyNamespace\\A->a()", "extends": [], "isGlobal": false, "isStatic": false, @@ -93,6 +102,7 @@ }, "type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type": {}, + "declarationLine": "function a () {", "documentation": null } } diff --git a/tests/Validation/cases/self2.php.expected.json b/tests/Validation/cases/self2.php.expected.json index 425e911..8300de2 100644 --- a/tests/Validation/cases/self2.php.expected.json +++ b/tests/Validation/cases/self2.php.expected.json @@ -12,6 +12,7 @@ }, "definitions": { "MyNamespace": { + "fqn": "MyNamespace", "extends": [], "isGlobal": true, "isStatic": false, @@ -25,9 +26,11 @@ "containerName": "" }, "type": null, + "declarationLine": "namespace MyNamespace;", "documentation": null }, "MyNamespace\\B": { + "fqn": "MyNamespace\\B", "extends": [], "isGlobal": true, "isStatic": false, @@ -41,9 +44,11 @@ "containerName": "MyNamespace" }, "type": null, + "declarationLine": "class B {", "documentation": null }, "MyNamespace\\B->b()": { + "fqn": "MyNamespace\\B->b()", "extends": [], "isGlobal": false, "isStatic": false, @@ -58,9 +63,11 @@ }, "type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type": {}, + "declarationLine": "function b() {", "documentation": null }, "MyNamespace\\A": { + "fqn": "MyNamespace\\A", "extends": [ "MyNamespace\\B" ], @@ -76,9 +83,11 @@ "containerName": "MyNamespace" }, "type": null, + "declarationLine": "class A extends B {", "documentation": null }, "MyNamespace\\A->a()": { + "fqn": "MyNamespace\\A->a()", "extends": [], "isGlobal": false, "isStatic": false, @@ -93,6 +102,7 @@ }, "type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type": {}, + "declarationLine": "function a () {", "documentation": null } } diff --git a/tests/Validation/cases/self3.php.expected.json b/tests/Validation/cases/self3.php.expected.json index 764a424..3d5d4ad 100644 --- a/tests/Validation/cases/self3.php.expected.json +++ b/tests/Validation/cases/self3.php.expected.json @@ -12,6 +12,7 @@ }, "definitions": { "MyNamespace": { + "fqn": "MyNamespace", "extends": [], "isGlobal": true, "isStatic": false, @@ -25,9 +26,11 @@ "containerName": "" }, "type": null, + "declarationLine": "namespace MyNamespace;", "documentation": null }, "MyNamespace\\B": { + "fqn": "MyNamespace\\B", "extends": [], "isGlobal": true, "isStatic": false, @@ -41,9 +44,11 @@ "containerName": "MyNamespace" }, "type": null, + "declarationLine": "class B {", "documentation": null }, "MyNamespace\\B->b()": { + "fqn": "MyNamespace\\B->b()", "extends": [], "isGlobal": false, "isStatic": false, @@ -58,9 +63,11 @@ }, "type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type": {}, + "declarationLine": "function b() {", "documentation": null }, "MyNamespace\\A": { + "fqn": "MyNamespace\\A", "extends": [ "MyNamespace\\B" ], @@ -76,9 +83,11 @@ "containerName": "MyNamespace" }, "type": null, + "declarationLine": "class A extends B {", "documentation": null }, "MyNamespace\\A->a()": { + "fqn": "MyNamespace\\A->a()", "extends": [], "isGlobal": false, "isStatic": false, @@ -93,6 +102,7 @@ }, "type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type": {}, + "declarationLine": "function a () {", "documentation": null } } diff --git a/tests/Validation/cases/self4.php.expected.json b/tests/Validation/cases/self4.php.expected.json index c055887..5fac53f 100644 --- a/tests/Validation/cases/self4.php.expected.json +++ b/tests/Validation/cases/self4.php.expected.json @@ -15,6 +15,7 @@ }, "definitions": { "MyNamespace": { + "fqn": "MyNamespace", "extends": [], "isGlobal": true, "isStatic": false, @@ -28,9 +29,11 @@ "containerName": "" }, "type": null, + "declarationLine": "namespace MyNamespace;", "documentation": null }, "MyNamespace\\A": { + "fqn": "MyNamespace\\A", "extends": [], "isGlobal": true, "isStatic": false, @@ -44,9 +47,11 @@ "containerName": "MyNamespace" }, "type": null, + "declarationLine": "class A", "documentation": null }, "MyNamespace\\A::suite()": { + "fqn": "MyNamespace\\A::suite()", "extends": [], "isGlobal": false, "isStatic": true, @@ -61,6 +66,7 @@ }, "type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type": {}, + "declarationLine": "public static function suite()", "documentation": null } } diff --git a/tests/Validation/cases/self5.php.expected.json b/tests/Validation/cases/self5.php.expected.json index 5cf42dd..781cd24 100644 --- a/tests/Validation/cases/self5.php.expected.json +++ b/tests/Validation/cases/self5.php.expected.json @@ -6,6 +6,7 @@ }, "definitions": { "MyNamespace": { + "fqn": "MyNamespace", "extends": [], "isGlobal": true, "isStatic": false, @@ -19,9 +20,11 @@ "containerName": "" }, "type": null, + "declarationLine": "namespace MyNamespace;", "documentation": null }, "MyNamespace\\A": { + "fqn": "MyNamespace\\A", "extends": [], "isGlobal": true, "isStatic": false, @@ -35,9 +38,11 @@ "containerName": "MyNamespace" }, "type": null, + "declarationLine": "class A", "documentation": null }, "MyNamespace\\A->typesProvider()": { + "fqn": "MyNamespace\\A->typesProvider()", "extends": [], "isGlobal": false, "isStatic": false, @@ -52,6 +57,7 @@ }, "type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type": {}, + "declarationLine": "public function typesProvider()", "documentation": null } } diff --git a/tests/Validation/cases/static1.php.expected.json b/tests/Validation/cases/static1.php.expected.json index 14a117a..b0323b2 100644 --- a/tests/Validation/cases/static1.php.expected.json +++ b/tests/Validation/cases/static1.php.expected.json @@ -12,6 +12,7 @@ }, "definitions": { "MyNamespace": { + "fqn": "MyNamespace", "extends": [], "isGlobal": true, "isStatic": false, @@ -25,9 +26,11 @@ "containerName": "" }, "type": null, + "declarationLine": "namespace MyNamespace;", "documentation": null }, "MyNamespace\\B": { + "fqn": "MyNamespace\\B", "extends": [], "isGlobal": true, "isStatic": false, @@ -41,9 +44,11 @@ "containerName": "MyNamespace" }, "type": null, + "declarationLine": "class B {", "documentation": null }, "MyNamespace\\B->b()": { + "fqn": "MyNamespace\\B->b()", "extends": [], "isGlobal": false, "isStatic": false, @@ -58,9 +63,11 @@ }, "type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type": {}, + "declarationLine": "function b() {", "documentation": null }, "MyNamespace\\A": { + "fqn": "MyNamespace\\A", "extends": [ "MyNamespace\\B" ], @@ -76,9 +83,11 @@ "containerName": "MyNamespace" }, "type": null, + "declarationLine": "class A extends B {", "documentation": null }, "MyNamespace\\A->a()": { + "fqn": "MyNamespace\\A->a()", "extends": [], "isGlobal": false, "isStatic": false, @@ -93,6 +102,7 @@ }, "type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type": {}, + "declarationLine": "function a () {", "documentation": null } } diff --git a/tests/Validation/cases/static2.php.expected.json b/tests/Validation/cases/static2.php.expected.json index cc8d400..c8d81fb 100644 --- a/tests/Validation/cases/static2.php.expected.json +++ b/tests/Validation/cases/static2.php.expected.json @@ -12,6 +12,7 @@ }, "definitions": { "MyNamespace": { + "fqn": "MyNamespace", "extends": [], "isGlobal": true, "isStatic": false, @@ -25,9 +26,11 @@ "containerName": "" }, "type": null, + "declarationLine": "namespace MyNamespace;", "documentation": null }, "MyNamespace\\B": { + "fqn": "MyNamespace\\B", "extends": [], "isGlobal": true, "isStatic": false, @@ -41,9 +44,11 @@ "containerName": "MyNamespace" }, "type": null, + "declarationLine": "class B {", "documentation": null }, "MyNamespace\\B->b()": { + "fqn": "MyNamespace\\B->b()", "extends": [], "isGlobal": false, "isStatic": false, @@ -58,9 +63,11 @@ }, "type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type": {}, + "declarationLine": "function b() {", "documentation": null }, "MyNamespace\\A": { + "fqn": "MyNamespace\\A", "extends": [ "MyNamespace\\B" ], @@ -76,9 +83,11 @@ "containerName": "MyNamespace" }, "type": null, + "declarationLine": "class A extends B {", "documentation": null }, "MyNamespace\\A->a()": { + "fqn": "MyNamespace\\A->a()", "extends": [], "isGlobal": false, "isStatic": false, @@ -93,6 +102,7 @@ }, "type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type": {}, + "declarationLine": "function a () {", "documentation": null } } diff --git a/tests/Validation/cases/static3.php.expected.json b/tests/Validation/cases/static3.php.expected.json index c70f6a2..bb556bf 100644 --- a/tests/Validation/cases/static3.php.expected.json +++ b/tests/Validation/cases/static3.php.expected.json @@ -12,6 +12,7 @@ }, "definitions": { "MyNamespace": { + "fqn": "MyNamespace", "extends": [], "isGlobal": true, "isStatic": false, @@ -25,9 +26,11 @@ "containerName": "" }, "type": null, + "declarationLine": "namespace MyNamespace;", "documentation": null }, "MyNamespace\\B": { + "fqn": "MyNamespace\\B", "extends": [], "isGlobal": true, "isStatic": false, @@ -41,9 +44,11 @@ "containerName": "MyNamespace" }, "type": null, + "declarationLine": "class B {", "documentation": null }, "MyNamespace\\B->b()": { + "fqn": "MyNamespace\\B->b()", "extends": [], "isGlobal": false, "isStatic": false, @@ -58,9 +63,11 @@ }, "type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type": {}, + "declarationLine": "function b() {", "documentation": null }, "MyNamespace\\A": { + "fqn": "MyNamespace\\A", "extends": [ "MyNamespace\\B" ], @@ -76,9 +83,11 @@ "containerName": "MyNamespace" }, "type": null, + "declarationLine": "class A extends B {", "documentation": null }, "MyNamespace\\A->a()": { + "fqn": "MyNamespace\\A->a()", "extends": [], "isGlobal": false, "isStatic": false, @@ -93,6 +102,7 @@ }, "type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type": {}, + "declarationLine": "function a () {", "documentation": null } } diff --git a/tests/Validation/cases/static4.php.expected.json b/tests/Validation/cases/static4.php.expected.json index 6ca8f97..6a28028 100644 --- a/tests/Validation/cases/static4.php.expected.json +++ b/tests/Validation/cases/static4.php.expected.json @@ -9,6 +9,7 @@ }, "definitions": { "MyNamespace": { + "fqn": "MyNamespace", "extends": [], "isGlobal": true, "isStatic": false, @@ -22,9 +23,11 @@ "containerName": "" }, "type": null, + "declarationLine": "namespace MyNamespace;", "documentation": null }, "MyNamespace\\A": { + "fqn": "MyNamespace\\A", "extends": [ "MyNamespace\\B" ], @@ -40,9 +43,11 @@ "containerName": "MyNamespace" }, "type": null, + "declarationLine": "class A extends B {", "documentation": null }, "MyNamespace\\A->a()": { + "fqn": "MyNamespace\\A->a()", "extends": [], "isGlobal": false, "isStatic": false, @@ -57,6 +62,7 @@ }, "type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type": {}, + "declarationLine": "function a () {", "documentation": null } } diff --git a/tests/Validation/cases/stringVariable.php.expected.json b/tests/Validation/cases/stringVariable.php.expected.json index 569bdc9..5ac910b 100644 --- a/tests/Validation/cases/stringVariable.php.expected.json +++ b/tests/Validation/cases/stringVariable.php.expected.json @@ -2,6 +2,7 @@ "references": [], "definitions": { "B": { + "fqn": "B", "extends": [], "isGlobal": true, "isStatic": false, @@ -15,9 +16,11 @@ "containerName": "" }, "type": null, + "declarationLine": "class B", "documentation": null }, "B->hi": { + "fqn": "B->hi", "extends": [], "isGlobal": false, "isStatic": false, @@ -32,9 +35,11 @@ }, "type__class": "phpDocumentor\\Reflection\\Types\\Integer", "type": {}, + "declarationLine": "public $hi;", "documentation": null }, "B->a()": { + "fqn": "B->a()", "extends": [], "isGlobal": false, "isStatic": false, @@ -49,6 +54,7 @@ }, "type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type": {}, + "declarationLine": "function a () {", "documentation": null } } diff --git a/tests/Validation/cases/testQualifiedNameOutsideOfNamespace.php.expected.json b/tests/Validation/cases/testQualifiedNameOutsideOfNamespace.php.expected.json index 0c7a37c..1f71b37 100644 --- a/tests/Validation/cases/testQualifiedNameOutsideOfNamespace.php.expected.json +++ b/tests/Validation/cases/testQualifiedNameOutsideOfNamespace.php.expected.json @@ -6,6 +6,7 @@ }, "definitions": { "SomeNamespace": { + "fqn": "SomeNamespace", "extends": [], "isGlobal": true, "isStatic": false, @@ -19,6 +20,7 @@ "containerName": "" }, "type": null, + "declarationLine": "namespace SomeNamespace { }", "documentation": null } } diff --git a/tests/Validation/cases/verifyFqsenOnClassProperty.php.expected.json b/tests/Validation/cases/verifyFqsenOnClassProperty.php.expected.json index 1fefbf7..f072722 100644 --- a/tests/Validation/cases/verifyFqsenOnClassProperty.php.expected.json +++ b/tests/Validation/cases/verifyFqsenOnClassProperty.php.expected.json @@ -9,6 +9,7 @@ }, "definitions": { "Foo": { + "fqn": "Foo", "extends": [], "isGlobal": true, "isStatic": false, @@ -22,9 +23,11 @@ "containerName": "" }, "type": null, + "declarationLine": "class Foo {", "documentation": null }, "Foo->bar": { + "fqn": "Foo->bar", "extends": [], "isGlobal": false, "isStatic": false, @@ -39,9 +42,11 @@ }, "type__class": "phpDocumentor\\Reflection\\Types\\Object_", "type": {}, + "declarationLine": "protected $bar;", "documentation": null }, "Foo->foo()": { + "fqn": "Foo->foo()", "extends": [], "isGlobal": false, "isStatic": false, @@ -56,6 +61,7 @@ }, "type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type": {}, + "declarationLine": "public function foo () {", "documentation": null } }