rector/rules/Arguments/ValueObject/ArgumentDefaultValueReplacer.php

80 lines
1.3 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;
final class ArgumentDefaultValueReplacer
2020-08-26 00:21:41 +02:00
{
/**
* @var string
*/
private $class;
/**
* @var string
*/
private $method;
/**
* @var int
*/
private $position;
/**
* @var mixed
*/
private $valueBefore;
/**
* @var mixed
*/
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(): ObjectType
2020-08-26 00:21:41 +02:00
{
return new ObjectType($this->class);
2020-08-26 00:21:41 +02:00
}
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;
}
}