1
0
Fork 0

fix(style): fix phpcs errors

pull/609/head
Declspeck 2018-02-25 01:02:34 +02:00
parent 29fd70a5bc
commit 3a2bba7986
No known key found for this signature in database
GPG Key ID: F0417663122A2189
3 changed files with 11 additions and 4 deletions

View File

@ -410,7 +410,8 @@ class DefinitionResolver
return $name; return $name;
} }
private function resolveMemberAccessExpressionNodeToFqn(Node\Expression\MemberAccessExpression $access, Scope $scope) { private function resolveMemberAccessExpressionNodeToFqn(Node\Expression\MemberAccessExpression $access, Scope $scope)
{
if ($access->memberName instanceof Node\Expression) { if ($access->memberName instanceof Node\Expression) {
// Cannot get definition if right-hand side is expression // Cannot get definition if right-hand side is expression
return null; return null;

View File

@ -25,7 +25,10 @@ function getScopeAtNode(DefinitionResolver $definitionResolver, Node $targetNode
$resultScope = null; $resultScope = null;
$traverser->traverse( $traverser->traverse(
$sourceFile, $sourceFile,
function ($nodeOrToken, Scope $scope) use ( function (
$nodeOrToken,
Scope $scope
) use (
&$resultScope, &$resultScope,
$targetNode, $targetNode,
$nearestFunctionDeclarationParent, $nearestFunctionDeclarationParent,

View File

@ -2,6 +2,7 @@
declare(strict_types=1); declare(strict_types=1);
namespace LanguageServer\Scope; namespace LanguageServer\Scope;
use Microsoft\PhpParser\Node\QualifiedName; use Microsoft\PhpParser\Node\QualifiedName;
/** /**
@ -24,14 +25,16 @@ class Scope
*/ */
public $resolvedNameCache = []; public $resolvedNameCache = [];
public function clearResolvedNameCache() { public function clearResolvedNameCache()
{
$this->resolvedNameCache = []; $this->resolvedNameCache = [];
} }
/** /**
* @return string|null * @return string|null
*/ */
public function getResolvedName(QualifiedName $name) { public function getResolvedName(QualifiedName $name)
{
$nameStr = (string)$name; $nameStr = (string)$name;
if (array_key_exists($nameStr, $this->resolvedNameCache)) { if (array_key_exists($nameStr, $this->resolvedNameCache)) {
return $this->resolvedNameCache[$nameStr]; return $this->resolvedNameCache[$nameStr];