From 765acc47548c87dc4946e718d80251885ca12212 Mon Sep 17 00:00:00 2001 From: yggverse Date: Sun, 23 Jun 2024 19:23:28 +0300 Subject: [PATCH] cleanup namespace --- src/Code.php | 23 ---------- src/Line.php | 67 ---------------------------- src/Link.php | 122 --------------------------------------------------- 3 files changed, 212 deletions(-) delete mode 100644 src/Code.php delete mode 100644 src/Line.php delete mode 100644 src/Link.php diff --git a/src/Code.php b/src/Code.php deleted file mode 100644 index a3fa800..0000000 --- a/src/Code.php +++ /dev/null @@ -1,23 +0,0 @@ -setData( - $data - ); - - $this->setEscaped( - $escaped - ); - - $this->setNumber( - $number - ); - } - - public function getData(): string - { - return $this->_data; - } - - public function setData( - string $data - ): void - { - $this->_data = $data; - } - - public function getEscaped(): bool - { - return $this->_escaped; - } - - public function setEscaped( - bool $escaped - ): void - { - $this->_escaped = $escaped; - } - - public function getNumber(): ?int - { - return $this->_number; - } - - public function setNumber( - ?int $number - ): void - { - $this->_number = $number; - } -} diff --git a/src/Link.php b/src/Link.php deleted file mode 100644 index 6410382..0000000 --- a/src/Link.php +++ /dev/null @@ -1,122 +0,0 @@ -setAddress( - $address - ); - - $this->setAlt( - $alt - ); - - $this->setDate( - $date - ); - } - - public function setAddress( - string $address - ): void - { - $address = trim( - $address - ); - - if (empty($address)) - { - throw new \Exception( - _('Address required') - ); - } - - $this->_address = $address; - } - - public function getAddress(): string - { - return $this->_address; - } - - public function setAlt( - ?string $alt - ): void - { - if ($alt) - { - $alt = trim( - $alt - ); - } - - $this->_alt = $alt; - } - - public function getAlt(): ?string - { - return $this->_alt; - } - - public function setDate( - ?string $date - ): void - { - if ($date) - { - $date = trim( - $date - ); - - if (!preg_match('/^\d{4}-\d{2}-\d{2}$/')) - { - throw new \Exception( - _('Date does not match format YYYY-MM-DD') - ); - } - } - - $this->_date = $date; - } - - public function getDate(): ?string - { - return $this->_date; - } - - public function toString(): string - { - $parts = [ - '=>', - $this->getAddress() - ]; - - if ($date = $this->getDate()) - { - $parts[] = $date; - } - - if ($alt = $this->getAlt()) - { - $parts[] = $alt; - } - - return implode( - ' ', - $parts - ); - } -} \ No newline at end of file