Skip to content

Commit

Permalink
Update PHPDoc.
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelwilliams committed Nov 30, 2020
1 parent 94ecc1c commit 52cd85f
Show file tree
Hide file tree
Showing 37 changed files with 23 additions and 359 deletions.
4 changes: 2 additions & 2 deletions lib/Parser/ZoneFileFetcherInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ interface ZoneFileFetcherInterface
/**
* Fetches the contents of a zone file with a given path.
*
* @param string $path The path, relative or otherwise, to a zone file.
* @param string $path the path, relative or otherwise, to a zone file
*
* @return string The text contents of the zone file.
* @return string the text contents of the zone file
*/
public function fetch(string $path): string;
}
10 changes: 0 additions & 10 deletions lib/Rdata/A.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,12 @@ public function getAddress(): ?string
return $this->address;
}

/**
* {@inheritdoc}
*/
public function toText(): string
{
return $this->address ?? '';
}

/**
* {@inheritdoc}
*
* @throws \InvalidArgumentException
*/
public function toWire(): string
Expand All @@ -69,17 +64,12 @@ public function toWire(): string
return $encoded;
}

/**
* {@inheritdoc}
*/
public function fromText(string $text): void
{
$this->setAddress($text);
}

/**
* {@inheritdoc}
*
* @throws DecodeException
*/
public function fromWire(string $rdata, int &$offset = 0, ?int $rdLength = null): void
Expand Down
2 changes: 0 additions & 2 deletions lib/Rdata/AAAA.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ public function setAddress(string $address): void
}

/**
* {@inheritdoc}
*
* @throws DecodeException
*/
public function fromWire(string $rdata, int &$offset = 0, ?int $rdLength = null): void
Expand Down
11 changes: 0 additions & 11 deletions lib/Rdata/AFSDB.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ public function setHostname(string $hostname): void
}

/**
* {@inheritdoc}
*
* @throws \InvalidArgumentException
*/
public function toText(): string
Expand All @@ -70,17 +68,11 @@ public function toText(): string
return sprintf('%d %s', $this->subType, $this->hostname);
}

/**
* {@inheritdoc}
*/
public function toWire(): string
{
return pack('n', $this->subType).Message::encodeName($this->hostname);
}

/**
* {@inheritdoc}
*/
public function fromText(string $text): void
{
$rdata = explode(' ', $text);
Expand All @@ -89,9 +81,6 @@ public function fromText(string $text): void
$this->setHostname($rdata[1]);
}

/**
* {@inheritdoc}
*/
public function fromWire(string $rdata, int &$offset = 0, ?int $rdLength = null): void
{
$this->setSubType(unpack('n', $rdata, $offset)[1]);
Expand Down
11 changes: 0 additions & 11 deletions lib/Rdata/APL.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,6 @@ public function getExcludedAddressRanges(): array
return $this->excludedAddressRanges;
}

/**
* {@inheritdoc}
*/
public function toText(): string
{
$string = '';
Expand All @@ -85,9 +82,6 @@ public function toText(): string
return rtrim($string, ' ');
}

/**
* {@inheritdoc}
*/
public function toWire(): string
{
$encoded = '';
Expand All @@ -112,8 +106,6 @@ public function toWire(): string
}

/**
* {@inheritdoc}
*
* @throws \Exception
*/
public function fromText(string $text): void
Expand All @@ -132,9 +124,6 @@ public function fromText(string $text): void
}
}

/**
* {@inheritdoc}
*/
public function fromWire(string $rdata, int &$offset = 0, ?int $rdLength = null): void
{
$end = $offset + ($rdLength ?? strlen($rdata));
Expand Down
9 changes: 0 additions & 9 deletions lib/Rdata/CAA.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,6 @@ public function setValue(string $value): void
$this->value = $value;
}

/**
* {@inheritdoc}
*/
public function toText(): string
{
if (!isset($this->tag) || !isset($this->flag) || !isset($this->value)) {
Expand All @@ -139,9 +136,6 @@ public function toWire(): string
$this->value;
}

/**
* {@inheritdoc}
*/
public function fromWire(string $rdata, int &$offset = 0, ?int $rdLength = null): void
{
$this->setFlag(ord($rdata[$offset]));
Expand All @@ -159,9 +153,6 @@ public function fromWire(string $rdata, int &$offset = 0, ?int $rdLength = null)
$offset = $offset += $valueLen;
}

/**
* {@inheritdoc}
*/
public function fromText(string $text): void
{
$rdata = explode(Tokens::SPACE, $text);
Expand Down
12 changes: 0 additions & 12 deletions lib/Rdata/CERT.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,6 @@ public function getCertificate(): string
return $this->certificate;
}

/**
* {@inheritdoc}
*/
public function toText(): string
{
$type = (array_key_exists($this->certificateType, self::MNEMONICS)) ? self::MNEMONICS[$this->certificateType] : (string) $this->certificateType;
Expand All @@ -152,17 +149,11 @@ public function toText(): string
return sprintf('%s %s %s %s', $type, (string) $this->keyTag, $algorithm, base64_encode($this->certificate));
}

/**
* {@inheritdoc}
*/
public function toWire(): string
{
return pack('nnC', $this->certificateType, $this->keyTag, $this->algorithm).$this->certificate;
}

/**
* {@inheritdoc}
*/
public function fromText(string $text): void
{
$rdata = explode(Tokens::SPACE, $text);
Expand All @@ -172,9 +163,6 @@ public function fromText(string $text): void
$this->setCertificate(base64_decode(implode('', $rdata)));
}

/**
* {@inheritdoc}
*/
public function fromWire(string $rdata, int &$offset = 0, ?int $rdLength = null): void
{
$integers = unpack('ntype/nkeyTag/Calgorithm', $rdata, $offset);
Expand Down
12 changes: 0 additions & 12 deletions lib/Rdata/CNAME.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,11 @@ public function getTarget(): ?string
return $this->target;
}

/**
* {@inheritdoc}
*/
public function toText(): string
{
return $this->target ?? '';
}

/**
* {@inheritdoc}
*/
public function toWire(): string
{
if (null === $this->target) {
Expand All @@ -63,17 +57,11 @@ public function toWire(): string
return Message::encodeName($this->target);
}

/**
* {@inheritdoc}
*/
public function fromText(string $text): void
{
$this->setTarget($text);
}

/**
* {@inheritdoc}
*/
public function fromWire(string $rdata, int &$offset = 0, ?int $rdLength = null): void
{
$this->setTarget(Message::decodeName($rdata, $offset));
Expand Down
10 changes: 0 additions & 10 deletions lib/Rdata/CSYNC.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,27 +78,19 @@ public function setFlags(int $flags): void
$this->flags = $flags;
}

/**
* {@inheritdoc}
*/
public function toText(): string
{
return sprintf('%d %d %s', $this->soaSerial, $this->flags, implode(Tokens::SPACE, $this->types));
}

/**
* {@inheritdoc}
*
* @throws UnsupportedTypeException
*/
public function toWire(): string
{
return pack('Nn', $this->soaSerial, $this->flags).NSEC::renderBitmap($this->types);
}

/**
* {@inheritdoc}
*/
public function fromText(string $text): void
{
$rdata = explode(Tokens::SPACE, $text);
Expand All @@ -108,8 +100,6 @@ public function fromText(string $text): void
}

/**
* {@inheritdoc}
*
* @throws UnsupportedTypeException|DecodeException
*/
public function fromWire(string $rdata, int &$offset = 0, ?int $rdLength = null): void
Expand Down
10 changes: 0 additions & 10 deletions lib/Rdata/DHCID.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,18 +177,13 @@ public function calculateDigest(): void
}

/**
* {@inheritdoc}
*
* @throws \BadMethodCallException
*/
public function toText(): string
{
return base64_encode($this->toWire());
}

/**
* {@inheritdoc}
*/
public function toWire(): string
{
if (null === $this->digest) {
Expand All @@ -199,8 +194,6 @@ public function toWire(): string
}

/**
* {@inheritdoc}
*
* @throws \Exception
*/
public function fromText(string $text): void
Expand All @@ -212,9 +205,6 @@ public function fromText(string $text): void
$this->fromWire($decoded);
}

/**
* {@inheritdoc}
*/
public function fromWire(string $rdata, int &$offset = 0, ?int $rdLength = null): void
{
$rdLength = $rdLength ?? strlen($rdata);
Expand Down
3 changes: 0 additions & 3 deletions lib/Rdata/DNSKEY.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ class DNSKEY extends KEY
*/
protected $protocol = 3;

/**
* {@inheritdoc}
*/
public function setProtocol(int $protocol): void
{
if (3 !== $protocol) {
Expand Down
12 changes: 0 additions & 12 deletions lib/Rdata/DS.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,6 @@ public function calculateDigest(string $owner, DNSKEY $dnskey): void
$this->digest = sha1(Message::encodeName(strtolower($owner)).$dnskey->toWire(), true);
}

/**
* {@inheritdoc}
*/
public function toText(): string
{
return sprintf(
Expand All @@ -125,17 +122,11 @@ public function toText(): string
);
}

/**
* {@inheritdoc}
*/
public function toWire(): string
{
return pack('nCC', $this->keyTag, $this->algorithm, $this->digestType).$this->digest;
}

/**
* {@inheritdoc}
*/
public function fromText(string $text): void
{
$rdata = explode(Tokens::SPACE, $text);
Expand All @@ -148,9 +139,6 @@ public function fromText(string $text): void
$this->setDigest($digest);
}

/**
* {@inheritdoc}
*/
public function fromWire(string $rdata, int &$offset = 0, ?int $rdLength = null): void
{
$digestLen = ($rdLength ?? strlen($rdata)) - 4;
Expand Down
12 changes: 0 additions & 12 deletions lib/Rdata/HINFO.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,34 +62,22 @@ public function getOs(): ?string
return $this->os;
}

/**
* {@inheritdoc}
*/
public function toText(): string
{
return sprintf('"%s" "%s"', $this->cpu ?? '', $this->os ?? '');
}

/**
* {@inheritdoc}
*/
public function toWire(): string
{
return $this->toText();
}

/**
* {@inheritdoc}
*/
public function fromWire(string $rdata, int &$offset = 0, ?int $rdLength = null): void
{
$this->fromText(substr($rdata, $offset, $rdLength ?? strlen($rdata)));
$offset += $rdLength;
}

/**
* {@inheritdoc}
*/
public function fromText(string $text): void
{
$string = new StringIterator($text);
Expand Down
Loading

0 comments on commit 52cd85f

Please sign in to comment.