mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-19 06:18:07 +01:00
c726969380
fc10fce13d
[Rectify] [Php81] Enable Rectify on Readonly Property only (#1384)
45 lines
899 B
PHP
45 lines
899 B
PHP
<?php
|
|
|
|
declare (strict_types=1);
|
|
namespace Rector\Php80\ValueObject;
|
|
|
|
final class AnnotationToAttribute
|
|
{
|
|
/**
|
|
* @var class-string|string
|
|
* @readonly
|
|
*/
|
|
private $tag;
|
|
/**
|
|
* @var class-string
|
|
* @readonly
|
|
*/
|
|
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;
|
|
}
|
|
}
|