2020-08-25 21:05:58 +02:00
|
|
|
<?php
|
|
|
|
|
2021-05-09 20:15:43 +00:00
|
|
|
declare (strict_types=1);
|
2021-01-29 11:38:59 +01:00
|
|
|
namespace Rector\Removing\ValueObject;
|
2020-08-25 21:05:58 +02:00
|
|
|
|
2021-02-27 03:13:22 +01:00
|
|
|
use PHPStan\Type\ObjectType;
|
2020-09-12 23:19:08 +02:00
|
|
|
final class ArgumentRemover
|
2020-08-25 21:05:58 +02:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
private $class;
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
private $method;
|
|
|
|
/**
|
|
|
|
* @var int
|
|
|
|
*/
|
|
|
|
private $position;
|
|
|
|
private $value;
|
|
|
|
/**
|
|
|
|
* @param mixed $value
|
|
|
|
*/
|
|
|
|
public function __construct(string $class, string $method, int $position, $value)
|
|
|
|
{
|
|
|
|
$this->class = $class;
|
|
|
|
$this->method = $method;
|
|
|
|
$this->position = $position;
|
|
|
|
$this->value = $value;
|
|
|
|
}
|
2021-05-10 22:23:08 +00:00
|
|
|
public function getObjectType() : \PHPStan\Type\ObjectType
|
2020-08-25 21:05:58 +02:00
|
|
|
{
|
2021-05-10 22:23:08 +00:00
|
|
|
return new \PHPStan\Type\ObjectType($this->class);
|
2020-08-25 21:05:58 +02:00
|
|
|
}
|
2021-05-09 20:15:43 +00:00
|
|
|
public function getMethod() : string
|
2020-08-25 21:05:58 +02:00
|
|
|
{
|
|
|
|
return $this->method;
|
|
|
|
}
|
2021-05-09 20:15:43 +00:00
|
|
|
public function getPosition() : int
|
2020-08-25 21:05:58 +02:00
|
|
|
{
|
|
|
|
return $this->position;
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
* @return mixed
|
|
|
|
*/
|
|
|
|
public function getValue()
|
|
|
|
{
|
|
|
|
return $this->value;
|
|
|
|
}
|
|
|
|
}
|