2020-03-28 23:06:05 +00:00
|
|
|
<?php
|
|
|
|
|
2021-05-09 20:15:43 +00:00
|
|
|
declare (strict_types=1);
|
2022-06-06 17:12:56 +00:00
|
|
|
namespace Rector\NodeCollector\ValueObject;
|
2020-03-28 23:06:05 +00:00
|
|
|
|
2022-06-06 17:12:56 +00:00
|
|
|
use PhpParser\Node\Expr;
|
|
|
|
use Rector\Core\Validation\RectorAssert;
|
2020-03-28 23:06:05 +00:00
|
|
|
final class ArrayCallable
|
|
|
|
{
|
2021-06-29 00:31:58 +00:00
|
|
|
/**
|
2023-06-11 23:01:39 +00:00
|
|
|
* @readonly
|
2021-08-23 00:20:32 +00:00
|
|
|
* @var \PhpParser\Node\Expr
|
2021-06-29 00:31:58 +00:00
|
|
|
*/
|
|
|
|
private $callerExpr;
|
2020-03-28 23:06:05 +00:00
|
|
|
/**
|
2023-06-11 23:01:39 +00:00
|
|
|
* @readonly
|
2020-03-28 23:06:05 +00:00
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
private $class;
|
|
|
|
/**
|
2023-06-11 23:01:39 +00:00
|
|
|
* @readonly
|
2020-03-28 23:06:05 +00:00
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
private $method;
|
2022-06-07 08:22:29 +00:00
|
|
|
public function __construct(Expr $callerExpr, string $class, string $method)
|
2020-03-28 23:06:05 +00:00
|
|
|
{
|
2021-06-29 00:31:58 +00:00
|
|
|
$this->callerExpr = $callerExpr;
|
2020-03-28 23:06:05 +00:00
|
|
|
$this->class = $class;
|
|
|
|
$this->method = $method;
|
2022-06-07 08:22:29 +00:00
|
|
|
RectorAssert::className($class);
|
2020-03-28 23:06:05 +00:00
|
|
|
}
|
2021-05-09 20:15:43 +00:00
|
|
|
public function getClass() : string
|
2020-03-28 23:06:05 +00:00
|
|
|
{
|
|
|
|
return $this->class;
|
|
|
|
}
|
2021-05-09 20:15:43 +00:00
|
|
|
public function getMethod() : string
|
2020-03-28 23:06:05 +00:00
|
|
|
{
|
|
|
|
return $this->method;
|
|
|
|
}
|
2022-06-07 08:22:29 +00:00
|
|
|
public function getCallerExpr() : Expr
|
2021-06-29 00:31:58 +00:00
|
|
|
{
|
|
|
|
return $this->callerExpr;
|
|
|
|
}
|
2020-03-28 23:06:05 +00:00
|
|
|
}
|