rector/rules/Arguments/ValueObject/ArgumentDefaultValueReplacer.php
Tomas Votruba c8f745a2e7 Updated Rector to commit e961ed17504f12209098099b93ab8fd0d4564c13
e961ed1750 [TASK] Add FunctionArgumentDefaultValueReplacerRector (#63)
2021-05-17 23:17:47 +00:00

63 lines
1.4 KiB
PHP

<?php
declare (strict_types=1);
namespace Rector\Arguments\ValueObject;
use PHPStan\Type\ObjectType;
use Rector\Arguments\Contract\ArgumentDefaultValueReplacerInterface;
final class ArgumentDefaultValueReplacer implements \Rector\Arguments\Contract\ArgumentDefaultValueReplacerInterface
{
/**
* @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;
}
public function getObjectType() : \PHPStan\Type\ObjectType
{
return new \PHPStan\Type\ObjectType($this->class);
}
public function getMethod() : string
{
return $this->method;
}
public function getPosition() : int
{
return $this->position;
}
/**
* @return mixed
*/
public function getValueBefore()
{
return $this->valueBefore;
}
/**
* @return mixed
*/
public function getValueAfter()
{
return $this->valueAfter;
}
}