rector/packages/NodeCollector/ValueObject/ArrayCallable.php

45 lines
902 B
PHP
Raw Normal View History

2020-03-28 23:06:05 +00:00
<?php
declare (strict_types=1);
namespace Rector\NodeCollector\ValueObject;
2020-03-28 23:06:05 +00:00
use PhpParser\Node\Expr;
use Rector\Core\Validation\RectorAssert;
2020-03-28 23:06:05 +00:00
final class ArrayCallable
{
/**
* @readonly
* @var \PhpParser\Node\Expr
*/
private $callerExpr;
2020-03-28 23:06:05 +00:00
/**
* @readonly
2020-03-28 23:06:05 +00:00
* @var string
*/
private $class;
/**
* @readonly
2020-03-28 23:06:05 +00:00
* @var string
*/
private $method;
public function __construct(Expr $callerExpr, string $class, string $method)
2020-03-28 23:06:05 +00:00
{
$this->callerExpr = $callerExpr;
2020-03-28 23:06:05 +00:00
$this->class = $class;
$this->method = $method;
RectorAssert::className($class);
2020-03-28 23:06:05 +00:00
}
public function getClass() : string
2020-03-28 23:06:05 +00:00
{
return $this->class;
}
public function getMethod() : string
2020-03-28 23:06:05 +00:00
{
return $this->method;
}
public function getCallerExpr() : Expr
{
return $this->callerExpr;
}
2020-03-28 23:06:05 +00:00
}