1
0
Fork 0

Use === "" instead of strlen check

pull/357/head
Rob Lourens 2017-06-07 17:46:05 -07:00
parent 1d314deff0
commit 68656d9663
1 changed files with 2 additions and 2 deletions

View File

@ -1079,7 +1079,7 @@ class DefinitionResolver
// namespace A\B; A\B // namespace A\B; A\B
if ($node instanceof Node\Statement\NamespaceDefinition && $node->name instanceof Node\QualifiedName) { if ($node instanceof Node\Statement\NamespaceDefinition && $node->name instanceof Node\QualifiedName) {
$name = (string) PhpParser\ResolvedName::buildName($node->name->nameParts, $node->getFileContents()); $name = (string) PhpParser\ResolvedName::buildName($node->name->nameParts, $node->getFileContents());
return \strlen($name) > 0 ? $name : null; return $name === "" ? null : $name;
} }
// INPUT OUTPUT: // INPUT OUTPUT:
@ -1088,7 +1088,7 @@ class DefinitionResolver
if ($node instanceof Node\Statement\FunctionDeclaration) { if ($node instanceof Node\Statement\FunctionDeclaration) {
// Function: use functionName() as the name // Function: use functionName() as the name
$name = (string)$node->getNamespacedName(); $name = (string)$node->getNamespacedName();
return \strlen($name) > 0 ? $name . '()' : null; return $name === "" ? null : $name . '()';
} }
// INPUT OUTPUT // INPUT OUTPUT