| Total Complexity | 5 |
| Total Lines | 54 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | class DNSName extends GeneralName |
||
| 18 | { |
||
| 19 | /** |
||
| 20 | * DNS name. |
||
| 21 | * |
||
| 22 | * @var string |
||
| 23 | */ |
||
| 24 | protected $_name; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * Constructor. |
||
| 28 | * |
||
| 29 | * @param string $name Domain name |
||
| 30 | */ |
||
| 31 | 26 | public function __construct(string $name) |
|
| 35 | 26 | } |
|
| 36 | |||
| 37 | /** |
||
| 38 | * {@inheritdoc} |
||
| 39 | * |
||
| 40 | * @return self |
||
| 41 | */ |
||
| 42 | 13 | public static function fromChosenASN1(UnspecifiedType $el): GeneralName |
|
| 43 | { |
||
| 44 | 13 | return new self($el->asIA5String()->string()); |
|
| 45 | } |
||
| 46 | |||
| 47 | /** |
||
| 48 | * {@inheritdoc} |
||
| 49 | */ |
||
| 50 | 3 | public function string(): string |
|
| 51 | { |
||
| 52 | 3 | return $this->_name; |
|
| 53 | } |
||
| 54 | |||
| 55 | /** |
||
| 56 | * Get DNS name. |
||
| 57 | * |
||
| 58 | * @return string |
||
| 59 | */ |
||
| 60 | 4 | public function name(): string |
|
| 61 | { |
||
| 62 | 4 | return $this->_name; |
|
| 63 | } |
||
| 64 | |||
| 65 | /** |
||
| 66 | * {@inheritdoc} |
||
| 67 | */ |
||
| 68 | 24 | protected function _choiceASN1(): TaggedType |
|
| 71 | } |
||
| 72 | } |
||
| 73 |