mirror of
https://github.com/rectorphp/rector.git
synced 2025-02-22 10:43:35 +01:00
105 lines
1.8 KiB
PHP
105 lines
1.8 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Rector\Arguments\ValueObject;
|
|
|
|
use PHPStan\Type\ObjectType;
|
|
|
|
final class ArgumentAdder
|
|
{
|
|
/**
|
|
* @var string
|
|
*/
|
|
private $class;
|
|
|
|
/**
|
|
* @var string
|
|
*/
|
|
private $method;
|
|
|
|
/**
|
|
* @var int
|
|
*/
|
|
private $position;
|
|
|
|
/**
|
|
* @var string|null
|
|
*/
|
|
private $argumentName;
|
|
|
|
/**
|
|
* @var mixed|null
|
|
*/
|
|
private $argumentDefaultValue;
|
|
|
|
/**
|
|
* @var string|null
|
|
*/
|
|
private $argumentType;
|
|
|
|
/**
|
|
* @var string|null
|
|
*/
|
|
private $scope;
|
|
|
|
/**
|
|
* @param mixed|null $argumentDefaultValue
|
|
*/
|
|
public function __construct(
|
|
string $class,
|
|
string $method,
|
|
int $position,
|
|
?string $argumentName = null,
|
|
$argumentDefaultValue = null,
|
|
?string $argumentType = null,
|
|
?string $scope = null
|
|
) {
|
|
$this->class = $class;
|
|
$this->method = $method;
|
|
$this->position = $position;
|
|
$this->argumentName = $argumentName;
|
|
$this->argumentDefaultValue = $argumentDefaultValue;
|
|
$this->argumentType = $argumentType;
|
|
$this->scope = $scope;
|
|
}
|
|
|
|
public function getObjectType(): ObjectType
|
|
{
|
|
return new ObjectType($this->class);
|
|
}
|
|
|
|
public function getMethod(): string
|
|
{
|
|
return $this->method;
|
|
}
|
|
|
|
public function getPosition(): int
|
|
{
|
|
return $this->position;
|
|
}
|
|
|
|
public function getArgumentName(): ?string
|
|
{
|
|
return $this->argumentName;
|
|
}
|
|
|
|
/**
|
|
* @return mixed|null
|
|
*/
|
|
public function getArgumentDefaultValue()
|
|
{
|
|
return $this->argumentDefaultValue;
|
|
}
|
|
|
|
public function getArgumentType(): ?string
|
|
{
|
|
return $this->argumentType;
|
|
}
|
|
|
|
public function getScope(): ?string
|
|
{
|
|
return $this->scope;
|
|
}
|
|
}
|