diff --git a/src/Records/A.php b/src/Records/A.php index 0b83015..f359399 100644 --- a/src/Records/A.php +++ b/src/Records/A.php @@ -26,15 +26,4 @@ public function __toString(): string { return "{$this->host}.\t\t{$this->ttl}\t{$this->class}\t{$this->type}\t{$this->ip}"; } - - public function toArray() - { - return [ - 'host' => $this->host, - 'ttl' => $this->ttl, - 'class' => $this->class, - 'type' => $this->type, - 'ip' => $this->ip, - ]; - } } diff --git a/src/Records/AAAA.php b/src/Records/AAAA.php index ec94f87..e551dab 100644 --- a/src/Records/AAAA.php +++ b/src/Records/AAAA.php @@ -26,15 +26,4 @@ public function __toString(): string { return "{$this->host}.\t\t{$this->ttl}\t{$this->class}\t{$this->type}\t{$this->ipv6}"; } - - public function toArray() - { - return [ - 'host' => $this->host, - 'ttl' => $this->ttl, - 'class' => $this->class, - 'type' => $this->type, - 'ipv6' => $this->ipv6, - ]; - } } diff --git a/src/Records/CAA.php b/src/Records/CAA.php index d46ea22..759f41f 100644 --- a/src/Records/CAA.php +++ b/src/Records/CAA.php @@ -42,17 +42,4 @@ protected function castValue(string $value): string { return $this->prepareText($value); } - - public function toArray() - { - return [ - 'host' => $this->host, - 'ttl' => $this->ttl, - 'class' => $this->class, - 'type' => $this->type, - 'flags' => $this->flags, - 'tag' => $this->tag, - 'value' => $this->value, - ]; - } } diff --git a/src/Records/CNAME.php b/src/Records/CNAME.php index ab09bdf..9a43311 100644 --- a/src/Records/CNAME.php +++ b/src/Records/CNAME.php @@ -31,15 +31,4 @@ protected function castTarget(string $value): string { return $this->prepareDomain($value); } - - public function toArray() - { - return [ - 'host' => $this->host, - 'ttl' => $this->ttl, - 'class' => $this->class, - 'type' => $this->type, - 'target' => $this->target, - ]; - } } diff --git a/src/Records/MX.php b/src/Records/MX.php index 448fc4b..3ff75fe 100644 --- a/src/Records/MX.php +++ b/src/Records/MX.php @@ -39,16 +39,4 @@ protected function castTarget(string $value): string { return $this->prepareDomain($value); } - - public function toArray() - { - return [ - 'host' => $this->host, - 'ttl' => $this->ttl, - 'class' => $this->class, - 'type' => $this->type, - 'pri' => $this->pri, - 'target' => $this->target, - ]; - } } diff --git a/src/Records/NS.php b/src/Records/NS.php index f6454ce..6980b4e 100644 --- a/src/Records/NS.php +++ b/src/Records/NS.php @@ -31,15 +31,4 @@ protected function castTarget(string $value): string { return $this->prepareDomain($value); } - - public function toArray() - { - return [ - 'host' => $this->host, - 'ttl' => $this->ttl, - 'class' => $this->class, - 'type' => $this->type, - 'target' => $this->target, - ]; - } } diff --git a/src/Records/Record.php b/src/Records/Record.php index 6b17846..04d734e 100644 --- a/src/Records/Record.php +++ b/src/Records/Record.php @@ -3,7 +3,6 @@ namespace Spatie\Dns\Records; use BadMethodCallException; -use Illuminate\Contracts\Support\Arrayable; use ReflectionClass; use Spatie\Dns\Exceptions\InvalidArgument; use Spatie\Dns\Support\Domain; @@ -15,7 +14,7 @@ * @method string class() * @method string type() */ -abstract class Record implements Stringable, Arrayable +abstract class Record implements Stringable { protected string $host; protected int $ttl; @@ -59,11 +58,6 @@ abstract public static function parse(string $line): self; abstract public function __toString(): string; - /** - * @return array - */ - abstract public function toArray(); - public function __call(string $name, array $arguments) { if (property_exists($this, $name)) { diff --git a/src/Records/SOA.php b/src/Records/SOA.php index d035598..f585ab8 100644 --- a/src/Records/SOA.php +++ b/src/Records/SOA.php @@ -79,21 +79,4 @@ protected function castMinimumTtl($value): int { return $this->prepareInt($value); } - - public function toArray() - { - return [ - 'host' => $this->host, - 'ttl' => $this->ttl, - 'class' => $this->class, - 'type' => $this->type, - 'mname' => $this->mname, - 'rname' => $this->rname, - 'serial' => $this->serial, - 'refresh' => $this->refresh, - 'retry' => $this->retry, - 'expire' => $this->expire, - 'minimum-ttl' => $this->minimum_ttl, - ]; - } } diff --git a/src/Records/SRV.php b/src/Records/SRV.php index bd2b09a..ac1fe33 100644 --- a/src/Records/SRV.php +++ b/src/Records/SRV.php @@ -55,18 +55,4 @@ protected function castTarget(string $value): string { return $this->prepareDomain($value); } - - public function toArray() - { - return [ - 'host' => $this->host, - 'ttl' => $this->ttl, - 'class' => $this->class, - 'type' => $this->type, - 'pri' => $this->pri, - 'weight' => $this->weight, - 'port' => $this->port, - 'target' => $this->target, - ]; - } } diff --git a/src/Records/TXT.php b/src/Records/TXT.php index cdade45..400ab0d 100644 --- a/src/Records/TXT.php +++ b/src/Records/TXT.php @@ -31,15 +31,4 @@ protected function castTxt(string $value): string { return $this->prepareText($value); } - - public function toArray() - { - return [ - 'host' => $this->host, - 'ttl' => $this->ttl, - 'class' => $this->class, - 'type' => $this->type, - 'txt' => $this->txt, - ]; - } }