rector/rules/Arguments/ValueObject/ArgumentAdder.php

79 lines
1.8 KiB
PHP
Raw Normal View History

2020-08-25 21:25:00 +00:00
<?php
declare (strict_types=1);
namespace Rector\Arguments\ValueObject;
2020-08-25 21:25:00 +00:00
use PHPStan\Type\ObjectType;
final class ArgumentAdder
2020-08-25 21:25:00 +00:00
{
/**
* @var string
*/
private $class;
/**
* @var string
*/
private $method;
/**
* @var int
*/
private $position;
/**
* @var string|null
*/
private $argumentName = null;
private $argumentDefaultValue = null;
2020-08-25 21:25:00 +00:00
/**
* @var string|null
*/
private $argumentType = null;
2020-08-25 21:25:00 +00:00
/**
* @var string|null
*/
private $scope = null;
2020-08-25 21:25:00 +00:00
/**
* @param mixed|null $argumentDefaultValue
*/
public function __construct(string $class, string $method, int $position, ?string $argumentName = null, $argumentDefaultValue = null, ?string $argumentType = null, ?string $scope = null)
{
2020-08-25 21:25:00 +00:00
$this->class = $class;
$this->method = $method;
$this->position = $position;
$this->argumentName = $argumentName;
$this->argumentDefaultValue = $argumentDefaultValue;
$this->argumentType = $argumentType;
$this->scope = $scope;
}
public function getObjectType() : \PHPStan\Type\ObjectType
2020-08-25 21:25:00 +00:00
{
return new \PHPStan\Type\ObjectType($this->class);
2020-08-25 21:25:00 +00:00
}
public function getMethod() : string
2020-08-25 21:25:00 +00:00
{
return $this->method;
}
public function getPosition() : int
2020-08-25 21:25:00 +00:00
{
return $this->position;
}
public function getArgumentName() : ?string
2020-08-25 21:25:00 +00:00
{
return $this->argumentName;
}
/**
* @return mixed|null
*/
public function getArgumentDefaultValue()
{
return $this->argumentDefaultValue;
}
public function getArgumentType() : ?string
2020-08-25 21:25:00 +00:00
{
return $this->argumentType;
}
public function getScope() : ?string
2020-08-25 21:25:00 +00:00
{
return $this->scope;
}
}