diff --git a/src/DefinitionResolver.php b/src/DefinitionResolver.php index 9fc5b5b..b8ddc59 100644 --- a/src/DefinitionResolver.php +++ b/src/DefinitionResolver.php @@ -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 diff --git a/src/Protocol/SymbolInformation.php b/src/Protocol/SymbolInformation.php index f3defbf..b64cf91 100644 --- a/src/Protocol/SymbolInformation.php +++ b/src/Protocol/SymbolInformation.php @@ -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;