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