rector/rules/Arguments/ValueObject/ReplaceArgumentDefaultValue.php

63 lines
1.4 KiB
PHP
Raw Normal View History

2020-08-26 00:21:41 +02:00
<?php
declare (strict_types=1);
namespace Rector\Arguments\ValueObject;
2020-08-26 00:21:41 +02:00
use PHPStan\Type\ObjectType;
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;
}
public function getObjectType() : \PHPStan\Type\ObjectType
2020-08-26 00:21:41 +02:00
{
return new \PHPStan\Type\ObjectType($this->class);
2020-08-26 00:21:41 +02:00
}
public function getMethod() : string
2020-08-26 00:21:41 +02:00
{
return $this->method;
}
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;
}
}