TXTData   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 6
c 1
b 0
f 1
dl 0
loc 26
rs 10
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A toArray() 0 4 1
A getValue() 0 3 1
A __unserialize() 0 3 1
A __construct() 0 2 1
A __toString() 0 3 1
1
<?php
2
3
namespace RemotelyLiving\PHPDNS\Entities;
4
5
final class TXTData extends DataAbstract implements \Stringable
6
{
7
    public function __construct(private string $value)
8
    {
9
    }
10
11
    public function __toString(): string
12
    {
13
        return $this->value;
14
    }
15
16
    public function getValue(): string
17
    {
18
        return $this->value;
19
    }
20
21
    public function toArray(): array
22
    {
23
        return [
24
            'value' => $this->value,
25
        ];
26
    }
27
28
    public function __unserialize(array $unserialized): void
29
    {
30
        $this->value = $unserialized['value'];
31
    }
32
}
33