2020-07-19 18:11:59 +02:00
|
|
|
<?php
|
|
|
|
|
2021-05-09 20:15:43 +00:00
|
|
|
declare (strict_types=1);
|
2022-06-06 17:12:56 +00:00
|
|
|
namespace Rector\Naming\ValueObject;
|
2020-07-19 18:11:59 +02:00
|
|
|
|
2022-06-06 17:12:56 +00:00
|
|
|
use PhpParser\Node\Expr\Assign;
|
|
|
|
use PhpParser\Node\Expr\Closure;
|
|
|
|
use PhpParser\Node\Expr\FuncCall;
|
|
|
|
use PhpParser\Node\Expr\MethodCall;
|
|
|
|
use PhpParser\Node\Expr\StaticCall;
|
|
|
|
use PhpParser\Node\Expr\Variable;
|
|
|
|
use PhpParser\Node\Stmt\ClassMethod;
|
|
|
|
use PhpParser\Node\Stmt\Function_;
|
2020-07-19 18:11:59 +02:00
|
|
|
final class VariableAndCallAssign
|
|
|
|
{
|
2020-07-31 22:20:45 +02:00
|
|
|
/**
|
2021-08-23 00:20:32 +00:00
|
|
|
* @var \PhpParser\Node\Expr\Variable
|
2020-07-31 22:20:45 +02:00
|
|
|
*/
|
2021-05-10 23:39:21 +00:00
|
|
|
private $variable;
|
2021-06-18 19:29:49 +00:00
|
|
|
private $expr;
|
2020-07-19 18:11:59 +02:00
|
|
|
/**
|
2021-08-23 00:20:32 +00:00
|
|
|
* @var \PhpParser\Node\Expr\Assign
|
2020-07-19 18:11:59 +02:00
|
|
|
*/
|
2020-07-31 22:20:45 +02:00
|
|
|
private $assign;
|
2020-07-19 18:11:59 +02:00
|
|
|
/**
|
2021-05-10 23:39:21 +00:00
|
|
|
* @var string
|
2020-07-19 18:11:59 +02:00
|
|
|
*/
|
2021-05-10 23:39:21 +00:00
|
|
|
private $variableName;
|
2020-07-19 18:11:59 +02:00
|
|
|
private $functionLike;
|
|
|
|
/**
|
2022-04-26 08:13:18 +00:00
|
|
|
* @param \PhpParser\Node\Expr\FuncCall|\PhpParser\Node\Expr\StaticCall|\PhpParser\Node\Expr\MethodCall $expr
|
|
|
|
* @param \PhpParser\Node\Stmt\ClassMethod|\PhpParser\Node\Stmt\Function_|\PhpParser\Node\Expr\Closure $functionLike
|
2020-07-19 18:11:59 +02:00
|
|
|
*/
|
2022-06-07 08:22:29 +00:00
|
|
|
public function __construct(Variable $variable, $expr, Assign $assign, string $variableName, $functionLike)
|
2021-05-09 20:15:43 +00:00
|
|
|
{
|
2020-07-19 18:11:59 +02:00
|
|
|
$this->variable = $variable;
|
2021-06-18 19:29:49 +00:00
|
|
|
$this->expr = $expr;
|
2021-05-10 23:39:21 +00:00
|
|
|
$this->assign = $assign;
|
2020-07-19 18:11:59 +02:00
|
|
|
$this->variableName = $variableName;
|
|
|
|
$this->functionLike = $functionLike;
|
|
|
|
}
|
2022-06-07 08:22:29 +00:00
|
|
|
public function getVariable() : Variable
|
2020-07-19 18:11:59 +02:00
|
|
|
{
|
|
|
|
return $this->variable;
|
|
|
|
}
|
|
|
|
/**
|
2021-06-18 17:31:16 +00:00
|
|
|
* @return \PhpParser\Node\Expr\FuncCall|\PhpParser\Node\Expr\MethodCall|\PhpParser\Node\Expr\StaticCall
|
2020-07-19 18:11:59 +02:00
|
|
|
*/
|
2021-06-18 17:31:16 +00:00
|
|
|
public function getCall()
|
2020-07-19 18:11:59 +02:00
|
|
|
{
|
2021-06-18 19:29:49 +00:00
|
|
|
return $this->expr;
|
2020-07-19 18:11:59 +02:00
|
|
|
}
|
2021-05-09 20:15:43 +00:00
|
|
|
public function getVariableName() : string
|
2020-07-19 18:11:59 +02:00
|
|
|
{
|
|
|
|
return $this->variableName;
|
|
|
|
}
|
|
|
|
/**
|
2021-06-18 17:31:16 +00:00
|
|
|
* @return \PhpParser\Node\Expr\Closure|\PhpParser\Node\Stmt\ClassMethod|\PhpParser\Node\Stmt\Function_
|
2020-07-19 18:11:59 +02:00
|
|
|
*/
|
2021-06-18 17:31:16 +00:00
|
|
|
public function getFunctionLike()
|
2020-07-19 18:11:59 +02:00
|
|
|
{
|
|
|
|
return $this->functionLike;
|
|
|
|
}
|
2022-06-07 08:22:29 +00:00
|
|
|
public function getAssign() : Assign
|
2020-07-19 19:42:16 +02:00
|
|
|
{
|
|
|
|
return $this->assign;
|
|
|
|
}
|
2020-07-19 18:11:59 +02:00
|
|
|
}
|