2020-08-26 10:54:53 +00:00
|
|
|
<?php
|
|
|
|
|
2021-05-09 20:15:43 +00:00
|
|
|
declare (strict_types=1);
|
2022-06-06 17:12:56 +00:00
|
|
|
namespace Rector\Transform\ValueObject;
|
2020-08-26 10:54:53 +00:00
|
|
|
|
2024-01-02 02:40:38 +00:00
|
|
|
use Rector\Validation\RectorAssert;
|
2020-08-26 10:54:53 +00:00
|
|
|
final class StringToClassConstant
|
|
|
|
{
|
|
|
|
/**
|
2023-06-11 23:01:39 +00:00
|
|
|
* @readonly
|
2020-08-26 10:54:53 +00:00
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
private $string;
|
|
|
|
/**
|
2023-06-11 23:01:39 +00:00
|
|
|
* @readonly
|
2022-08-06 15:23:35 +00:00
|
|
|
* @var string
|
2020-08-26 10:54:53 +00:00
|
|
|
*/
|
|
|
|
private $class;
|
|
|
|
/**
|
2023-06-11 23:01:39 +00:00
|
|
|
* @readonly
|
2020-08-26 10:54:53 +00:00
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
private $constant;
|
|
|
|
public function __construct(string $string, string $class, string $constant)
|
|
|
|
{
|
|
|
|
$this->string = $string;
|
|
|
|
$this->class = $class;
|
|
|
|
$this->constant = $constant;
|
2022-06-07 08:22:29 +00:00
|
|
|
RectorAssert::className($class);
|
2020-08-26 10:54:53 +00:00
|
|
|
}
|
2021-05-09 20:15:43 +00:00
|
|
|
public function getString() : string
|
2020-08-26 10:54:53 +00:00
|
|
|
{
|
|
|
|
return $this->string;
|
|
|
|
}
|
2021-05-09 20:15:43 +00:00
|
|
|
public function getClass() : string
|
2020-08-26 10:54:53 +00:00
|
|
|
{
|
|
|
|
return $this->class;
|
|
|
|
}
|
2021-05-09 20:15:43 +00:00
|
|
|
public function getConstant() : string
|
2020-08-26 10:54:53 +00:00
|
|
|
{
|
|
|
|
return $this->constant;
|
|
|
|
}
|
|
|
|
}
|