2021-02-02 15:06:48 +01:00
|
|
|
<?php
|
|
|
|
|
2021-05-09 20:15:43 +00:00
|
|
|
declare (strict_types=1);
|
2021-02-02 15:06:48 +01:00
|
|
|
namespace Rector\Transform\ValueObject;
|
|
|
|
|
2021-02-27 03:13:22 +01:00
|
|
|
use PHPStan\Type\ObjectType;
|
2021-02-02 15:06:48 +01:00
|
|
|
final class CallableInMethodCallToVariable
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
private $classType;
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
private $methodName;
|
|
|
|
/**
|
|
|
|
* @var int
|
|
|
|
*/
|
|
|
|
private $argumentPosition;
|
|
|
|
public function __construct(string $classType, string $methodName, int $argumentPosition)
|
|
|
|
{
|
|
|
|
$this->classType = $classType;
|
|
|
|
$this->methodName = $methodName;
|
|
|
|
$this->argumentPosition = $argumentPosition;
|
|
|
|
}
|
2021-05-10 22:23:08 +00:00
|
|
|
public function getObjectType() : \PHPStan\Type\ObjectType
|
2021-02-02 15:06:48 +01:00
|
|
|
{
|
2021-05-10 22:23:08 +00:00
|
|
|
return new \PHPStan\Type\ObjectType($this->classType);
|
2021-02-02 15:06:48 +01:00
|
|
|
}
|
2021-05-09 20:15:43 +00:00
|
|
|
public function getMethodName() : string
|
2021-02-02 15:06:48 +01:00
|
|
|
{
|
|
|
|
return $this->methodName;
|
|
|
|
}
|
2021-05-09 20:15:43 +00:00
|
|
|
public function getArgumentPosition() : int
|
2021-02-02 15:06:48 +01:00
|
|
|
{
|
|
|
|
return $this->argumentPosition;
|
|
|
|
}
|
|
|
|
}
|