Skip to content

Commit 4661240

Browse files
committed
added method call type detection
1 parent bfd7a3d commit 4661240

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/Complete/Resolver/NodeTypeResolver.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use PhpParser\Node\Expr\StaticCall;
1515
use PhpParser\Node\Expr\MethodCall;
1616
use PhpParser\Node\Expr\New_;
17+
use PhpParser\Node\Expr\Assign;
1718
use Psr\Log\LoggerInterface;
1819
use Entity\Chain;
1920
use Entity\Chain\MethodCall as ChainMethodCall;
@@ -133,6 +134,9 @@ public function getChainType($node, Index $index, Scope $scope)
133134
protected function createChain($node)
134135
{
135136
$chain = null;
137+
if ($node instanceof Assign) {
138+
$node = $node->expr;
139+
}
136140
while (!($node instanceof Variable)) {
137141
if ($node instanceof PropertyFetch
138142
|| $node instanceof StaticPropertyFetch

0 commit comments

Comments
 (0)