From 8560dea3a4807c979479e27c16b027c1acc08f29 Mon Sep 17 00:00:00 2001 From: Ben van Hartingsveldt Date: Thu, 20 Feb 2025 12:44:57 +0100 Subject: [PATCH] Convert quotes to single quotes --- src/Fields/CharacterString.php | 3 ++- src/Fields/IPv6Address.php | 2 +- src/Types/WKS.php | 2 -- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Fields/CharacterString.php b/src/Fields/CharacterString.php index 492a0e1..60f128e 100644 --- a/src/Fields/CharacterString.php +++ b/src/Fields/CharacterString.php @@ -16,7 +16,7 @@ class CharacterString implements Field{ */ public function __construct(string $value){ if(strlen($value)>255){ - throw new DNSFieldException("Character string can have 255 characters at most."); + throw new DNSFieldException('Character string can have 255 characters at most.'); } $this->value = $value; } @@ -52,6 +52,7 @@ public function serializeToWireFormat(): string{ /** * @param string $data * @return CharacterString + * @throws DNSFieldException */ public static function deserializeFromPresentationFormat(string $data): CharacterString{ $isQuoted = ($data[0] ?? null)===self::QUOTE; diff --git a/src/Fields/IPv6Address.php b/src/Fields/IPv6Address.php index 6867ba3..483e9ce 100644 --- a/src/Fields/IPv6Address.php +++ b/src/Fields/IPv6Address.php @@ -55,7 +55,7 @@ public static function deserializeFromPresentationFormat(string $data): IPv6Addr */ public static function deserializeFromWireFormat(string $data): IPv6Address{ if(strlen($data)!==16){ - throw new DNSFieldException("Binary IPv6 address should be 16 octets."); + throw new DNSFieldException('Binary IPv6 address should be 16 octets.'); } return new self(inet_ntop($data)); } diff --git a/src/Types/WKS.php b/src/Types/WKS.php index 7dd2b8f..9867519 100644 --- a/src/Types/WKS.php +++ b/src/Types/WKS.php @@ -4,9 +4,7 @@ use YOCLIB\DNS\Exceptions\DNSTypeException; use YOCLIB\DNS\Fields\Bitmap; use YOCLIB\DNS\Fields\Field; -use YOCLIB\DNS\Fields\FQDN; use YOCLIB\DNS\Fields\IPv4Address; -use YOCLIB\DNS\Fields\UnsignedInteger32; use YOCLIB\DNS\Fields\UnsignedInteger8; class WKS extends Type{