decrease complexity

This commit is contained in:
TomasVotruba 2018-01-14 01:20:24 +01:00
parent 7033c28d36
commit 0705463614

View File

@ -41,19 +41,12 @@ final class FluentReplaceRector extends AbstractRector
public function isCandidate(Node $node): bool
{
// skip just added calls
if ($node->getAttribute(Attribute::ORIGINAL_NODE) === null) {
return false;
}
if ($node instanceof Return_) {
$returnExpr = $node->expr;
if (! $returnExpr instanceof Variable) {
if (! $node->expr instanceof Variable) {
return false;
}
return $returnExpr->name === 'this';
return $node->expr->name === 'this';
}
if ($node instanceof MethodCall) {