2020-08-26 00:21:41 +02:00
|
|
|
<?php
|
|
|
|
|
2021-05-09 20:15:43 +00:00
|
|
|
declare (strict_types=1);
|
2021-02-21 00:21:19 +01:00
|
|
|
namespace Rector\Arguments\ValueObject;
|
2020-08-26 00:21:41 +02:00
|
|
|
|
2021-02-27 03:13:22 +01:00
|
|
|
use PHPStan\Type\ObjectType;
|
2021-06-10 10:46:24 +00:00
|
|
|
use Rector\Arguments\Contract\ReplaceArgumentDefaultValueInterface;
|
|
|
|
final class ReplaceArgumentDefaultValue implements \Rector\Arguments\Contract\ReplaceArgumentDefaultValueInterface
|
2020-08-26 00:21:41 +02:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
private $class;
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
private $method;
|
|
|
|
/**
|
|
|
|
* @var int
|
|
|
|
*/
|
|
|
|
private $position;
|
|
|
|
private $valueBefore;
|
|
|
|
private $valueAfter;
|
|
|
|
/**
|
|
|
|
* @param mixed $valueBefore
|
|
|
|
* @param mixed $valueAfter
|
|
|
|
*/
|
|
|
|
public function __construct(string $class, string $method, int $position, $valueBefore, $valueAfter)
|
|
|
|
{
|
|
|
|
$this->class = $class;
|
|
|
|
$this->method = $method;
|
|
|
|
$this->position = $position;
|
|
|
|
$this->valueBefore = $valueBefore;
|
|
|
|
$this->valueAfter = $valueAfter;
|
|
|
|
}
|
2021-05-10 22:23:08 +00:00
|
|
|
public function getObjectType() : \PHPStan\Type\ObjectType
|
2020-08-26 00:21:41 +02:00
|
|
|
{
|
2021-05-10 22:23:08 +00:00
|
|
|
return new \PHPStan\Type\ObjectType($this->class);
|
2020-08-26 00:21:41 +02:00
|
|
|
}
|
2021-05-09 20:15:43 +00:00
|
|
|
public function getMethod() : string
|
2020-08-26 00:21:41 +02:00
|
|
|
{
|
|
|
|
return $this->method;
|
|
|
|
}
|
2021-05-09 20:15:43 +00:00
|
|
|
public function getPosition() : int
|
2020-08-26 00:21:41 +02:00
|
|
|
{
|
|
|
|
return $this->position;
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* @return mixed
|
|
|
|
*/
|
|
|
|
public function getValueBefore()
|
|
|
|
{
|
|
|
|
return $this->valueBefore;
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* @return mixed
|
|
|
|
*/
|
|
|
|
public function getValueAfter()
|
|
|
|
{
|
|
|
|
return $this->valueAfter;
|
|
|
|
}
|
|
|
|
}
|