mirror of
https://github.com/rectorphp/rector.git
synced 2025-02-24 03:35:01 +01:00
65 lines
1.2 KiB
PHP
65 lines
1.2 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Rector\Privatization\ValueObject;
|
|
|
|
use PHPStan\Type\ObjectType;
|
|
|
|
final class ReplaceStringWithClassConstant
|
|
{
|
|
/**
|
|
* @var string
|
|
*/
|
|
private $class;
|
|
|
|
/**
|
|
* @var string
|
|
*/
|
|
private $method;
|
|
|
|
/**
|
|
* @var class-string
|
|
*/
|
|
private $classWithConstants;
|
|
|
|
/**
|
|
* @var int
|
|
*/
|
|
private $argPosition;
|
|
|
|
/**
|
|
* @param class-string $classWithConstants
|
|
*/
|
|
public function __construct(string $class, string $method, int $argPosition, string $classWithConstants)
|
|
{
|
|
$this->class = $class;
|
|
$this->method = $method;
|
|
$this->classWithConstants = $classWithConstants;
|
|
$this->argPosition = $argPosition;
|
|
}
|
|
|
|
public function getObjectType(): ObjectType
|
|
{
|
|
return new ObjectType($this->class);
|
|
}
|
|
|
|
public function getMethod(): string
|
|
{
|
|
return $this->method;
|
|
}
|
|
|
|
/**
|
|
* @return class-string
|
|
*/
|
|
public function getClassWithConstants(): string
|
|
{
|
|
return $this->classWithConstants;
|
|
}
|
|
|
|
public function getArgPosition(): int
|
|
{
|
|
return $this->argPosition;
|
|
}
|
|
}
|