Cleanup, fix incorrect count() usage
parent
344a2cef31
commit
0a15afc130
|
@ -880,7 +880,7 @@ class DefinitionResolver
|
|||
* 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
|
||||
*
|
||||
* @param Node || PhpParser\Token $class
|
||||
* @param Node | PhpParser\Token $class
|
||||
* @return Type
|
||||
*/
|
||||
public function resolveClassNameToType($class): Type
|
||||
|
@ -1079,7 +1079,7 @@ class DefinitionResolver
|
|||
// namespace A\B; A\B
|
||||
if ($node instanceof Node\Statement\NamespaceDefinition && $node->name instanceof Node\QualifiedName) {
|
||||
$name = (string) PhpParser\ResolvedName::buildName($node->name->nameParts, $node->getFileContents());
|
||||
return \count($name) > 0 ? $name : null;
|
||||
return \strlen($name) > 0 ? $name : null;
|
||||
}
|
||||
|
||||
// INPUT OUTPUT:
|
||||
|
@ -1088,7 +1088,7 @@ class DefinitionResolver
|
|||
if ($node instanceof Node\Statement\FunctionDeclaration) {
|
||||
// Function: use functionName() as the name
|
||||
$name = (string)$node->getNamespacedName();
|
||||
return \count($name) > 0 ? $name . '()' : null;
|
||||
return \strlen($name) > 0 ? $name . '()' : null;
|
||||
}
|
||||
|
||||
// INPUT OUTPUT
|
||||
|
|
|
@ -67,7 +67,7 @@ class SymbolInformation
|
|||
$symbol->kind = SymbolKind::FUNCTION;
|
||||
} else if ($node instanceof Node\MethodDeclaration) {
|
||||
$nameText = $node->getName();
|
||||
if ($nameText === '__construct' || $nameText === '__destruct') {
|
||||
if ($nameText === '__construct' || $nameText === '__destruct') {
|
||||
$symbol->kind = SymbolKind::CONSTRUCTOR;
|
||||
} else {
|
||||
$symbol->kind = SymbolKind::METHOD;
|
||||
|
|
Loading…
Reference in New Issue