diff --git a/src/XMLBuilder.php b/src/XMLBuilder.php index a1700db..192ac6f 100644 --- a/src/XMLBuilder.php +++ b/src/XMLBuilder.php @@ -49,9 +49,9 @@ public function __construct(protected string $encoding = 'UTF-8', protected stri /** * Disable the root tag. * - * @return self + * @return static */ - public function disableRootTag(): self + public function disableRootTag(): static { return $this->setRootTag(false); } @@ -61,9 +61,9 @@ public function disableRootTag(): self * * @param string|bool $tag the name to use as the root tag. Set to `false` to disable. * - * @return self + * @return static */ - public function setRootTag(string | bool $tag): self + public function setRootTag(string | bool $tag): static { $this->rootTag = $tag; @@ -150,7 +150,7 @@ protected function closeRootTag(): string protected function getRootTag(): string { - return is_string($this->rootTag) ? $this->rootTag : self::DEFAULT_ROOT; + return is_string($this->rootTag) ? $this->rootTag : static::DEFAULT_ROOT; } /** @@ -170,7 +170,7 @@ protected function getRootTag(): string protected function getFieldName(string | int $field): string { if (! is_string($field)) { - $useItemName = $this->rootTag === self::DEFAULT_ROOT || $this->forceItemName; + $useItemName = $this->rootTag === static::DEFAULT_ROOT || $this->forceItemName; return $useItemName ? $this->itemName : Str::singular($this->getRootTag()); }