Trimmed Trailing Whitespace
parent
df898ec633
commit
e71e4e0ff0
|
@ -3,5 +3,6 @@
|
|||
"search.exclude": {
|
||||
"**/validation": true,
|
||||
"**/tests/Validation/cases": true
|
||||
}
|
||||
},
|
||||
"files.trimTrailingWhitespace": true,
|
||||
}
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
<?php
|
||||
|
||||
class Foo
|
||||
{
|
||||
|
||||
public function canAccess()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private function cantAccess()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
|
@ -247,14 +247,14 @@ class CompletionProvider
|
|||
// Collect all definitions that match any of the prefixes
|
||||
foreach ($this->index->getDefinitions() as $fqn => $def) {
|
||||
foreach ($prefixes as $prefix) {
|
||||
if (substr($fqn, 0, strlen($prefix)) === $prefix &&
|
||||
if (substr($fqn, 0, strlen($prefix)) === $prefix &&
|
||||
$def->isMember &&
|
||||
$def->isVisible($prefix, $prefixes[0], $isInMethodDeclaration)) {
|
||||
$list->items[] = CompletionItemFactory::fromDefinition($def);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} elseif (
|
||||
($scoped = $node->parent) instanceof Node\Expression\ScopedPropertyAccessExpression ||
|
||||
($scoped = $node) instanceof Node\Expression\ScopedPropertyAccessExpression
|
||||
|
|
|
@ -133,17 +133,17 @@ class Definition
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Checks the definition's visibility.
|
||||
* @param string $match Owner of the FQNS
|
||||
* @param string $caller Descendant of the FQNS owner
|
||||
* @param bool $isInMethodDeclaration checking if the call is from inside a
|
||||
* @param bool $isInMethodDeclaration checking if the call is from inside a
|
||||
* method
|
||||
* @return bool
|
||||
*/
|
||||
public function isVisible(string $match, string $caller, bool $isInMethodDeclaration): bool
|
||||
{
|
||||
{
|
||||
if ($isInMethodDeclaration) {
|
||||
if ($match !== $caller && $this->isPrivate()) {
|
||||
return false;
|
||||
|
@ -151,7 +151,7 @@ class Definition
|
|||
} else if ($this->isProtected() || $this->isPrivate()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue