rector/rules/Php80/ValueObject/AnnotationToAttribute.php
Tomas Votruba bdc1df40d9 Updated Rector to commit 1cc465b4d508238445494313f04a6a56d4e8ca1d
1cc465b4d5 [CodingStyle] Skip RemoveUnusedAliasRector when same class in use statement exists, but not used (#732)
2021-08-22 21:22:18 +00:00

43 lines
865 B
PHP

<?php
declare (strict_types=1);
namespace Rector\Php80\ValueObject;
final class AnnotationToAttribute
{
/**
* @var class-string|string
*/
private $tag;
/**
* @var class-string
*/
private $attributeClass;
/**
* @param class-string|string $tag
* @param class-string $attributeClass
*/
public function __construct(string $tag, ?string $attributeClass = null)
{
$this->tag = $tag;
$this->attributeClass = $attributeClass;
}
/**
* @return class-string|string
*/
public function getTag() : string
{
return $this->tag;
}
/**
* @return class-string
*/
public function getAttributeClass() : string
{
if ($this->attributeClass === null) {
return $this->tag;
}
return $this->attributeClass;
}
}