Skip to content

Commit

Permalink
Merge pull request #69 from spatie/revert-67-make-records-arrayable
Browse files Browse the repository at this point in the history
Revert "Make records arrayable"
  • Loading branch information
freekmurze authored Jul 30, 2021
2 parents 7dea3f4 + 5923f79 commit f9ca33b
Show file tree
Hide file tree
Showing 10 changed files with 1 addition and 118 deletions.
11 changes: 0 additions & 11 deletions src/Records/A.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
];
}
}
11 changes: 0 additions & 11 deletions src/Records/AAAA.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
];
}
}
13 changes: 0 additions & 13 deletions src/Records/CAA.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
];
}
}
11 changes: 0 additions & 11 deletions src/Records/CNAME.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
];
}
}
12 changes: 0 additions & 12 deletions src/Records/MX.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
];
}
}
11 changes: 0 additions & 11 deletions src/Records/NS.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
];
}
}
8 changes: 1 addition & 7 deletions src/Records/Record.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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)) {
Expand Down
17 changes: 0 additions & 17 deletions src/Records/SOA.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
];
}
}
14 changes: 0 additions & 14 deletions src/Records/SRV.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
];
}
}
11 changes: 0 additions & 11 deletions src/Records/TXT.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
];
}
}

0 comments on commit f9ca33b

Please sign in to comment.