1
0
Fork 0

Don't recheck condition

pull/357/head
Felix Becker 2017-06-09 20:00:21 +02:00
parent 4b573acde1
commit 4486ea0997
1 changed files with 9 additions and 7 deletions

View File

@ -269,16 +269,18 @@ class CompletionProvider
$prefixWithNamespace = $namespacePrefix . "\\" . $prefix;
$fqnMatchesPrefixWithNamespace = substr($fqn, 0, strlen($prefixWithNamespace)) === $prefixWithNamespace;
$isFullyQualifiedAndPrefixMatches = !$isNotFullyQualified && ($fqnStartsWithPrefix || $fqnMatchesPrefixWithNamespace);
if (!$isFullyQualifiedAndPrefixMatches && !$isAliased && !array_search($fqn, array_values($namespaceImportTable))) {
if (empty($prefix)) {
$fqn = '\\' . $fqn;
} elseif ($fqnMatchesPrefixWithNamespace) {
$fqn = substr($fqn, strlen($namespacePrefix) + 1);
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 (!$isFullyQualifiedAndPrefixMatches && !$isAliased) {
continue;
}
} elseif ($fqnStartsWithPrefix && $class instanceof Node\QualifiedName && $class->isFullyQualifiedName()) {
$fqn = '\\' . $fqn;