rector/rules/Php80/ValueObject/AnnotationToAttribute.php
Tomas Votruba 0c3832254b Updated Rector to commit a54d7eece452cc28345046b613643495ae5469c7
a54d7eece4 allow to put single class to AnnotationToAttribute
2021-06-05 21:47:54 +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;
}
}