2021-05-23 12:45:00 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare (strict_types=1);
|
|
|
|
namespace Rector\DowngradePhp80\ValueObject;
|
|
|
|
|
|
|
|
final class DowngradeAttributeToAnnotation
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
private $attributeClass;
|
|
|
|
/**
|
2021-06-22 15:56:17 +00:00
|
|
|
* @var string|null
|
2021-05-23 12:45:00 +00:00
|
|
|
*/
|
|
|
|
private $tag;
|
|
|
|
/**
|
|
|
|
* @param class-string $attributeClass
|
2021-06-22 15:56:17 +00:00
|
|
|
* @param class-string|string|null $tag
|
2021-05-23 12:45:00 +00:00
|
|
|
*/
|
2021-06-22 15:56:17 +00:00
|
|
|
public function __construct(string $attributeClass, ?string $tag = null)
|
2021-05-23 12:45:00 +00:00
|
|
|
{
|
|
|
|
$this->attributeClass = $attributeClass;
|
|
|
|
$this->tag = $tag;
|
|
|
|
}
|
|
|
|
public function getAttributeClass() : string
|
|
|
|
{
|
|
|
|
return $this->attributeClass;
|
|
|
|
}
|
|
|
|
public function getTag() : string
|
|
|
|
{
|
2021-06-22 15:56:17 +00:00
|
|
|
if ($this->tag === null) {
|
|
|
|
return $this->attributeClass;
|
|
|
|
}
|
2021-05-23 12:45:00 +00:00
|
|
|
return $this->tag;
|
|
|
|
}
|
|
|
|
}
|