rector/rules/Php80/ValueObject/AnnotationToAttribute.php
Tomas Votruba abe47f2ff5 Updated Rector to commit af1cbb92fdd8792ea2020a08e546efe4adfc1701
af1cbb92fd [Core] Add Smarty Support for PhpFilesFinder check non-PHP files (#736)
2021-08-22 21:06:43 +00:00

43 lines
851 B
PHP

<?php
declare (strict_types=1);
namespace Rector\Php80\ValueObject;
final class AnnotationToAttribute
{
/**
* @var string
*/
private $tag;
/**
* @var string|null
*/
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;
}
}