diff --git a/composer.json b/composer.json index fd6b491..48a5715 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ }, "require": { "php": "^8.1", - "8fold/php-xml-builder": "^1.3" + "8fold/php-xml-builder": "^2.0" }, "require-dev": { "phpstan/phpstan": "^1.9", diff --git a/src/Sitemap.php b/src/Sitemap.php index d6268d1..1c92b6e 100644 --- a/src/Sitemap.php +++ b/src/Sitemap.php @@ -3,7 +3,8 @@ namespace Eightfold\Sitemap; -use Eightfold\XMLBuilder\Contracts\Buildable; +use Stringable; +// use Eightfold\XMLBuilder\Contracts\Buildable; use DateTime; @@ -28,7 +29,7 @@ * 0.3-0.0: FAQs, outdated info, old press releases, completely static pages that * are still relevant enough to keep from deleting entirely. */ -class Sitemap implements Buildable +class Sitemap implements Stringable { private const SCHEMA_VERSION = 'http://www.sitemaps.org/schemas/sitemap/0.9'; @@ -74,11 +75,6 @@ public function addUrl( return $this; } - public function build(): string - { - return (string) $this; - } - public function __toString(): string { return (string) Document::urlset( diff --git a/src/Url.php b/src/Url.php index d013738..4833fab 100644 --- a/src/Url.php +++ b/src/Url.php @@ -3,7 +3,8 @@ namespace Eightfold\Sitemap; -use Eightfold\XMLBuilder\Contracts\Buildable; +use Stringable; +// use Eightfold\XMLBuilder\Contracts\Buildable; use DateTime; @@ -11,7 +12,7 @@ use Eightfold\Sitemap\Changefreq; -class Url implements Buildable +class Url implements Stringable { private Element|string $lastmod = ''; @@ -58,11 +59,6 @@ public function withPriority(float $priority): self return $this; } - public function build(): string - { - return (string) $this; - } - public function __toString(): string { return (string) Element::url(