This commit is contained in:
TomasVotruba 2017-09-26 23:40:40 +02:00
parent fa2afaabcf
commit f43c669da8
3 changed files with 19 additions and 13 deletions

View File

@ -0,0 +1,15 @@
<?php
use Nette\Application\UI\Presenter;
class OldPresenter extends Presenter
{
/**
* @var stdClass
*/
private $injectMe;
public function __construct(stdClass $injectMe)
{
$this->injectMe = $injectMe;
}
}

View File

@ -5,6 +5,8 @@ namespace Rector\NodeAnalyzer;
use PhpParser\Node;
use PhpParser\Node\Expr\MethodCall;
use PhpParser\Node\Expr\StaticCall;
use PhpParser\Node\Expr\Variable;
use PhpParser\Node\Name;
use Rector\Node\Attribute;
final class MethodCallAnalyzer
@ -62,9 +64,9 @@ final class MethodCallAnalyzer
return false;
}
if ($node->class instanceof Node\Name) {
if ($node->class instanceof Name) {
$currentType = $node->class->toString();
} elseif ($node->class instanceof Node\Expr\Variable) {
} elseif ($node->class instanceof Variable) {
$currentType = $node->class->getAttribute(Attribute::CLASS_NAME);
}

View File

@ -2,23 +2,12 @@
namespace Rector\NodeAnalyzer;
use PhpParser\Node\Expr\ArrayDimFetch;
use PhpParser\Node\Expr\MethodCall;
use PhpParser\Node\Expr\Variable;
use PhpParser\Node\Scalar\String_;
final class SymfonyContainerCallsAnalyzer
{
/**
* @var MethodCallAnalyzer
*/
private $methodCallAnalyzer;
public function __construct(MethodCallAnalyzer $methodCallAnalyzer)
{
$this->methodCallAnalyzer = $methodCallAnalyzer;
}
/**
* Finds $this->get(...);
*/