2020-10-14 06:24:29 +02:00
|
|
|
<?php
|
|
|
|
|
2021-05-09 20:15:43 +00:00
|
|
|
declare (strict_types=1);
|
2020-10-14 06:24:29 +02:00
|
|
|
namespace Rector\Defluent\ValueObject;
|
|
|
|
|
|
|
|
use PhpParser\Node\Expr\MethodCall;
|
|
|
|
final class FluentMethodCalls
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @var MethodCall[]
|
|
|
|
*/
|
|
|
|
private $fluentMethodCalls = [];
|
|
|
|
/**
|
|
|
|
* @var MethodCall
|
|
|
|
*/
|
|
|
|
private $rootMethodCall;
|
|
|
|
/**
|
|
|
|
* @var MethodCall
|
|
|
|
*/
|
|
|
|
private $lastMethodCall;
|
|
|
|
/**
|
|
|
|
* @param MethodCall[] $fluentMethodCalls
|
|
|
|
*/
|
2021-05-10 22:10:16 +00:00
|
|
|
public function __construct(MethodCall $rootMethodCall, array $fluentMethodCalls, MethodCall $lastMethodCall)
|
2020-10-14 06:24:29 +02:00
|
|
|
{
|
|
|
|
$this->rootMethodCall = $rootMethodCall;
|
|
|
|
$this->fluentMethodCalls = $fluentMethodCalls;
|
|
|
|
$this->lastMethodCall = $lastMethodCall;
|
|
|
|
}
|
2021-05-10 22:10:16 +00:00
|
|
|
public function getRootMethodCall() : MethodCall
|
2020-10-14 06:24:29 +02:00
|
|
|
{
|
|
|
|
return $this->rootMethodCall;
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* @return MethodCall[]
|
|
|
|
*/
|
2021-05-09 20:15:43 +00:00
|
|
|
public function getFluentMethodCalls() : array
|
2020-10-14 06:24:29 +02:00
|
|
|
{
|
|
|
|
return $this->fluentMethodCalls;
|
|
|
|
}
|
2021-05-10 22:10:16 +00:00
|
|
|
public function getLastMethodCall() : MethodCall
|
2020-10-14 06:24:29 +02:00
|
|
|
{
|
|
|
|
return $this->lastMethodCall;
|
|
|
|
}
|
|
|
|
}
|