1
0
Fork 0
pull/416/head
jens1o 2017-06-17 11:24:40 +02:00
commit 8404b5de73
81 changed files with 779 additions and 223 deletions

View File

@ -38,7 +38,7 @@
"sabre/uri": "^2.0", "sabre/uri": "^2.0",
"jetbrains/phpstorm-stubs": "dev-master", "jetbrains/phpstorm-stubs": "dev-master",
"composer/composer": "^1.3", "composer/composer": "^1.3",
"Microsoft/tolerant-php-parser": "^0.0.2" "Microsoft/tolerant-php-parser": "^0.0.3"
}, },
"minimum-stability": "dev", "minimum-stability": "dev",
"prefer-stable": true, "prefer-stable": true,

View File

@ -0,0 +1,11 @@
<?php
namespace MyNamespace;
class SomeClass
{
public function someMethod()
{
tes
}
}

View File

@ -0,0 +1,11 @@
<?php
class FooClass {
public function foo(): FooClass {
return $this;
}
}
$fc = new FooClass();
$foo = $fc->foo();
$foo->

View File

@ -0,0 +1,12 @@
<?php
class FooClass {
public static function staticFoo(): FooClass {
return new FooClass();
}
public function bar() { }
}
$foo = FooClass::staticFoo();
$foo->

View File

@ -105,3 +105,15 @@ class ChildClass extends TestClass {}
define('TEST_DEFINE_CONSTANT', false); define('TEST_DEFINE_CONSTANT', false);
print TEST_DEFINE_CONSTANT ? 'true' : 'false'; print TEST_DEFINE_CONSTANT ? 'true' : 'false';
/**
* Neither this class nor its members are referenced anywhere
*/
class UnusedClass
{
public $unusedProperty;
public function unusedMethod()
{
}
}

View File

@ -7,5 +7,7 @@
<exclude name="PSR2.Namespaces.UseDeclaration.MultipleDeclarations"/> <exclude name="PSR2.Namespaces.UseDeclaration.MultipleDeclarations"/>
<exclude name="PSR2.ControlStructures.ElseIfDeclaration.NotAllowed"/> <exclude name="PSR2.ControlStructures.ElseIfDeclaration.NotAllowed"/>
<exclude name="PSR2.ControlStructures.ControlStructureSpacing.SpacingAfterOpenBrace"/> <exclude name="PSR2.ControlStructures.ControlStructureSpacing.SpacingAfterOpenBrace"/>
<exclude name="Squiz.WhiteSpace.ControlStructureSpacing.SpacingBeforeClose"/>
<exclude name="Squiz.WhiteSpace.ControlStructureSpacing.SpacingAfterOpen"/>
</rule> </rule>
</ruleset> </ruleset>

View File

@ -49,6 +49,7 @@ class CompletionProvider
'eval', 'eval',
'exit', 'exit',
'extends', 'extends',
'false',
'final', 'final',
'finally', 'finally',
'for', 'for',
@ -67,6 +68,7 @@ class CompletionProvider
'list', 'list',
'namespace', 'namespace',
'new', 'new',
'null',
'or', 'or',
'print', 'print',
'private', 'private',
@ -79,6 +81,7 @@ class CompletionProvider
'switch', 'switch',
'throw', 'throw',
'trait', 'trait',
'true',
'try', 'try',
'unset', 'unset',
'use', 'use',
@ -125,6 +128,7 @@ class CompletionProvider
// This can be made much more performant if the tree follows specific invariants. // This can be made much more performant if the tree follows specific invariants.
$node = $doc->getNodeAtPosition($pos); $node = $doc->getNodeAtPosition($pos);
// Get the node at the position under the cursor
$offset = $node === null ? -1 : $pos->toOffset($node->getFileContents()); $offset = $node === null ? -1 : $pos->toOffset($node->getFileContents());
if ( if (
$node !== null $node !== null
@ -145,22 +149,31 @@ class CompletionProvider
$node = $node->parent; $node = $node->parent;
} }
// Inspect the type of expression under the cursor
if ($node === null || $node instanceof Node\Statement\InlineHtml || $pos == new Position(0, 0)) { if ($node === null || $node instanceof Node\Statement\InlineHtml || $pos == new Position(0, 0)) {
// HTML, beginning of file
// Inside HTML and at the beginning of the file, propose <?php
$item = new CompletionItem('<?php', CompletionItemKind::KEYWORD); $item = new CompletionItem('<?php', CompletionItemKind::KEYWORD);
$item->textEdit = new TextEdit( $item->textEdit = new TextEdit(
new Range($pos, $pos), new Range($pos, $pos),
stripStringOverlap($doc->getRange(new Range(new Position(0, 0), $pos)), '<?php') stripStringOverlap($doc->getRange(new Range(new Position(0, 0), $pos)), '<?php')
); );
$list->items[] = $item; $list->items[] = $item;
} /*
VARIABLES */ } elseif (
elseif ( $node instanceof Node\Expression\Variable
$node instanceof Node\Expression\Variable && && !(
!( $node->parent instanceof Node\Expression\ScopedPropertyAccessExpression
$node->parent instanceof Node\Expression\ScopedPropertyAccessExpression && && $node->parent->memberName === $node
$node->parent->memberName === $node) )
) { ) {
// Variables
//
// $|
// $a|
// Find variables, parameters and use statements in the scope // Find variables, parameters and use statements in the scope
$namePrefix = $node->getName() ?? ''; $namePrefix = $node->getName() ?? '';
foreach ($this->suggestVariablesAtNode($node, $namePrefix) as $var) { foreach ($this->suggestVariablesAtNode($node, $namePrefix) as $var) {
@ -175,23 +188,28 @@ class CompletionProvider
); );
$list->items[] = $item; $list->items[] = $item;
} }
} /*
MEMBER ACCESS EXPRESSIONS } elseif ($node instanceof Node\Expression\MemberAccessExpression) {
$a->c# // Member access expressions
$a-># */ //
elseif ($node instanceof Node\Expression\MemberAccessExpression) { // $a->c|
// $a->|
// Multiple prefixes for all possible types
$prefixes = FqnUtilities\getFqnsFromType( $prefixes = FqnUtilities\getFqnsFromType(
$this->definitionResolver->resolveExpressionNodeToType($node->dereferencableExpression) $this->definitionResolver->resolveExpressionNodeToType($node->dereferencableExpression)
); );
// Include parent classes
$prefixes = $this->expandParentFqns($prefixes); $prefixes = $this->expandParentFqns($prefixes);
// Add the object access operator to only get members
foreach ($prefixes as &$prefix) { foreach ($prefixes as &$prefix) {
$prefix .= '->'; $prefix .= '->';
} }
unset($prefix); unset($prefix);
// Collect all definitions that match any of the prefixes
foreach ($this->index->getDefinitions() as $fqn => $def) { foreach ($this->index->getDefinitions() as $fqn => $def) {
foreach ($prefixes as $prefix) { foreach ($prefixes as $prefix) {
if (substr($fqn, 0, strlen($prefix)) === $prefix && !$def->isGlobal) { if (substr($fqn, 0, strlen($prefix)) === $prefix && !$def->isGlobal) {
@ -199,30 +217,35 @@ class CompletionProvider
} }
} }
} }
} /*
SCOPED PROPERTY ACCESS EXPRESSIONS } elseif (
A\B\C::$a#
A\B\C::#
A\B\C::$#
A\B\C::foo#
TODO: $a::# */
elseif (
($scoped = $node->parent) instanceof Node\Expression\ScopedPropertyAccessExpression || ($scoped = $node->parent) instanceof Node\Expression\ScopedPropertyAccessExpression ||
($scoped = $node) instanceof Node\Expression\ScopedPropertyAccessExpression ($scoped = $node) instanceof Node\Expression\ScopedPropertyAccessExpression
) { ) {
// Static class members and constants
//
// A\B\C::$a|
// A\B\C::|
// A\B\C::$|
// A\B\C::foo|
//
// TODO: $a::|
// Resolve all possible types to FQNs
$prefixes = FqnUtilities\getFqnsFromType( $prefixes = FqnUtilities\getFqnsFromType(
$classType = $this->definitionResolver->resolveExpressionNodeToType($scoped->scopeResolutionQualifier) $classType = $this->definitionResolver->resolveExpressionNodeToType($scoped->scopeResolutionQualifier)
); );
// Add parent classes
$prefixes = $this->expandParentFqns($prefixes); $prefixes = $this->expandParentFqns($prefixes);
// Append :: operator to only get static members
foreach ($prefixes as &$prefix) { foreach ($prefixes as &$prefix) {
$prefix .= '::'; $prefix .= '::';
} }
unset($prefix); unset($prefix);
// Collect all definitions that match any of the prefixes
foreach ($this->index->getDefinitions() as $fqn => $def) { foreach ($this->index->getDefinitions() as $fqn => $def) {
foreach ($prefixes as $prefix) { foreach ($prefixes as $prefix) {
if (substr(strtolower($fqn), 0, strlen($prefix)) === strtolower($prefix) && !$def->isGlobal) { if (substr(strtolower($fqn), 0, strlen($prefix)) === strtolower($prefix) && !$def->isGlobal) {
@ -230,82 +253,123 @@ class CompletionProvider
} }
} }
} }
} elseif (ParserHelpers\isConstantFetch($node) ||
($creation = $node->parent) instanceof Node\Expression\ObjectCreationExpression ||
(($creation = $node) instanceof Node\Expression\ObjectCreationExpression)) {
$class = isset($creation) ? $creation->classTypeDesignator : $node;
$prefix = $class instanceof Node\QualifiedName } elseif (
? (string)PhpParser\ResolvedName::buildName($class->nameParts, $class->getFileContents()) ParserHelpers\isConstantFetch($node)
: $class->getText($node->getFileContents()); // Creation gets set in case of an instantiation (`new` expression)
|| ($creation = $node->parent) instanceof Node\Expression\ObjectCreationExpression
|| (($creation = $node) instanceof Node\Expression\ObjectCreationExpression)
) {
// Class instantiations, function calls, constant fetches, class names
//
// new MyCl|
// my_func|
// MY_CONS|
// MyCla|
$namespaceDefinition = $node->getNamespaceDefinition(); // The name Node under the cursor
$nameNode = isset($creation) ? $creation->classTypeDesignator : $node;
list($namespaceImportTable,,) = $node->getImportTablesForCurrentScope(); /** The typed name */
foreach ($namespaceImportTable as $alias => $name) { $prefix = $nameNode instanceof Node\QualifiedName
$namespaceImportTable[$alias] = (string)$name; ? (string)PhpParser\ResolvedName::buildName($nameNode->nameParts, $nameNode->getFileContents())
: $nameNode->getText($node->getFileContents());
$prefixLen = strlen($prefix);
/** Whether the prefix is qualified (contains at least one backslash) */
$isQualified = $nameNode instanceof Node\QualifiedName && $nameNode->isQualifiedName();
/** Whether the prefix is fully qualified (begins with a backslash) */
$isFullyQualified = $nameNode instanceof Node\QualifiedName && $nameNode->isFullyQualifiedName();
/** The closest NamespaceDefinition Node */
$namespaceNode = $node->getNamespaceDefinition();
/** @var string The name of the namespace */
$namespacedPrefix = null;
if ($namespaceNode) {
$namespacedPrefix = (string)PhpParser\ResolvedName::buildName($namespaceNode->name->nameParts, $node->getFileContents()) . '\\' . $prefix;
$namespacedPrefixLen = strlen($namespacedPrefix);
} }
// Get the namespace use statements
// TODO: use function statements, use const statements
/** @var string[] $aliases A map from local alias to fully qualified name */
list($aliases,,) = $node->getImportTablesForCurrentScope();
foreach ($aliases as $alias => $name) {
$aliases[$alias] = (string)$name;
}
// If there is a prefix that does not start with a slash, suggest `use`d symbols
if ($prefix && !$isFullyQualified) {
foreach ($aliases as $alias => $fqn) {
// Suggest symbols that have been `use`d and match the prefix
if (substr($alias, 0, $prefixLen) === $prefix && ($def = $this->index->getDefinition($fqn))) {
$list->items[] = CompletionItem::fromDefinition($def);
}
}
}
// Suggest global symbols that either
// - start with the current namespace + prefix, if the Name node is not fully qualified
// - start with just the prefix, if the Name node is fully qualified
foreach ($this->index->getDefinitions() as $fqn => $def) { foreach ($this->index->getDefinitions() as $fqn => $def) {
$fqnStartsWithPrefix = substr($fqn, 0, strlen($prefix)) === $prefix;
$fqnContainsPrefix = empty($prefix) || strpos($fqn, $prefix) !== false;
if (($def->canBeInstantiated || ($def->isGlobal && !isset($creation))) && $fqnContainsPrefix) {
if ($namespaceDefinition !== null && $namespaceDefinition->name !== null) {
$namespacePrefix = (string)PhpParser\ResolvedName::buildName($namespaceDefinition->name->nameParts, $node->getFileContents());
$isAliased = false; $fqnStartsWithPrefix = substr($fqn, 0, $prefixLen) === $prefix;
$isNotFullyQualified = !($class instanceof Node\QualifiedName) || !$class->isFullyQualifiedName();
if ($isNotFullyQualified) {
foreach ($namespaceImportTable as $alias => $name) {
if (substr($fqn, 0, strlen($name)) === $name) {
$fqn = $alias;
$isAliased = true;
break;
}
}
}
$prefixWithNamespace = $namespacePrefix . "\\" . $prefix;
$fqnMatchesPrefixWithNamespace = substr($fqn, 0, strlen($prefixWithNamespace)) === $prefixWithNamespace;
$isFullyQualifiedAndPrefixMatches = !$isNotFullyQualified && ($fqnStartsWithPrefix || $fqnMatchesPrefixWithNamespace);
if (!$isFullyQualifiedAndPrefixMatches && !$isAliased) {
if (!array_search($fqn, array_values($namespaceImportTable))) {
if (empty($prefix)) {
$fqn = '\\' . $fqn;
} elseif ($fqnMatchesPrefixWithNamespace) {
$fqn = substr($fqn, strlen($namespacePrefix) + 1);
} else {
continue;
}
} else {
continue;
}
}
} elseif ($fqnStartsWithPrefix && $class instanceof Node\QualifiedName && $class->isFullyQualifiedName()) {
$fqn = '\\' . $fqn;
}
if (
// Exclude methods, properties etc.
$def->isGlobal
&& (
!$prefix
|| (
// Either not qualified, but a matching prefix with global fallback
($def->roamed && !$isQualified && $fqnStartsWithPrefix)
// Or not in a namespace or a fully qualified name or AND matching the prefix
|| ((!$namespaceNode || $isFullyQualified) && $fqnStartsWithPrefix)
// Or in a namespace, not fully qualified and matching the prefix + current namespace
|| (
$namespaceNode
&& !$isFullyQualified
&& substr($fqn, 0, $namespacedPrefixLen) === $namespacedPrefix
)
)
)
// Only suggest classes for `new`
&& (!isset($creation) || $def->canBeInstantiated)
) {
$item = CompletionItem::fromDefinition($def); $item = CompletionItem::fromDefinition($def);
// Find the shortest name to reference the symbol
if ($namespaceNode && ($alias = array_search($fqn, $aliases, true)) !== false) {
// $alias is the name under which this definition is aliased in the current namespace
$item->insertText = $alias;
} else if ($namespaceNode && !($prefix && $isFullyQualified)) {
// Insert the global FQN with leading backslash
$item->insertText = '\\' . $fqn;
} else {
// Insert the FQN without leading backlash
$item->insertText = $fqn; $item->insertText = $fqn;
}
// Don't insert the parenthesis for functions
// TODO return a snippet and put the cursor inside
if (substr($item->insertText, -2) === '()') {
$item->insertText = substr($item->insertText, 0, -2);
}
$list->items[] = $item; $list->items[] = $item;
} }
} }
// If not a class instantiation, also suggest keywords
if (!isset($creation)) { if (!isset($creation)) {
foreach (self::KEYWORDS as $keyword) { foreach (self::KEYWORDS as $keyword) {
if (substr($keyword, 0, $prefixLen) === $prefix) {
$item = new CompletionItem($keyword, CompletionItemKind::KEYWORD); $item = new CompletionItem($keyword, CompletionItemKind::KEYWORD);
$item->insertText = $keyword . ' '; $item->insertText = $keyword;
$list->items[] = $item; $list->items[] = $item;
} }
} }
} elseif (ParserHelpers\isConstantFetch($node)) {
$prefix = (string) ($node->getResolvedName() ?? PhpParser\ResolvedName::buildName($node->nameParts, $node->getFileContents()));
foreach (self::KEYWORDS as $keyword) {
$item = new CompletionItem($keyword, CompletionItemKind::KEYWORD);
$item->insertText = $keyword . ' ';
$list->items[] = $item;
} }
} }

View File

@ -44,6 +44,13 @@ class Definition
*/ */
public $isGlobal; public $isGlobal;
/**
* True if this definition is affected by global namespace fallback (global function or global constant)
*
* @var bool
*/
public $roamed;
/** /**
* False for instance methods and properties * False for instance methods and properties
* *

View File

@ -54,7 +54,7 @@ class DefinitionResolver
{ {
// If node is part of a declaration list, build a declaration line that discludes other elements in the list // If node is part of a declaration list, build a declaration line that discludes other elements in the list
// - [PropertyDeclaration] // public $a, [$b = 3], $c; => public $b = 3; // - [PropertyDeclaration] // public $a, [$b = 3], $c; => public $b = 3;
// - [ConstDeclaration | ClassConstDeclaration] // "const A = 3, [B = 4];" => "const B = 4;" // - [ConstDeclaration|ClassConstDeclaration] // "const A = 3, [B = 4];" => "const B = 4;"
if ( if (
($declaration = ParserHelpers\tryGetPropertyDeclaration($node)) && ($elements = $declaration->propertyElements) || ($declaration = ParserHelpers\tryGetPropertyDeclaration($node)) && ($elements = $declaration->propertyElements) ||
($declaration = ParserHelpers\tryGetConstOrClassConstDeclaration($node)) && ($elements = $declaration->constElements) ($declaration = ParserHelpers\tryGetConstOrClassConstDeclaration($node)) && ($elements = $declaration->constElements)
@ -131,7 +131,7 @@ class DefinitionResolver
* Gets Doc Block with resolved names for a Node * Gets Doc Block with resolved names for a Node
* *
* @param Node $node * @param Node $node
* @return DocBlock | null * @return DocBlock|null
*/ */
private function getDocBlock(Node $node) private function getDocBlock(Node $node)
{ {
@ -193,6 +193,16 @@ class DefinitionResolver
($node instanceof Node\ConstElement && $node->parent->parent instanceof Node\Statement\ConstDeclaration) ($node instanceof Node\ConstElement && $node->parent->parent instanceof Node\Statement\ConstDeclaration)
); );
// Definition is affected by global namespace fallback if it is a global constant or a global function
$def->roamed = (
$fqn !== null
&& strpos($fqn, '\\') === false
&& (
($node instanceof Node\ConstElement && $node->parent->parent instanceof Node\Statement\ConstDeclaration)
|| $node instanceof Node\Statement\FunctionDeclaration
)
);
// Static methods and static property declarations // Static methods and static property declarations
$def->isStatic = ( $def->isStatic = (
($node instanceof Node\MethodDeclaration && $node->isStatic()) || ($node instanceof Node\MethodDeclaration && $node->isStatic()) ||
@ -482,8 +492,8 @@ class DefinitionResolver
/** /**
* Returns the assignment or parameter node where a variable was defined * Returns the assignment or parameter node where a variable was defined
* *
* @param Node\Expression\Variable | Node\Expression\ClosureUse $var The variable access * @param Node\Expression\Variable|Node\Expression\ClosureUse $var The variable access
* @return Node\Expression\Assign | Node\Expression\AssignOp|Node\Param | Node\Expression\ClosureUse|null * @return Node\Expression\Assign|Node\Expression\AssignOp|Node\Param|Node\Expression\ClosureUse|null
*/ */
public function resolveVariableToNode($var) public function resolveVariableToNode($var)
{ {
@ -633,6 +643,16 @@ class DefinitionResolver
} }
} }
// MEMBER CALL EXPRESSION/SCOPED PROPERTY CALL EXPRESSION
// The type of the member/scoped property call expression is the type of the method, so resolve the
// type of the callable expression.
if ($expr instanceof Node\Expression\CallExpression && (
$expr->callableExpression instanceof Node\Expression\MemberAccessExpression ||
$expr->callableExpression instanceof Node\Expression\ScopedPropertyAccessExpression)
) {
return $this->resolveExpressionNodeToType($expr->callableExpression);
}
// MEMBER ACCESS EXPRESSION // MEMBER ACCESS EXPRESSION
if ($expr instanceof Node\Expression\MemberAccessExpression) { if ($expr instanceof Node\Expression\MemberAccessExpression) {
if ($expr->memberName instanceof Node\Expression) { if ($expr->memberName instanceof Node\Expression) {
@ -894,7 +914,7 @@ class DefinitionResolver
* Takes any class name node (from a static method call, or new node) and returns a Type object * Takes any class name node (from a static method call, or new node) and returns a Type object
* Resolves keywords like self, static and parent * Resolves keywords like self, static and parent
* *
* @param Node | PhpParser\Token $class * @param Node|PhpParser\Token $class
* @return Type * @return Type
*/ */
public function resolveClassNameToType($class): Type public function resolveClassNameToType($class): Type
@ -906,11 +926,12 @@ class DefinitionResolver
// Anonymous class // Anonymous class
return new Types\Object_; return new Types\Object_;
} }
$className = (string)$class->getResolvedName(); if ($class instanceof PhpParser\Token && $class->kind === PhpParser\TokenKind::StaticKeyword) {
// `new static`
if ($className === 'static') {
return new Types\Static_; return new Types\Static_;
} }
$className = (string)$class->getResolvedName();
if ($className === 'self' || $className === 'parent') { if ($className === 'self' || $className === 'parent') {
$classNode = $class->getFirstAncestor(Node\Statement\ClassDeclaration::class); $classNode = $class->getFirstAncestor(Node\Statement\ClassDeclaration::class);
if ($className === 'parent') { if ($className === 'parent') {
@ -1190,9 +1211,9 @@ class DefinitionResolver
} }
/** /**
* @param DocBlock | null $docBlock * @param DocBlock|null $docBlock
* @param string | null $variableName * @param string|null $variableName
* @return DocBlock\Tags\Param | null * @return DocBlock\Tags\Param|null
*/ */
private function tryGetDocBlockTagForParameter($docBlock, $variableName) private function tryGetDocBlockTagForParameter($docBlock, $variableName)
{ {

View File

@ -22,7 +22,11 @@ class FileSystemFilesFinder implements FilesFinder
return coroutine(function () use ($glob) { return coroutine(function () use ($glob) {
$uris = []; $uris = [];
foreach (new GlobIterator($glob) as $path) { foreach (new GlobIterator($glob) as $path) {
// Exclude any directories that also match the glob pattern
if (!is_dir($path)) {
$uris[] = pathToUri($path); $uris[] = pathToUri($path);
}
yield timeout(); yield timeout();
} }
return $uris; return $uris;

View File

@ -77,7 +77,7 @@ function isBooleanExpression($expression) : bool
/** /**
* Tries to get the parent property declaration given a Node * Tries to get the parent property declaration given a Node
* @param Node $node * @param Node $node
* @return Node\PropertyDeclaration | null $node * @return Node\PropertyDeclaration|null $node
*/ */
function tryGetPropertyDeclaration(Node $node) function tryGetPropertyDeclaration(Node $node)
{ {
@ -93,7 +93,7 @@ function tryGetPropertyDeclaration(Node $node)
/** /**
* Tries to get the parent ConstDeclaration or ClassConstDeclaration given a Node * Tries to get the parent ConstDeclaration or ClassConstDeclaration given a Node
* @param Node $node * @param Node $node
* @return Node\Statement\ConstDeclaration | Node\ClassConstDeclaration | null $node * @return Node\Statement\ConstDeclaration|Node\ClassConstDeclaration|null $node
*/ */
function tryGetConstOrClassConstDeclaration(Node $node) function tryGetConstOrClassConstDeclaration(Node $node)
{ {

View File

@ -46,19 +46,12 @@ class PhpDocument
*/ */
private $uri; private $uri;
/**
* The content of the document
*
* @var string
*/
private $content;
/** /**
* The AST of the document * The AST of the document
* *
* @var Node * @var Node\SourceFileNode
*/ */
private $stmts; private $sourceFileNode;
/** /**
* Map from fully qualified name (FQN) to Definition * Map from fully qualified name (FQN) to Definition
@ -133,8 +126,6 @@ class PhpDocument
*/ */
public function updateContent(string $content) public function updateContent(string $content)
{ {
$this->content = $content;
// Unregister old definitions // Unregister old definitions
if (isset($this->definitions)) { if (isset($this->definitions)) {
foreach ($this->definitions as $fqn => $definition) { foreach ($this->definitions as $fqn => $definition) {
@ -172,7 +163,7 @@ class PhpDocument
$this->index->addReferenceUri($fqn, $this->uri); $this->index->addReferenceUri($fqn, $this->uri);
} }
$this->stmts = $treeAnalyzer->getStmts(); $this->sourceFileNode = $treeAnalyzer->getSourceFileNode();
} }
/** /**
@ -182,10 +173,10 @@ class PhpDocument
*/ */
public function getFormattedText() public function getFormattedText()
{ {
if (empty($this->content)) { if (empty($this->getContent())) {
return []; return [];
} }
return Formatter::format($this->content, $this->uri); return Formatter::format($this->getContent(), $this->uri);
} }
/** /**
@ -195,7 +186,7 @@ class PhpDocument
*/ */
public function getContent() public function getContent()
{ {
return $this->content; return $this->sourceFileNode->fileContents;
} }
/** /**
@ -221,11 +212,11 @@ class PhpDocument
/** /**
* Returns the AST of the document * Returns the AST of the document
* *
* @return Node | null * @return Node\SourceFileNode|null
*/ */
public function getStmts() public function getSourceFileNode()
{ {
return $this->stmts; return $this->sourceFileNode;
} }
/** /**
@ -236,12 +227,12 @@ class PhpDocument
*/ */
public function getNodeAtPosition(Position $position) public function getNodeAtPosition(Position $position)
{ {
if ($this->stmts === null) { if ($this->sourceFileNode === null) {
return null; return null;
} }
$offset = $position->toOffset($this->stmts->getFileContents()); $offset = $position->toOffset($this->sourceFileNode->getFileContents());
$node = $this->stmts->getDescendantNodeAtPosition($offset); $node = $this->sourceFileNode->getDescendantNodeAtPosition($offset);
if ($node !== null && $node->getStart() > $offset) { if ($node !== null && $node->getStart() > $offset) {
return null; return null;
} }
@ -256,12 +247,10 @@ class PhpDocument
*/ */
public function getRange(Range $range) public function getRange(Range $range)
{ {
if ($this->content === null) { $content = $this->getContent();
return null; $start = $range->start->toOffset($content);
} $length = $range->end->toOffset($content) - $start;
$start = $range->start->toOffset($this->content); return substr($content, $start, $length);
$length = $range->end->toOffset($this->content) - $start;
return substr($this->content, $start, $length);
} }
/** /**

View File

@ -15,8 +15,8 @@ class TreeAnalyzer
/** @var PhpParser\Parser */ /** @var PhpParser\Parser */
private $parser; private $parser;
/** @var Node */ /** @var Node\SourceFileNode */
private $stmts; private $sourceFileNode;
/** @var Diagnostic[] */ /** @var Diagnostic[] */
private $diagnostics; private $diagnostics;
@ -45,18 +45,17 @@ class TreeAnalyzer
$this->parser = $parser; $this->parser = $parser;
$this->docBlockFactory = $docBlockFactory; $this->docBlockFactory = $docBlockFactory;
$this->definitionResolver = $definitionResolver; $this->definitionResolver = $definitionResolver;
$this->content = $content; $this->sourceFileNode = $this->parser->parseSourceFile($content, $uri);
$this->stmts = $this->parser->parseSourceFile($content, $uri);
// TODO - docblock errors // TODO - docblock errors
$this->collectDefinitionsAndReferences($this->stmts); $this->collectDefinitionsAndReferences($this->sourceFileNode);
} }
private function collectDefinitionsAndReferences(Node $stmts) private function collectDefinitionsAndReferences(Node $sourceFileNode)
{ {
foreach ($stmts::CHILD_NAMES as $name) { foreach ($sourceFileNode::CHILD_NAMES as $name) {
$node = $stmts->$name; $node = $sourceFileNode->$name;
if ($node === null) { if ($node === null) {
continue; continue;
@ -76,7 +75,7 @@ class TreeAnalyzer
} }
if (($error = PhpParser\DiagnosticsProvider::checkDiagnostics($node)) !== null) { if (($error = PhpParser\DiagnosticsProvider::checkDiagnostics($node)) !== null) {
$range = PhpParser\PositionUtilities::getRangeFromPosition($error->start, $error->length, $this->content); $range = PhpParser\PositionUtilities::getRangeFromPosition($error->start, $error->length, $this->sourceFileNode->fileContents);
$this->diagnostics[] = new Diagnostic( $this->diagnostics[] = new Diagnostic(
$error->message, $error->message,
@ -200,10 +199,10 @@ class TreeAnalyzer
} }
/** /**
* @return Node[] * @return Node\SourceFileNode
*/ */
public function getStmts() public function getSourceFileNode()
{ {
return $this->stmts; return $this->sourceFileNode;
} }
} }

View File

@ -14,11 +14,11 @@ class DefinitionResolverTest extends TestCase
{ {
$parser = new PhpParser\Parser; $parser = new PhpParser\Parser;
$doc = new MockPhpDocument; $doc = new MockPhpDocument;
$stmts = $parser->parseSourceFile("<?php\ndefine('TEST_DEFINE', true);", $doc->getUri()); $sourceFileNode = $parser->parseSourceFile("<?php\ndefine('TEST_DEFINE', true);", $doc->getUri());
$index = new Index; $index = new Index;
$definitionResolver = new DefinitionResolver($index); $definitionResolver = new DefinitionResolver($index);
$def = $definitionResolver->createDefinitionFromNode($stmts->statementList[1]->expression, '\TEST_DEFINE'); $def = $definitionResolver->createDefinitionFromNode($sourceFileNode->statementList[1]->expression, '\TEST_DEFINE');
$this->assertInstanceOf(\phpDocumentor\Reflection\Types\Boolean::class, $def->type); $this->assertInstanceOf(\phpDocumentor\Reflection\Types\Boolean::class, $def->type);
} }
@ -27,11 +27,11 @@ class DefinitionResolverTest extends TestCase
{ {
$parser = new PhpParser\Parser; $parser = new PhpParser\Parser;
$doc = new MockPhpDocument; $doc = new MockPhpDocument;
$stmts = $parser->parseSourceFile("<?php\ndefine('TEST_DEFINE', true);", $doc->getUri()); $sourceFileNode = $parser->parseSourceFile("<?php\ndefine('TEST_DEFINE', true);", $doc->getUri());
$index = new Index; $index = new Index;
$definitionResolver = new DefinitionResolver($index); $definitionResolver = new DefinitionResolver($index);
$type = $definitionResolver->getTypeFromNode($stmts->statementList[1]->expression); $type = $definitionResolver->getTypeFromNode($sourceFileNode->statementList[1]->expression);
$this->assertInstanceOf(\phpDocumentor\Reflection\Types\Boolean::class, $type); $this->assertInstanceOf(\phpDocumentor\Reflection\Types\Boolean::class, $type);
} }
@ -41,11 +41,11 @@ class DefinitionResolverTest extends TestCase
// define('XXX') (only one argument) must not introduce a new symbol // define('XXX') (only one argument) must not introduce a new symbol
$parser = new PhpParser\Parser; $parser = new PhpParser\Parser;
$doc = new MockPhpDocument; $doc = new MockPhpDocument;
$stmts = $parser->parseSourceFile("<?php\ndefine('TEST_DEFINE');", $doc->getUri()); $sourceFileNode = $parser->parseSourceFile("<?php\ndefine('TEST_DEFINE');", $doc->getUri());
$index = new Index; $index = new Index;
$definitionResolver = new DefinitionResolver($index); $definitionResolver = new DefinitionResolver($index);
$fqn = $definitionResolver->getDefinedFqn($stmts->statementList[1]->expression); $fqn = $definitionResolver->getDefinedFqn($sourceFileNode->statementList[1]->expression);
$this->assertNull($fqn); $this->assertNull($fqn);
} }
@ -54,11 +54,11 @@ class DefinitionResolverTest extends TestCase
{ {
$parser = new PhpParser\Parser; $parser = new PhpParser\Parser;
$doc = new MockPhpDocument; $doc = new MockPhpDocument;
$stmts = $parser->parseSourceFile("<?php\ndefine('TEST_DEFINE', true);", $doc->getUri()); $sourceFileNode = $parser->parseSourceFile("<?php\ndefine('TEST_DEFINE', true);", $doc->getUri());
$index = new Index; $index = new Index;
$definitionResolver = new DefinitionResolver($index); $definitionResolver = new DefinitionResolver($index);
$fqn = $definitionResolver->getDefinedFqn($stmts->statementList[1]->expression); $fqn = $definitionResolver->getDefinedFqn($sourceFileNode->statementList[1]->expression);
$this->assertEquals('TEST_DEFINE', $fqn); $this->assertEquals('TEST_DEFINE', $fqn);
} }

View File

@ -57,7 +57,7 @@ class LanguageServerTest extends TestCase
if ($msg->body->method === 'window/logMessage' && $promise->state === Promise::PENDING) { if ($msg->body->method === 'window/logMessage' && $promise->state === Promise::PENDING) {
if ($msg->body->params->type === MessageType::ERROR) { if ($msg->body->params->type === MessageType::ERROR) {
$promise->reject(new Exception($msg->body->params->message)); $promise->reject(new Exception($msg->body->params->message));
} else if (strpos($msg->body->params->message, 'All 27 PHP files parsed') !== false) { } else if (preg_match('/All \d+ PHP files parsed/', $msg->body->params->message)) {
$promise->fulfill(); $promise->fulfill();
} }
} }
@ -103,7 +103,7 @@ class LanguageServerTest extends TestCase
if ($promise->state === Promise::PENDING) { if ($promise->state === Promise::PENDING) {
$promise->reject(new Exception($msg->body->params->message)); $promise->reject(new Exception($msg->body->params->message));
} }
} else if (strpos($msg->body->params->message, 'All 27 PHP files parsed') !== false) { } else if (preg_match('/All \d+ PHP files parsed/', $msg->body->params->message)) {
$promise->fulfill(); $promise->fulfill();
} }
} }

View File

@ -85,6 +85,9 @@ abstract class ServerTestCase extends TestCase
'TestClass::staticTestMethod()' => new Location($globalSymbolsUri, new Range(new Position(46, 4), new Position(49, 5))), 'TestClass::staticTestMethod()' => new Location($globalSymbolsUri, new Range(new Position(46, 4), new Position(49, 5))),
'TestClass::testMethod()' => new Location($globalSymbolsUri, new Range(new Position(57, 4), new Position(60, 5))), 'TestClass::testMethod()' => new Location($globalSymbolsUri, new Range(new Position(57, 4), new Position(60, 5))),
'test_function()' => new Location($globalSymbolsUri, new Range(new Position(78, 0), new Position(81, 1))), 'test_function()' => new Location($globalSymbolsUri, new Range(new Position(78, 0), new Position(81, 1))),
'UnusedClass' => new Location($globalSymbolsUri, new Range(new Position(111, 0), new Position(118, 1))),
'UnusedClass::unusedProperty' => new Location($globalSymbolsUri, new Range(new Position(113,11), new Position(113, 26))),
'UnusedClass::unusedMethod' => new Location($globalSymbolsUri, new Range(new Position(115, 4), new Position(117, 5))),
'whatever()' => new Location($globalReferencesUri, new Range(new Position(21, 0), new Position(23, 1))), 'whatever()' => new Location($globalReferencesUri, new Range(new Position(21, 0), new Position(23, 1))),
// Namespaced // Namespaced

View File

@ -69,6 +69,27 @@ class CompletionTest extends TestCase
], true), $items); ], true), $items);
} }
public function testGlobalFunctionInsideNamespaceAndClass()
{
$completionUri = pathToUri(__DIR__ . '/../../../fixtures/completion/inside_namespace_and_method.php');
$this->loader->open($completionUri, file_get_contents($completionUri));
$items = $this->textDocument->completion(
new TextDocumentIdentifier($completionUri),
new Position(8, 11)
)->wait();
$this->assertCompletionsListSubset(new CompletionList([
new CompletionItem(
'test_function',
CompletionItemKind::FUNCTION,
'void', // Return type
'Officia aliquip adipisicing et nulla et laboris dolore labore.',
null,
null,
'\test_function'
)
], true), $items);
}
public function testPropertyAndMethodWithoutPrefix() public function testPropertyAndMethodWithoutPrefix()
{ {
$completionUri = pathToUri(__DIR__ . '/../../../fixtures/completion/property.php'); $completionUri = pathToUri(__DIR__ . '/../../../fixtures/completion/property.php');
@ -234,10 +255,7 @@ class CompletionTest extends TestCase
'laboris commodo ad commodo velit mollit qui non officia id. Nulla duis veniam' . "\n" . 'laboris commodo ad commodo velit mollit qui non officia id. Nulla duis veniam' . "\n" .
'veniam officia deserunt et non dolore mollit ea quis eiusmod sit non. Occaecat' . "\n" . 'veniam officia deserunt et non dolore mollit ea quis eiusmod sit non. Occaecat' . "\n" .
'consequat sunt culpa exercitation pariatur id reprehenderit nisi incididunt Lorem' . "\n" . 'consequat sunt culpa exercitation pariatur id reprehenderit nisi incididunt Lorem' . "\n" .
'sint. Officia culpa pariatur laborum nostrud cupidatat consequat mollit.', 'sint. Officia culpa pariatur laborum nostrud cupidatat consequat mollit.'
null,
null,
'TestClass'
) )
], true), $items); ], true), $items);
} }
@ -397,8 +415,8 @@ class CompletionTest extends TestCase
new Position(2, 1) new Position(2, 1)
)->wait(); )->wait();
$this->assertCompletionsListSubset(new CompletionList([ $this->assertCompletionsListSubset(new CompletionList([
new CompletionItem('class', CompletionItemKind::KEYWORD, null, null, null, null, 'class '), new CompletionItem('class', CompletionItemKind::KEYWORD, null, null, null, null, 'class'),
new CompletionItem('clone', CompletionItemKind::KEYWORD, null, null, null, null, 'clone ') new CompletionItem('clone', CompletionItemKind::KEYWORD, null, null, null, null, 'clone')
], true), $items); ], true), $items);
} }
@ -499,6 +517,50 @@ class CompletionTest extends TestCase
], true), $items); ], true), $items);
} }
public function testMethodReturnType()
{
$completionUri = pathToUri(__DIR__ . '/../../../fixtures/completion/method_return_type.php');
$this->loader->open($completionUri, file_get_contents($completionUri));
$items = $this->textDocument->completion(
new TextDocumentIdentifier($completionUri),
new Position(10, 6)
)->wait();
$this->assertCompletionsListSubset(new CompletionList([
new CompletionItem(
'foo',
CompletionItemKind::METHOD,
'\FooClass',
null,
null,
null,
null,
null
)
], true), $items);
}
public function testStaticMethodReturnType()
{
$completionUri = pathToUri(__DIR__ . '/../../../fixtures/completion/static_method_return_type.php');
$this->loader->open($completionUri, file_get_contents($completionUri));
$items = $this->textDocument->completion(
new TextDocumentIdentifier($completionUri),
new Position(11, 6)
)->wait();
$this->assertCompletionsListSubset(new CompletionList([
new CompletionItem(
'bar',
CompletionItemKind::METHOD,
'mixed',
null,
null,
null,
null,
null
)
], true), $items);
}
private function assertCompletionsListSubset(CompletionList $subsetList, CompletionList $list) private function assertCompletionsListSubset(CompletionList $subsetList, CompletionList $list)
{ {
foreach ($subsetList->items as $expectedItem) { foreach ($subsetList->items as $expectedItem) {

View File

@ -159,4 +159,43 @@ class GlobalTest extends ServerTestCase
)->wait(); )->wait();
$this->assertEquals($this->getReferenceLocations('TestClass'), $result); $this->assertEquals($this->getReferenceLocations('TestClass'), $result);
} }
public function testReferencesForUnusedClass()
{
// class UnusedClass
// Get references for UnusedClass
$symbolsUri = pathToUri(realpath(__DIR__ . '/../../../../fixtures/global_symbols.php'));
$result = $this->textDocument->references(
new ReferenceContext,
new TextDocumentIdentifier($symbolsUri),
new Position(111, 10)
)->wait();
$this->assertEquals([], $result);
}
public function testReferencesForUnusedProperty()
{
// public $unusedProperty
// Get references for unusedProperty
$symbolsUri = pathToUri(realpath(__DIR__ . '/../../../../fixtures/global_symbols.php'));
$result = $this->textDocument->references(
new ReferenceContext,
new TextDocumentIdentifier($symbolsUri),
new Position(113, 18)
)->wait();
$this->assertEquals([], $result);
}
public function testReferencesForUnusedMethod()
{
// public function unusedMethod()
// Get references for unusedMethod
$symbolsUri = pathToUri(realpath(__DIR__ . '/../../../../fixtures/global_symbols.php'));
$result = $this->textDocument->references(
new ReferenceContext,
new TextDocumentIdentifier($symbolsUri),
new Position(115, 26)
)->wait();
$this->assertEquals([], $result);
}
} }

View File

@ -27,6 +27,7 @@ class SymbolTest extends ServerTestCase
// Request symbols // Request symbols
$result = $this->workspace->symbol('')->wait(); $result = $this->workspace->symbol('')->wait();
$referencesUri = pathToUri(realpath(__DIR__ . '/../../../fixtures/references.php')); $referencesUri = pathToUri(realpath(__DIR__ . '/../../../fixtures/references.php'));
// @codingStandardsIgnoreStart // @codingStandardsIgnoreStart
$this->assertEquals([ $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))), ''),
@ -59,9 +60,12 @@ class SymbolTest extends ServerTestCase
new SymbolInformation('test_function', SymbolKind::FUNCTION, $this->getDefinitionLocation('test_function()'), ''), new SymbolInformation('test_function', SymbolKind::FUNCTION, $this->getDefinitionLocation('test_function()'), ''),
new SymbolInformation('ChildClass', SymbolKind::CLASS_, $this->getDefinitionLocation('ChildClass'), ''), new SymbolInformation('ChildClass', SymbolKind::CLASS_, $this->getDefinitionLocation('ChildClass'), ''),
new SymbolInformation('TEST_DEFINE_CONSTANT', SymbolKind::CONSTANT, $this->getDefinitionLocation('TEST_DEFINE_CONSTANT'), ''), new SymbolInformation('TEST_DEFINE_CONSTANT', SymbolKind::CONSTANT, $this->getDefinitionLocation('TEST_DEFINE_CONSTANT'), ''),
new SymbolInformation('UnusedClass', SymbolKind::CLASS_, $this->getDefinitionLocation('UnusedClass'), ''),
new SymbolInformation('unusedProperty', SymbolKind::PROPERTY, $this->getDefinitionLocation('UnusedClass::unusedProperty'), 'UnusedClass'),
new SymbolInformation('unusedMethod', SymbolKind::METHOD, $this->getDefinitionLocation('UnusedClass::unusedMethod'), 'UnusedClass'),
new SymbolInformation('whatever', SymbolKind::FUNCTION, $this->getDefinitionLocation('whatever()'), ''), new SymbolInformation('whatever', SymbolKind::FUNCTION, $this->getDefinitionLocation('whatever()'), ''),
new SymbolInformation('SecondTestNamespace', SymbolKind::NAMESPACE, $this->getDefinitionLocation('SecondTestNamespace'), '') new SymbolInformation('SecondTestNamespace', SymbolKind::NAMESPACE, $this->getDefinitionLocation('SecondTestNamespace'), ''),
], $result); ], $result);
// @codingStandardsIgnoreEnd // @codingStandardsIgnoreEnd
} }

View File

@ -64,12 +64,7 @@ class ValidationTest extends TestCase
try { try {
$this->assertEquals($expectedValues['definitions'], $actualValues['definitions']); $this->assertEquals($expectedValues['definitions'], $actualValues['definitions']);
try {
$this->assertArraySubset((array)$expectedValues['references'], (array)$actualValues['references'], false, 'references don\'t match.');
} catch (\Throwable $e) {
$this->assertEquals((array)$expectedValues['references'], (array)$actualValues['references'], 'references don\'t match.'); $this->assertEquals((array)$expectedValues['references'], (array)$actualValues['references'], 'references don\'t match.');
}
} catch (\Throwable $e) { } catch (\Throwable $e) {
$outputFile = getExpectedValuesFile($testCaseFile); $outputFile = getExpectedValuesFile($testCaseFile);
file_put_contents($outputFile, json_encode($actualValues, JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES)); file_put_contents($outputFile, json_encode($actualValues, JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES));
@ -137,8 +132,7 @@ class ValidationTest extends TestCase
} elseif ($propertyName === 'extends') { } elseif ($propertyName === 'extends') {
$definition->$propertyName = $definition->$propertyName ?? []; $definition->$propertyName = $definition->$propertyName ?? [];
} elseif ($propertyName === 'type' && $definition->type !== null) { } elseif ($propertyName === 'type' && $definition->type !== null) {
// Class info is not captured by json_encode. It's important for 'type'. $defsForAssert[$fqn]['type__tostring'] = (string)$definition->type;
$defsForAssert[$fqn]['type__class'] = get_class($definition->type);
} }
$defsForAssert[$fqn][$propertyName] = $definition->$propertyName; $defsForAssert[$fqn][$propertyName] = $definition->$propertyName;

View File

@ -6,6 +6,12 @@
"self": [ "self": [
"./WithReturnTypehints.php" "./WithReturnTypehints.php"
], ],
"Fixtures\\Prophecy\\__CLASS__": [
"./WithReturnTypehints.php"
],
"__CLASS__": [
"./WithReturnTypehints.php"
],
"parent": [ "parent": [
"./WithReturnTypehints.php" "./WithReturnTypehints.php"
] ]
@ -15,6 +21,7 @@
"fqn": "Fixtures\\Prophecy", "fqn": "Fixtures\\Prophecy",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -35,6 +42,7 @@
"Fixtures\\Prophecy\\EmptyClass" "Fixtures\\Prophecy\\EmptyClass"
], ],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": true, "canBeInstantiated": true,
"symbolInformation": { "symbolInformation": {
@ -53,6 +61,7 @@
"fqn": "Fixtures\\Prophecy\\WithReturnTypehints->getSelf()", "fqn": "Fixtures\\Prophecy\\WithReturnTypehints->getSelf()",
"extends": [], "extends": [],
"isGlobal": false, "isGlobal": false,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -63,7 +72,7 @@
}, },
"containerName": "Fixtures\\Prophecy\\WithReturnTypehints" "containerName": "Fixtures\\Prophecy\\WithReturnTypehints"
}, },
"type__class": "phpDocumentor\\Reflection\\Types\\Object_", "type__tostring": "\\self",
"type": {}, "type": {},
"declarationLine": "public function getSelf(): self {", "declarationLine": "public function getSelf(): self {",
"documentation": null "documentation": null
@ -72,6 +81,7 @@
"fqn": "Fixtures\\Prophecy\\WithReturnTypehints->getName()", "fqn": "Fixtures\\Prophecy\\WithReturnTypehints->getName()",
"extends": [], "extends": [],
"isGlobal": false, "isGlobal": false,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -82,7 +92,7 @@
}, },
"containerName": "Fixtures\\Prophecy\\WithReturnTypehints" "containerName": "Fixtures\\Prophecy\\WithReturnTypehints"
}, },
"type__class": "phpDocumentor\\Reflection\\Types\\String_", "type__tostring": "string",
"type": {}, "type": {},
"declarationLine": "public function getName(): string {", "declarationLine": "public function getName(): string {",
"documentation": null "documentation": null
@ -91,6 +101,7 @@
"fqn": "Fixtures\\Prophecy\\WithReturnTypehints->getParent()", "fqn": "Fixtures\\Prophecy\\WithReturnTypehints->getParent()",
"extends": [], "extends": [],
"isGlobal": false, "isGlobal": false,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -101,7 +112,7 @@
}, },
"containerName": "Fixtures\\Prophecy\\WithReturnTypehints" "containerName": "Fixtures\\Prophecy\\WithReturnTypehints"
}, },
"type__class": "phpDocumentor\\Reflection\\Types\\Object_", "type__tostring": "\\parent",
"type": {}, "type": {},
"declarationLine": "public function getParent(): parent {", "declarationLine": "public function getParent(): parent {",
"documentation": null "documentation": null

View File

@ -5,6 +5,7 @@
"fqn": "MyNamespace", "fqn": "MyNamespace",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {

View File

@ -5,6 +5,7 @@
"fqn": "A", "fqn": "A",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": true, "canBeInstantiated": true,
"symbolInformation": { "symbolInformation": {
@ -23,6 +24,7 @@
"fqn": "A->foo", "fqn": "A->foo",
"extends": [], "extends": [],
"isGlobal": false, "isGlobal": false,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -33,7 +35,7 @@
}, },
"containerName": "A" "containerName": "A"
}, },
"type__class": "phpDocumentor\\Reflection\\Types\\Array_", "type__tostring": "string[]",
"type": {}, "type": {},
"declarationLine": "protected $foo;", "declarationLine": "protected $foo;",
"documentation": null "documentation": null

View File

@ -12,6 +12,7 @@
"fqn": "MyNamespace", "fqn": "MyNamespace",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {

View File

@ -12,6 +12,7 @@
"fqn": "TestNamespace", "fqn": "TestNamespace",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -30,6 +31,7 @@
"fqn": "TestNamespace\\A", "fqn": "TestNamespace\\A",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": true, "canBeInstantiated": true,
"symbolInformation": { "symbolInformation": {
@ -48,6 +50,7 @@
"fqn": "TestNamespace\\A->a", "fqn": "TestNamespace\\A->a",
"extends": [], "extends": [],
"isGlobal": false, "isGlobal": false,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -58,7 +61,7 @@
}, },
"containerName": "TestNamespace\\A" "containerName": "TestNamespace\\A"
}, },
"type__class": "phpDocumentor\\Reflection\\Types\\Integer", "type__tostring": "int",
"type": {}, "type": {},
"declarationLine": "public $a;", "declarationLine": "public $a;",
"documentation": null "documentation": null

View File

@ -12,6 +12,7 @@
"fqn": "TestNamespace", "fqn": "TestNamespace",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -30,6 +31,7 @@
"fqn": "TestNamespace\\TestClass", "fqn": "TestNamespace\\TestClass",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": true, "canBeInstantiated": true,
"symbolInformation": { "symbolInformation": {
@ -48,6 +50,7 @@
"fqn": "TestNamespace\\TestClass->testProperty", "fqn": "TestNamespace\\TestClass->testProperty",
"extends": [], "extends": [],
"isGlobal": false, "isGlobal": false,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -58,7 +61,7 @@
}, },
"containerName": "TestNamespace\\TestClass" "containerName": "TestNamespace\\TestClass"
}, },
"type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type__tostring": "mixed",
"type": {}, "type": {},
"declarationLine": "public $testProperty;", "declarationLine": "public $testProperty;",
"documentation": null "documentation": null
@ -67,6 +70,7 @@
"fqn": "TestNamespace\\TestClass->testMethod()", "fqn": "TestNamespace\\TestClass->testMethod()",
"extends": [], "extends": [],
"isGlobal": false, "isGlobal": false,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -77,7 +81,7 @@
}, },
"containerName": "TestNamespace\\TestClass" "containerName": "TestNamespace\\TestClass"
}, },
"type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type__tostring": "mixed",
"type": {}, "type": {},
"declarationLine": "public function testMethod($testParameter)", "declarationLine": "public function testMethod($testParameter)",
"documentation": null "documentation": null

View File

@ -12,6 +12,7 @@
"fqn": "MyNamespace", "fqn": "MyNamespace",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -30,6 +31,7 @@
"fqn": "MyNamespace\\A", "fqn": "MyNamespace\\A",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": true, "canBeInstantiated": true,
"symbolInformation": { "symbolInformation": {
@ -48,6 +50,7 @@
"fqn": "MyNamespace\\A::suite()", "fqn": "MyNamespace\\A::suite()",
"extends": [], "extends": [],
"isGlobal": false, "isGlobal": false,
"roamed": false,
"isStatic": true, "isStatic": true,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -58,7 +61,7 @@
}, },
"containerName": "MyNamespace\\A" "containerName": "MyNamespace\\A"
}, },
"type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type__tostring": "mixed",
"type": {}, "type": {},
"declarationLine": "public static function suite()", "declarationLine": "public static function suite()",
"documentation": null "documentation": null

View File

@ -12,6 +12,7 @@
"fqn": "MyNamespace", "fqn": "MyNamespace",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -30,6 +31,7 @@
"fqn": "MyNamespace\\A", "fqn": "MyNamespace\\A",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": true, "canBeInstantiated": true,
"symbolInformation": { "symbolInformation": {
@ -48,6 +50,7 @@
"fqn": "MyNamespace\\A::suite()", "fqn": "MyNamespace\\A::suite()",
"extends": [], "extends": [],
"isGlobal": false, "isGlobal": false,
"roamed": false,
"isStatic": true, "isStatic": true,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -58,7 +61,7 @@
}, },
"containerName": "MyNamespace\\A" "containerName": "MyNamespace\\A"
}, },
"type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type__tostring": "mixed",
"type": {}, "type": {},
"declarationLine": "public static function suite()", "declarationLine": "public static function suite()",
"documentation": null "documentation": null

View File

@ -12,6 +12,7 @@
"fqn": "MyNamespace", "fqn": "MyNamespace",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -30,6 +31,7 @@
"fqn": "MyNamespace\\A", "fqn": "MyNamespace\\A",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": true, "canBeInstantiated": true,
"symbolInformation": { "symbolInformation": {
@ -48,6 +50,7 @@
"fqn": "MyNamespace\\A::suite()", "fqn": "MyNamespace\\A::suite()",
"extends": [], "extends": [],
"isGlobal": false, "isGlobal": false,
"roamed": false,
"isStatic": true, "isStatic": true,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -58,7 +61,7 @@
}, },
"containerName": "MyNamespace\\A" "containerName": "MyNamespace\\A"
}, },
"type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type__tostring": "mixed",
"type": {}, "type": {},
"declarationLine": "public static function suite()", "declarationLine": "public static function suite()",
"documentation": null "documentation": null

View File

@ -12,6 +12,7 @@
"fqn": "MyNamespace", "fqn": "MyNamespace",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -30,6 +31,7 @@
"fqn": "MyNamespace\\A", "fqn": "MyNamespace\\A",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": true, "canBeInstantiated": true,
"symbolInformation": { "symbolInformation": {
@ -48,6 +50,7 @@
"fqn": "MyNamespace\\A->suite()", "fqn": "MyNamespace\\A->suite()",
"extends": [], "extends": [],
"isGlobal": false, "isGlobal": false,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -58,7 +61,7 @@
}, },
"containerName": "MyNamespace\\A" "containerName": "MyNamespace\\A"
}, },
"type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type__tostring": "mixed",
"type": {}, "type": {},
"declarationLine": "public function suite()", "declarationLine": "public function suite()",
"documentation": null "documentation": null

View File

@ -9,6 +9,7 @@
"fqn": "MyNamespace", "fqn": "MyNamespace",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -27,6 +28,7 @@
"fqn": "MyNamespace\\Mbstring", "fqn": "MyNamespace\\Mbstring",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": true, "canBeInstantiated": true,
"symbolInformation": { "symbolInformation": {
@ -45,6 +47,7 @@
"fqn": "MyNamespace\\Mbstring::MB_CASE_FOLD", "fqn": "MyNamespace\\Mbstring::MB_CASE_FOLD",
"extends": [], "extends": [],
"isGlobal": false, "isGlobal": false,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -55,7 +58,7 @@
}, },
"containerName": "MyNamespace\\Mbstring" "containerName": "MyNamespace\\Mbstring"
}, },
"type__class": "phpDocumentor\\Reflection\\Types\\Object_", "type__tostring": "\\MyNamespace\\PHP_INT_MAX",
"type": {}, "type": {},
"declarationLine": "const MB_CASE_FOLD = PHP_INT_MAX;", "declarationLine": "const MB_CASE_FOLD = PHP_INT_MAX;",
"documentation": null "documentation": null

View File

@ -9,6 +9,7 @@
"fqn": "A", "fqn": "A",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -27,6 +28,7 @@
"fqn": "A->b()", "fqn": "A->b()",
"extends": [], "extends": [],
"isGlobal": false, "isGlobal": false,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -37,7 +39,7 @@
}, },
"containerName": "A" "containerName": "A"
}, },
"type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type__tostring": "mixed",
"type": {}, "type": {},
"declarationLine": "function b ($a = MY_CONSTANT);", "declarationLine": "function b ($a = MY_CONSTANT);",
"documentation": null "documentation": null

View File

@ -5,6 +5,7 @@
"fqn": "MyNamespace", "fqn": "MyNamespace",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {

View File

@ -1,10 +1,15 @@
{ {
"references": [], "references": {
"MyNamespace\\Exception": [
"./exceptions1.php"
]
},
"definitions": { "definitions": {
"MyNamespace": { "MyNamespace": {
"fqn": "MyNamespace", "fqn": "MyNamespace",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {

View File

@ -3,6 +3,9 @@
"LanguageServer": [ "LanguageServer": [
"./functionUse2.php" "./functionUse2.php"
], ],
"LanguageServer\\pathToUri()": [
"./functionUse2.php"
],
"LanguageServer\\timeout()": [ "LanguageServer\\timeout()": [
"./functionUse2.php" "./functionUse2.php"
] ]

View File

@ -12,6 +12,7 @@
"fqn": "MyNamespace", "fqn": "MyNamespace",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {

View File

@ -5,6 +5,7 @@
"fqn": "A", "fqn": "A",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {

View File

@ -1,10 +1,18 @@
{ {
"references": [], "references": {
"B\\__FILE__": [
"./magicConstantsShouldBeGlobal.php"
],
"__FILE__": [
"./magicConstantsShouldBeGlobal.php"
]
},
"definitions": { "definitions": {
"B": { "B": {
"fqn": "B", "fqn": "B",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {

View File

@ -1,10 +1,15 @@
{ {
"references": [], "references": {
"__CLASS__": [
"./magicConsts.php"
]
},
"definitions": { "definitions": {
"A": { "A": {
"fqn": "A", "fqn": "A",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": true, "canBeInstantiated": true,
"symbolInformation": { "symbolInformation": {
@ -23,6 +28,7 @@
"fqn": "A::$deprecationsTriggered", "fqn": "A::$deprecationsTriggered",
"extends": [], "extends": [],
"isGlobal": false, "isGlobal": false,
"roamed": false,
"isStatic": true, "isStatic": true,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -33,7 +39,7 @@
}, },
"containerName": "A" "containerName": "A"
}, },
"type__class": "phpDocumentor\\Reflection\\Types\\Array_", "type__tostring": "\\__CLASS__[]",
"type": {}, "type": {},
"declarationLine": "private static $deprecationsTriggered;", "declarationLine": "private static $deprecationsTriggered;",
"documentation": null "documentation": null

View File

@ -12,6 +12,7 @@
"fqn": "MyNamespace", "fqn": "MyNamespace",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -30,6 +31,7 @@
"fqn": "MyNamespace\\A", "fqn": "MyNamespace\\A",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": true, "canBeInstantiated": true,
"symbolInformation": { "symbolInformation": {
@ -48,6 +50,7 @@
"fqn": "MyNamespace\\A::a()", "fqn": "MyNamespace\\A::a()",
"extends": [], "extends": [],
"isGlobal": false, "isGlobal": false,
"roamed": false,
"isStatic": true, "isStatic": true,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -58,7 +61,7 @@
}, },
"containerName": "MyNamespace\\A" "containerName": "MyNamespace\\A"
}, },
"type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type__tostring": "mixed",
"type": {}, "type": {},
"declarationLine": "static function a() {", "declarationLine": "static function a() {",
"documentation": null "documentation": null

View File

@ -12,6 +12,7 @@
"fqn": "MyNamespace", "fqn": "MyNamespace",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -30,6 +31,7 @@
"fqn": "MyNamespace\\A", "fqn": "MyNamespace\\A",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": true, "canBeInstantiated": true,
"symbolInformation": { "symbolInformation": {
@ -48,6 +50,7 @@
"fqn": "MyNamespace\\A::a()", "fqn": "MyNamespace\\A::a()",
"extends": [], "extends": [],
"isGlobal": false, "isGlobal": false,
"roamed": false,
"isStatic": true, "isStatic": true,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -58,7 +61,7 @@
}, },
"containerName": "MyNamespace\\A" "containerName": "MyNamespace\\A"
}, },
"type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type__tostring": "mixed",
"type": {}, "type": {},
"declarationLine": "static function a() {", "declarationLine": "static function a() {",
"documentation": null "documentation": null

View File

@ -27,6 +27,7 @@
"fqn": "MyNamespace", "fqn": "MyNamespace",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -45,6 +46,7 @@
"fqn": "MyNamespace\\A", "fqn": "MyNamespace\\A",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": true, "canBeInstantiated": true,
"symbolInformation": { "symbolInformation": {
@ -63,6 +65,7 @@
"fqn": "MyNamespace\\A::getInitializer()", "fqn": "MyNamespace\\A::getInitializer()",
"extends": [], "extends": [],
"isGlobal": false, "isGlobal": false,
"roamed": false,
"isStatic": true, "isStatic": true,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -73,7 +76,7 @@
}, },
"containerName": "MyNamespace\\A" "containerName": "MyNamespace\\A"
}, },
"type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type__tostring": "mixed",
"type": {}, "type": {},
"declarationLine": "public static function getInitializer(ClassLoader $loader)", "declarationLine": "public static function getInitializer(ClassLoader $loader)",
"documentation": null "documentation": null

View File

@ -18,6 +18,7 @@
"fqn": "MyNamespace", "fqn": "MyNamespace",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -36,6 +37,7 @@
"fqn": "MyNamespace\\A", "fqn": "MyNamespace\\A",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": true, "canBeInstantiated": true,
"symbolInformation": { "symbolInformation": {
@ -54,6 +56,7 @@
"fqn": "MyNamespace\\A->testRequest()", "fqn": "MyNamespace\\A->testRequest()",
"extends": [], "extends": [],
"isGlobal": false, "isGlobal": false,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -64,7 +67,7 @@
}, },
"containerName": "MyNamespace\\A" "containerName": "MyNamespace\\A"
}, },
"type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type__tostring": "mixed",
"type": {}, "type": {},
"declarationLine": "public function testRequest()", "declarationLine": "public function testRequest()",
"documentation": null "documentation": null

View File

@ -1,10 +1,15 @@
{ {
"references": [], "references": {
"MyNamespace\\ParseErrorsTest->args": [
"./memberAccess5.php"
]
},
"definitions": { "definitions": {
"MyNamespace": { "MyNamespace": {
"fqn": "MyNamespace", "fqn": "MyNamespace",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -23,6 +28,7 @@
"fqn": "MyNamespace\\ParseErrorsTest", "fqn": "MyNamespace\\ParseErrorsTest",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": true, "canBeInstantiated": true,
"symbolInformation": { "symbolInformation": {
@ -41,6 +47,7 @@
"fqn": "MyNamespace\\ParseErrorsTest->setUp()", "fqn": "MyNamespace\\ParseErrorsTest->setUp()",
"extends": [], "extends": [],
"isGlobal": false, "isGlobal": false,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -51,7 +58,7 @@
}, },
"containerName": "MyNamespace\\ParseErrorsTest" "containerName": "MyNamespace\\ParseErrorsTest"
}, },
"type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type__tostring": "mixed",
"type": {}, "type": {},
"declarationLine": "public function setUp()", "declarationLine": "public function setUp()",
"documentation": null "documentation": null

View File

@ -15,6 +15,7 @@
"fqn": "MyNamespace", "fqn": "MyNamespace",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -33,6 +34,7 @@
"fqn": "MyNamespace\\ParseErrorsTest", "fqn": "MyNamespace\\ParseErrorsTest",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": true, "canBeInstantiated": true,
"symbolInformation": { "symbolInformation": {
@ -51,6 +53,7 @@
"fqn": "MyNamespace\\ParseErrorsTest->setAccount()", "fqn": "MyNamespace\\ParseErrorsTest->setAccount()",
"extends": [], "extends": [],
"isGlobal": false, "isGlobal": false,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -61,7 +64,7 @@
}, },
"containerName": "MyNamespace\\ParseErrorsTest" "containerName": "MyNamespace\\ParseErrorsTest"
}, },
"type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type__tostring": "mixed",
"type": {}, "type": {},
"declarationLine": "public function setAccount(AccountInterface $account)", "declarationLine": "public function setAccount(AccountInterface $account)",
"documentation": null "documentation": null

View File

@ -0,0 +1,7 @@
<?php
class FooClass {
public function foo(): FooClass {
return $this;
}
}

View File

@ -0,0 +1,48 @@
{
"references": {
"FooClass": [
"./methodReturnType.php"
]
},
"definitions": {
"FooClass": {
"fqn": "FooClass",
"extends": [],
"isGlobal": true,
"roamed": false,
"isStatic": false,
"canBeInstantiated": true,
"symbolInformation": {
"name": "FooClass",
"kind": 5,
"location": {
"uri": "./methodReturnType.php"
},
"containerName": ""
},
"type": null,
"declarationLine": "class FooClass {",
"documentation": null
},
"FooClass->foo()": {
"fqn": "FooClass->foo()",
"extends": [],
"isGlobal": false,
"roamed": false,
"isStatic": false,
"canBeInstantiated": false,
"symbolInformation": {
"name": "foo",
"kind": 6,
"location": {
"uri": "./methodReturnType.php"
},
"containerName": "FooClass"
},
"type__tostring": "\\FooClass",
"type": {},
"declarationLine": "public function foo(): FooClass {",
"documentation": null
}
}
}

View File

@ -18,6 +18,7 @@
"fqn": "MyNamespace1", "fqn": "MyNamespace1",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -36,6 +37,7 @@
"fqn": "MyNamespace1\\B", "fqn": "MyNamespace1\\B",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": true, "canBeInstantiated": true,
"symbolInformation": { "symbolInformation": {
@ -54,6 +56,7 @@
"fqn": "MyNamespace1\\B->b()", "fqn": "MyNamespace1\\B->b()",
"extends": [], "extends": [],
"isGlobal": false, "isGlobal": false,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -64,7 +67,7 @@
}, },
"containerName": "MyNamespace1\\B" "containerName": "MyNamespace1\\B"
}, },
"type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type__tostring": "mixed",
"type": {}, "type": {},
"declarationLine": "function b() {", "declarationLine": "function b() {",
"documentation": null "documentation": null
@ -73,6 +76,7 @@
"fqn": "MyNamespace2", "fqn": "MyNamespace2",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -93,6 +97,7 @@
"MyNamespace2\\MyNamespace1\\B" "MyNamespace2\\MyNamespace1\\B"
], ],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": true, "canBeInstantiated": true,
"symbolInformation": { "symbolInformation": {
@ -111,6 +116,7 @@
"fqn": "MyNamespace2\\A->a()", "fqn": "MyNamespace2\\A->a()",
"extends": [], "extends": [],
"isGlobal": false, "isGlobal": false,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -121,7 +127,7 @@
}, },
"containerName": "MyNamespace2\\A" "containerName": "MyNamespace2\\A"
}, },
"type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type__tostring": "mixed",
"type": {}, "type": {},
"declarationLine": "function a () {", "declarationLine": "function a () {",
"documentation": null "documentation": null

View File

@ -5,6 +5,7 @@
"fqn": "Foo", "fqn": "Foo",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": true, "canBeInstantiated": true,
"symbolInformation": { "symbolInformation": {
@ -23,6 +24,7 @@
"fqn": "Foo->fn()", "fqn": "Foo->fn()",
"extends": [], "extends": [],
"isGlobal": false, "isGlobal": false,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -33,7 +35,7 @@
}, },
"containerName": "Foo" "containerName": "Foo"
}, },
"type__class": "phpDocumentor\\Reflection\\Types\\Object_", "type__tostring": "\\Iterator",
"type": {}, "type": {},
"declarationLine": "public function fn()", "declarationLine": "public function fn()",
"documentation": "Foo" "documentation": "Foo"

View File

@ -5,6 +5,7 @@
"fqn": "A", "fqn": "A",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": true, "canBeInstantiated": true,
"symbolInformation": { "symbolInformation": {
@ -23,6 +24,7 @@
"fqn": "A->b()", "fqn": "A->b()",
"extends": [], "extends": [],
"isGlobal": false, "isGlobal": false,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -33,7 +35,7 @@
}, },
"containerName": "A" "containerName": "A"
}, },
"type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type__tostring": "mixed",
"type": {}, "type": {},
"declarationLine": "function b() {", "declarationLine": "function b() {",
"documentation": null "documentation": null

View File

@ -18,6 +18,7 @@
"fqn": "MyNamespace1", "fqn": "MyNamespace1",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {

View File

@ -27,6 +27,7 @@
"fqn": "B", "fqn": "B",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {

View File

@ -5,6 +5,7 @@
"fqn": "A\\B", "fqn": "A\\B",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {

View File

@ -2,6 +2,12 @@
"references": { "references": {
"LanguageServer": [ "LanguageServer": [
"./namespaces8.php" "./namespaces8.php"
],
"LanguageServer\\pathToUri()": [
"./namespaces8.php"
],
"LanguageServer\\uriToPath()": [
"./namespaces8.php"
] ]
}, },
"definitions": { "definitions": {
@ -9,6 +15,7 @@
"fqn": "LanguageServer\\Tests\\Utils", "fqn": "LanguageServer\\Tests\\Utils",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {

View File

@ -9,6 +9,7 @@
"fqn": "MyNamespace", "fqn": "MyNamespace",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -27,6 +28,7 @@
"fqn": "MyNamespace\\A", "fqn": "MyNamespace\\A",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": true, "canBeInstantiated": true,
"symbolInformation": { "symbolInformation": {
@ -45,6 +47,7 @@
"fqn": "MyNamespace\\A->a()", "fqn": "MyNamespace\\A->a()",
"extends": [], "extends": [],
"isGlobal": false, "isGlobal": false,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -55,7 +58,7 @@
}, },
"containerName": "MyNamespace\\A" "containerName": "MyNamespace\\A"
}, },
"type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type__tostring": "mixed",
"type": {}, "type": {},
"declarationLine": "function a () {", "declarationLine": "function a () {",
"documentation": null "documentation": null

View File

@ -12,6 +12,7 @@
"fqn": "MyNamespace", "fqn": "MyNamespace",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -30,6 +31,7 @@
"fqn": "MyNamespace\\B", "fqn": "MyNamespace\\B",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": true, "canBeInstantiated": true,
"symbolInformation": { "symbolInformation": {
@ -48,6 +50,7 @@
"fqn": "MyNamespace\\A", "fqn": "MyNamespace\\A",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": true, "canBeInstantiated": true,
"symbolInformation": { "symbolInformation": {
@ -66,6 +69,7 @@
"fqn": "MyNamespace\\A->a()", "fqn": "MyNamespace\\A->a()",
"extends": [], "extends": [],
"isGlobal": false, "isGlobal": false,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -76,7 +80,7 @@
}, },
"containerName": "MyNamespace\\A" "containerName": "MyNamespace\\A"
}, },
"type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type__tostring": "mixed",
"type": {}, "type": {},
"declarationLine": "function a () {", "declarationLine": "function a () {",
"documentation": null "documentation": null

View File

@ -9,6 +9,7 @@
"fqn": "A", "fqn": "A",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": true, "canBeInstantiated": true,
"symbolInformation": { "symbolInformation": {
@ -27,6 +28,7 @@
"fqn": "A->a()", "fqn": "A->a()",
"extends": [], "extends": [],
"isGlobal": false, "isGlobal": false,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -37,7 +39,7 @@
}, },
"containerName": "A" "containerName": "A"
}, },
"type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type__tostring": "mixed",
"type": {}, "type": {},
"declarationLine": "function a () {", "declarationLine": "function a () {",
"documentation": null "documentation": null

View File

@ -9,6 +9,7 @@
"fqn": "MyNamespace", "fqn": "MyNamespace",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -27,6 +28,7 @@
"fqn": "MyNamespace\\init()", "fqn": "MyNamespace\\init()",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -37,7 +39,7 @@
}, },
"containerName": "MyNamespace" "containerName": "MyNamespace"
}, },
"type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type__tostring": "mixed",
"type": {}, "type": {},
"declarationLine": "function init(Hi $view)", "declarationLine": "function init(Hi $view)",
"documentation": null "documentation": null

View File

@ -12,6 +12,7 @@
"fqn": "MyNamespace", "fqn": "MyNamespace",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -30,6 +31,7 @@
"fqn": "MyNamespace\\B", "fqn": "MyNamespace\\B",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": true, "canBeInstantiated": true,
"symbolInformation": { "symbolInformation": {
@ -48,6 +50,7 @@
"fqn": "MyNamespace\\B->b()", "fqn": "MyNamespace\\B->b()",
"extends": [], "extends": [],
"isGlobal": false, "isGlobal": false,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -58,7 +61,7 @@
}, },
"containerName": "MyNamespace\\B" "containerName": "MyNamespace\\B"
}, },
"type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type__tostring": "mixed",
"type": {}, "type": {},
"declarationLine": "function b() {", "declarationLine": "function b() {",
"documentation": null "documentation": null
@ -69,6 +72,7 @@
"MyNamespace\\B" "MyNamespace\\B"
], ],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": true, "canBeInstantiated": true,
"symbolInformation": { "symbolInformation": {
@ -87,6 +91,7 @@
"fqn": "MyNamespace\\A->a()", "fqn": "MyNamespace\\A->a()",
"extends": [], "extends": [],
"isGlobal": false, "isGlobal": false,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -97,7 +102,7 @@
}, },
"containerName": "MyNamespace\\A" "containerName": "MyNamespace\\A"
}, },
"type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type__tostring": "mixed",
"type": {}, "type": {},
"declarationLine": "function a () {", "declarationLine": "function a () {",
"documentation": null "documentation": null

View File

@ -15,6 +15,7 @@
"fqn": "MyNamespace", "fqn": "MyNamespace",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -33,6 +34,7 @@
"fqn": "MyNamespace\\B", "fqn": "MyNamespace\\B",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": true, "canBeInstantiated": true,
"symbolInformation": { "symbolInformation": {
@ -51,6 +53,7 @@
"fqn": "MyNamespace\\B->b()", "fqn": "MyNamespace\\B->b()",
"extends": [], "extends": [],
"isGlobal": false, "isGlobal": false,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -61,7 +64,7 @@
}, },
"containerName": "MyNamespace\\B" "containerName": "MyNamespace\\B"
}, },
"type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type__tostring": "mixed",
"type": {}, "type": {},
"declarationLine": "function b() {", "declarationLine": "function b() {",
"documentation": null "documentation": null
@ -72,6 +75,7 @@
"MyNamespace\\B" "MyNamespace\\B"
], ],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": true, "canBeInstantiated": true,
"symbolInformation": { "symbolInformation": {
@ -90,6 +94,7 @@
"fqn": "MyNamespace\\A->a()", "fqn": "MyNamespace\\A->a()",
"extends": [], "extends": [],
"isGlobal": false, "isGlobal": false,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -100,7 +105,7 @@
}, },
"containerName": "MyNamespace\\A" "containerName": "MyNamespace\\A"
}, },
"type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type__tostring": "mixed",
"type": {}, "type": {},
"declarationLine": "function a () {", "declarationLine": "function a () {",
"documentation": null "documentation": null

View File

@ -5,6 +5,7 @@
"fqn": "MyClass", "fqn": "MyClass",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": true, "canBeInstantiated": true,
"symbolInformation": { "symbolInformation": {
@ -23,6 +24,7 @@
"fqn": "MyClass->mainPropertyName", "fqn": "MyClass->mainPropertyName",
"extends": [], "extends": [],
"isGlobal": false, "isGlobal": false,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -33,7 +35,7 @@
}, },
"containerName": "MyClass" "containerName": "MyClass"
}, },
"type__class": "phpDocumentor\\Reflection\\Types\\String_", "type__tostring": "string",
"type": {}, "type": {},
"declarationLine": "protected $mainPropertyName;", "declarationLine": "protected $mainPropertyName;",
"documentation": "The name of the main property, or NULL if there is none." "documentation": "The name of the main property, or NULL if there is none."

View File

@ -5,6 +5,7 @@
"fqn": "MyClass", "fqn": "MyClass",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": true, "canBeInstantiated": true,
"symbolInformation": { "symbolInformation": {
@ -23,6 +24,7 @@
"fqn": "MyClass->mainPropertyName", "fqn": "MyClass->mainPropertyName",
"extends": [], "extends": [],
"isGlobal": false, "isGlobal": false,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -33,7 +35,7 @@
}, },
"containerName": "MyClass" "containerName": "MyClass"
}, },
"type__class": "phpDocumentor\\Reflection\\Types\\String_", "type__tostring": "string",
"type": {}, "type": {},
"declarationLine": "protected $mainPropertyName;", "declarationLine": "protected $mainPropertyName;",
"documentation": "The name of the main property, or NULL if there is none." "documentation": "The name of the main property, or NULL if there is none."

View File

@ -12,6 +12,7 @@
"fqn": "TestNamespace", "fqn": "TestNamespace",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -30,6 +31,7 @@
"fqn": "TestNamespace\\whatever()", "fqn": "TestNamespace\\whatever()",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -40,7 +42,7 @@
}, },
"containerName": "TestNamespace" "containerName": "TestNamespace"
}, },
"type__class": "phpDocumentor\\Reflection\\Types\\Object_", "type__tostring": "\\TestNamespace\\TestClass",
"type": {}, "type": {},
"declarationLine": "function whatever(TestClass $param): TestClass2 {", "declarationLine": "function whatever(TestClass $param): TestClass2 {",
"documentation": "Aute duis elit reprehenderit tempor cillum proident anim laborum eu laboris reprehenderit ea incididunt." "documentation": "Aute duis elit reprehenderit tempor cillum proident anim laborum eu laboris reprehenderit ea incididunt."

View File

@ -12,6 +12,7 @@
"fqn": "MyNamespace", "fqn": "MyNamespace",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -30,6 +31,7 @@
"fqn": "MyNamespace\\A", "fqn": "MyNamespace\\A",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": true, "canBeInstantiated": true,
"symbolInformation": { "symbolInformation": {
@ -48,6 +50,7 @@
"fqn": "MyNamespace\\A::a()", "fqn": "MyNamespace\\A::a()",
"extends": [], "extends": [],
"isGlobal": false, "isGlobal": false,
"roamed": false,
"isStatic": true, "isStatic": true,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -58,7 +61,7 @@
}, },
"containerName": "MyNamespace\\A" "containerName": "MyNamespace\\A"
}, },
"type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type__tostring": "mixed",
"type": {}, "type": {},
"declarationLine": "static function a() {", "declarationLine": "static function a() {",
"documentation": null "documentation": null

View File

@ -9,6 +9,7 @@
"fqn": "MyNamespace", "fqn": "MyNamespace",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {

View File

@ -12,6 +12,7 @@
"fqn": "A", "fqn": "A",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": true, "canBeInstantiated": true,
"symbolInformation": { "symbolInformation": {
@ -30,6 +31,7 @@
"fqn": "A::$a", "fqn": "A::$a",
"extends": [], "extends": [],
"isGlobal": false, "isGlobal": false,
"roamed": false,
"isStatic": true, "isStatic": true,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -40,7 +42,7 @@
}, },
"containerName": "A" "containerName": "A"
}, },
"type__class": "phpDocumentor\\Reflection\\Types\\String_", "type__tostring": "string",
"type": {}, "type": {},
"declarationLine": "static $a;", "declarationLine": "static $a;",
"documentation": null "documentation": null

View File

@ -18,6 +18,7 @@
"fqn": "TestClass", "fqn": "TestClass",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": true, "canBeInstantiated": true,
"symbolInformation": { "symbolInformation": {
@ -36,6 +37,7 @@
"fqn": "TestClass::$testProperty", "fqn": "TestClass::$testProperty",
"extends": [], "extends": [],
"isGlobal": false, "isGlobal": false,
"roamed": false,
"isStatic": true, "isStatic": true,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -46,7 +48,7 @@
}, },
"containerName": "TestClass" "containerName": "TestClass"
}, },
"type__class": "phpDocumentor\\Reflection\\Types\\Array_", "type__tostring": "\\TestClass[]",
"type": {}, "type": {},
"declarationLine": "public static $testProperty;", "declarationLine": "public static $testProperty;",
"documentation": "Lorem excepteur officia sit anim velit veniam enim." "documentation": "Lorem excepteur officia sit anim velit veniam enim."

View File

@ -15,6 +15,7 @@
"fqn": "MyNamespace", "fqn": "MyNamespace",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -33,6 +34,7 @@
"fqn": "MyNamespace\\B", "fqn": "MyNamespace\\B",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": true, "canBeInstantiated": true,
"symbolInformation": { "symbolInformation": {
@ -51,6 +53,7 @@
"fqn": "MyNamespace\\B->b()", "fqn": "MyNamespace\\B->b()",
"extends": [], "extends": [],
"isGlobal": false, "isGlobal": false,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -61,7 +64,7 @@
}, },
"containerName": "MyNamespace\\B" "containerName": "MyNamespace\\B"
}, },
"type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type__tostring": "mixed",
"type": {}, "type": {},
"declarationLine": "function b() {", "declarationLine": "function b() {",
"documentation": null "documentation": null
@ -72,6 +75,7 @@
"MyNamespace\\B" "MyNamespace\\B"
], ],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": true, "canBeInstantiated": true,
"symbolInformation": { "symbolInformation": {
@ -90,6 +94,7 @@
"fqn": "MyNamespace\\A->a()", "fqn": "MyNamespace\\A->a()",
"extends": [], "extends": [],
"isGlobal": false, "isGlobal": false,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -100,7 +105,7 @@
}, },
"containerName": "MyNamespace\\A" "containerName": "MyNamespace\\A"
}, },
"type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type__tostring": "mixed",
"type": {}, "type": {},
"declarationLine": "function a () {", "declarationLine": "function a () {",
"documentation": null "documentation": null

View File

@ -15,6 +15,7 @@
"fqn": "MyNamespace", "fqn": "MyNamespace",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -33,6 +34,7 @@
"fqn": "MyNamespace\\B", "fqn": "MyNamespace\\B",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": true, "canBeInstantiated": true,
"symbolInformation": { "symbolInformation": {
@ -51,6 +53,7 @@
"fqn": "MyNamespace\\B->b()", "fqn": "MyNamespace\\B->b()",
"extends": [], "extends": [],
"isGlobal": false, "isGlobal": false,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -61,7 +64,7 @@
}, },
"containerName": "MyNamespace\\B" "containerName": "MyNamespace\\B"
}, },
"type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type__tostring": "mixed",
"type": {}, "type": {},
"declarationLine": "function b() {", "declarationLine": "function b() {",
"documentation": null "documentation": null
@ -72,6 +75,7 @@
"MyNamespace\\B" "MyNamespace\\B"
], ],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": true, "canBeInstantiated": true,
"symbolInformation": { "symbolInformation": {
@ -90,6 +94,7 @@
"fqn": "MyNamespace\\A->a()", "fqn": "MyNamespace\\A->a()",
"extends": [], "extends": [],
"isGlobal": false, "isGlobal": false,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -100,7 +105,7 @@
}, },
"containerName": "MyNamespace\\A" "containerName": "MyNamespace\\A"
}, },
"type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type__tostring": "mixed",
"type": {}, "type": {},
"declarationLine": "function a () {", "declarationLine": "function a () {",
"documentation": null "documentation": null

View File

@ -15,6 +15,7 @@
"fqn": "MyNamespace", "fqn": "MyNamespace",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -33,6 +34,7 @@
"fqn": "MyNamespace\\B", "fqn": "MyNamespace\\B",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": true, "canBeInstantiated": true,
"symbolInformation": { "symbolInformation": {
@ -51,6 +53,7 @@
"fqn": "MyNamespace\\B->b()", "fqn": "MyNamespace\\B->b()",
"extends": [], "extends": [],
"isGlobal": false, "isGlobal": false,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -61,7 +64,7 @@
}, },
"containerName": "MyNamespace\\B" "containerName": "MyNamespace\\B"
}, },
"type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type__tostring": "mixed",
"type": {}, "type": {},
"declarationLine": "function b() {", "declarationLine": "function b() {",
"documentation": null "documentation": null
@ -72,6 +75,7 @@
"MyNamespace\\B" "MyNamespace\\B"
], ],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": true, "canBeInstantiated": true,
"symbolInformation": { "symbolInformation": {
@ -90,6 +94,7 @@
"fqn": "MyNamespace\\A->a()", "fqn": "MyNamespace\\A->a()",
"extends": [], "extends": [],
"isGlobal": false, "isGlobal": false,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -100,7 +105,7 @@
}, },
"containerName": "MyNamespace\\A" "containerName": "MyNamespace\\A"
}, },
"type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type__tostring": "mixed",
"type": {}, "type": {},
"declarationLine": "function a () {", "declarationLine": "function a () {",
"documentation": null "documentation": null

View File

@ -6,6 +6,12 @@
"MyNamespace\\A->addTestFile()": [ "MyNamespace\\A->addTestFile()": [
"./self4.php" "./self4.php"
], ],
"MyNamespace\\__DIR__": [
"./self4.php"
],
"__DIR__": [
"./self4.php"
],
"MyNamespace\\DS": [ "MyNamespace\\DS": [
"./self4.php" "./self4.php"
], ],
@ -18,6 +24,7 @@
"fqn": "MyNamespace", "fqn": "MyNamespace",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -36,6 +43,7 @@
"fqn": "MyNamespace\\A", "fqn": "MyNamespace\\A",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": true, "canBeInstantiated": true,
"symbolInformation": { "symbolInformation": {
@ -54,6 +62,7 @@
"fqn": "MyNamespace\\A::suite()", "fqn": "MyNamespace\\A::suite()",
"extends": [], "extends": [],
"isGlobal": false, "isGlobal": false,
"roamed": false,
"isStatic": true, "isStatic": true,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -64,7 +73,7 @@
}, },
"containerName": "MyNamespace\\A" "containerName": "MyNamespace\\A"
}, },
"type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type__tostring": "mixed",
"type": {}, "type": {},
"declarationLine": "public static function suite()", "declarationLine": "public static function suite()",
"documentation": null "documentation": null

View File

@ -9,6 +9,7 @@
"fqn": "MyNamespace", "fqn": "MyNamespace",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -27,6 +28,7 @@
"fqn": "MyNamespace\\A", "fqn": "MyNamespace\\A",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": true, "canBeInstantiated": true,
"symbolInformation": { "symbolInformation": {
@ -45,6 +47,7 @@
"fqn": "MyNamespace\\A->typesProvider()", "fqn": "MyNamespace\\A->typesProvider()",
"extends": [], "extends": [],
"isGlobal": false, "isGlobal": false,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -55,7 +58,7 @@
}, },
"containerName": "MyNamespace\\A" "containerName": "MyNamespace\\A"
}, },
"type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type__tostring": "mixed",
"type": {}, "type": {},
"declarationLine": "public function typesProvider()", "declarationLine": "public function typesProvider()",
"documentation": null "documentation": null

View File

@ -15,6 +15,7 @@
"fqn": "MyNamespace", "fqn": "MyNamespace",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -33,6 +34,7 @@
"fqn": "MyNamespace\\B", "fqn": "MyNamespace\\B",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": true, "canBeInstantiated": true,
"symbolInformation": { "symbolInformation": {
@ -51,6 +53,7 @@
"fqn": "MyNamespace\\B->b()", "fqn": "MyNamespace\\B->b()",
"extends": [], "extends": [],
"isGlobal": false, "isGlobal": false,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -61,7 +64,7 @@
}, },
"containerName": "MyNamespace\\B" "containerName": "MyNamespace\\B"
}, },
"type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type__tostring": "mixed",
"type": {}, "type": {},
"declarationLine": "function b() {", "declarationLine": "function b() {",
"documentation": null "documentation": null
@ -72,6 +75,7 @@
"MyNamespace\\B" "MyNamespace\\B"
], ],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": true, "canBeInstantiated": true,
"symbolInformation": { "symbolInformation": {
@ -90,6 +94,7 @@
"fqn": "MyNamespace\\A->a()", "fqn": "MyNamespace\\A->a()",
"extends": [], "extends": [],
"isGlobal": false, "isGlobal": false,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -100,7 +105,7 @@
}, },
"containerName": "MyNamespace\\A" "containerName": "MyNamespace\\A"
}, },
"type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type__tostring": "mixed",
"type": {}, "type": {},
"declarationLine": "function a () {", "declarationLine": "function a () {",
"documentation": null "documentation": null

View File

@ -15,6 +15,7 @@
"fqn": "MyNamespace", "fqn": "MyNamespace",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -33,6 +34,7 @@
"fqn": "MyNamespace\\B", "fqn": "MyNamespace\\B",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": true, "canBeInstantiated": true,
"symbolInformation": { "symbolInformation": {
@ -51,6 +53,7 @@
"fqn": "MyNamespace\\B->b()", "fqn": "MyNamespace\\B->b()",
"extends": [], "extends": [],
"isGlobal": false, "isGlobal": false,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -61,7 +64,7 @@
}, },
"containerName": "MyNamespace\\B" "containerName": "MyNamespace\\B"
}, },
"type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type__tostring": "mixed",
"type": {}, "type": {},
"declarationLine": "function b() {", "declarationLine": "function b() {",
"documentation": null "documentation": null
@ -72,6 +75,7 @@
"MyNamespace\\B" "MyNamespace\\B"
], ],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": true, "canBeInstantiated": true,
"symbolInformation": { "symbolInformation": {
@ -90,6 +94,7 @@
"fqn": "MyNamespace\\A->a()", "fqn": "MyNamespace\\A->a()",
"extends": [], "extends": [],
"isGlobal": false, "isGlobal": false,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -100,7 +105,7 @@
}, },
"containerName": "MyNamespace\\A" "containerName": "MyNamespace\\A"
}, },
"type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type__tostring": "mixed",
"type": {}, "type": {},
"declarationLine": "function a () {", "declarationLine": "function a () {",
"documentation": null "documentation": null

View File

@ -15,6 +15,7 @@
"fqn": "MyNamespace", "fqn": "MyNamespace",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -33,6 +34,7 @@
"fqn": "MyNamespace\\B", "fqn": "MyNamespace\\B",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": true, "canBeInstantiated": true,
"symbolInformation": { "symbolInformation": {
@ -51,6 +53,7 @@
"fqn": "MyNamespace\\B->b()", "fqn": "MyNamespace\\B->b()",
"extends": [], "extends": [],
"isGlobal": false, "isGlobal": false,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -61,7 +64,7 @@
}, },
"containerName": "MyNamespace\\B" "containerName": "MyNamespace\\B"
}, },
"type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type__tostring": "mixed",
"type": {}, "type": {},
"declarationLine": "function b() {", "declarationLine": "function b() {",
"documentation": null "documentation": null
@ -72,6 +75,7 @@
"MyNamespace\\B" "MyNamespace\\B"
], ],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": true, "canBeInstantiated": true,
"symbolInformation": { "symbolInformation": {
@ -90,6 +94,7 @@
"fqn": "MyNamespace\\A->a()", "fqn": "MyNamespace\\A->a()",
"extends": [], "extends": [],
"isGlobal": false, "isGlobal": false,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -100,7 +105,7 @@
}, },
"containerName": "MyNamespace\\A" "containerName": "MyNamespace\\A"
}, },
"type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type__tostring": "mixed",
"type": {}, "type": {},
"declarationLine": "function a () {", "declarationLine": "function a () {",
"documentation": null "documentation": null

View File

@ -2,9 +2,6 @@
"references": { "references": {
"MyNamespace\\B": [ "MyNamespace\\B": [
"./static4.php" "./static4.php"
],
"static": [
"./static4.php"
] ]
}, },
"definitions": { "definitions": {
@ -12,6 +9,7 @@
"fqn": "MyNamespace", "fqn": "MyNamespace",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -32,6 +30,7 @@
"MyNamespace\\B" "MyNamespace\\B"
], ],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": true, "canBeInstantiated": true,
"symbolInformation": { "symbolInformation": {
@ -50,6 +49,7 @@
"fqn": "MyNamespace\\A->a()", "fqn": "MyNamespace\\A->a()",
"extends": [], "extends": [],
"isGlobal": false, "isGlobal": false,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -60,7 +60,7 @@
}, },
"containerName": "MyNamespace\\A" "containerName": "MyNamespace\\A"
}, },
"type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type__tostring": "mixed",
"type": {}, "type": {},
"declarationLine": "function a () {", "declarationLine": "function a () {",
"documentation": null "documentation": null

View File

@ -0,0 +1,9 @@
<?php
class FooClass {
public static function staticFoo(): FooClass {
return new FooClass();
}
public function bar() { }
}

View File

@ -0,0 +1,68 @@
{
"references": {
"FooClass": [
"./staticMethodReturnType.php"
]
},
"definitions": {
"FooClass": {
"fqn": "FooClass",
"extends": [],
"isGlobal": true,
"roamed": false,
"isStatic": false,
"canBeInstantiated": true,
"symbolInformation": {
"name": "FooClass",
"kind": 5,
"location": {
"uri": "./staticMethodReturnType.php"
},
"containerName": ""
},
"type": null,
"declarationLine": "class FooClass {",
"documentation": null
},
"FooClass::staticFoo()": {
"fqn": "FooClass::staticFoo()",
"extends": [],
"isGlobal": false,
"roamed": false,
"isStatic": true,
"canBeInstantiated": false,
"symbolInformation": {
"name": "staticFoo",
"kind": 6,
"location": {
"uri": "./staticMethodReturnType.php"
},
"containerName": "FooClass"
},
"type__tostring": "\\FooClass",
"type": {},
"declarationLine": "public static function staticFoo(): FooClass {",
"documentation": null
},
"FooClass->bar()": {
"fqn": "FooClass->bar()",
"extends": [],
"isGlobal": false,
"roamed": false,
"isStatic": false,
"canBeInstantiated": false,
"symbolInformation": {
"name": "bar",
"kind": 6,
"location": {
"uri": "./staticMethodReturnType.php"
},
"containerName": "FooClass"
},
"type__tostring": "mixed",
"type": {},
"declarationLine": "public function bar() { }",
"documentation": null
}
}
}

View File

@ -5,6 +5,7 @@
"fqn": "B", "fqn": "B",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": true, "canBeInstantiated": true,
"symbolInformation": { "symbolInformation": {
@ -23,6 +24,7 @@
"fqn": "B->hi", "fqn": "B->hi",
"extends": [], "extends": [],
"isGlobal": false, "isGlobal": false,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -33,7 +35,7 @@
}, },
"containerName": "B" "containerName": "B"
}, },
"type__class": "phpDocumentor\\Reflection\\Types\\Integer", "type__tostring": "int",
"type": {}, "type": {},
"declarationLine": "public $hi;", "declarationLine": "public $hi;",
"documentation": null "documentation": null
@ -42,6 +44,7 @@
"fqn": "B->a()", "fqn": "B->a()",
"extends": [], "extends": [],
"isGlobal": false, "isGlobal": false,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -52,7 +55,7 @@
}, },
"containerName": "B" "containerName": "B"
}, },
"type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type__tostring": "mixed",
"type": {}, "type": {},
"declarationLine": "function a () {", "declarationLine": "function a () {",
"documentation": null "documentation": null

View File

@ -9,6 +9,7 @@
"fqn": "SomeNamespace", "fqn": "SomeNamespace",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {

View File

@ -12,6 +12,7 @@
"fqn": "Foo", "fqn": "Foo",
"extends": [], "extends": [],
"isGlobal": true, "isGlobal": true,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": true, "canBeInstantiated": true,
"symbolInformation": { "symbolInformation": {
@ -30,6 +31,7 @@
"fqn": "Foo->bar", "fqn": "Foo->bar",
"extends": [], "extends": [],
"isGlobal": false, "isGlobal": false,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -40,7 +42,7 @@
}, },
"containerName": "Foo" "containerName": "Foo"
}, },
"type__class": "phpDocumentor\\Reflection\\Types\\Object_", "type__tostring": "\\",
"type": {}, "type": {},
"declarationLine": "protected $bar;", "declarationLine": "protected $bar;",
"documentation": null "documentation": null
@ -49,6 +51,7 @@
"fqn": "Foo->foo()", "fqn": "Foo->foo()",
"extends": [], "extends": [],
"isGlobal": false, "isGlobal": false,
"roamed": false,
"isStatic": false, "isStatic": false,
"canBeInstantiated": false, "canBeInstantiated": false,
"symbolInformation": { "symbolInformation": {
@ -59,7 +62,7 @@
}, },
"containerName": "Foo" "containerName": "Foo"
}, },
"type__class": "phpDocumentor\\Reflection\\Types\\Mixed", "type__tostring": "mixed",
"type": {}, "type": {},
"declarationLine": "public function foo () {", "declarationLine": "public function foo () {",
"documentation": null "documentation": null