Skip to content

Commit d72a0e4

Browse files
author
b.kurshev
committed
fix: XMLBuilder phpstan support
1 parent 811f985 commit d72a0e4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/XMLBuilder.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ public function __construct(protected string $encoding = 'UTF-8', protected stri
4949
/**
5050
* Disable the root tag.
5151
*
52-
* @return self
52+
* @return static
5353
*/
54-
public function disableRootTag(): self
54+
public function disableRootTag(): static
5555
{
5656
return $this->setRootTag(false);
5757
}
@@ -61,9 +61,9 @@ public function disableRootTag(): self
6161
*
6262
* @param string|bool $tag the name to use as the root tag. Set to `false` to disable.
6363
*
64-
* @return self
64+
* @return static
6565
*/
66-
public function setRootTag(string | bool $tag): self
66+
public function setRootTag(string | bool $tag): static
6767
{
6868
$this->rootTag = $tag;
6969

@@ -150,7 +150,7 @@ protected function closeRootTag(): string
150150

151151
protected function getRootTag(): string
152152
{
153-
return is_string($this->rootTag) ? $this->rootTag : self::DEFAULT_ROOT;
153+
return is_string($this->rootTag) ? $this->rootTag : static::DEFAULT_ROOT;
154154
}
155155

156156
/**
@@ -170,7 +170,7 @@ protected function getRootTag(): string
170170
protected function getFieldName(string | int $field): string
171171
{
172172
if (! is_string($field)) {
173-
$useItemName = $this->rootTag === self::DEFAULT_ROOT || $this->forceItemName;
173+
$useItemName = $this->rootTag === static::DEFAULT_ROOT || $this->forceItemName;
174174

175175
return $useItemName ? $this->itemName : Str::singular($this->getRootTag());
176176
}

0 commit comments

Comments
 (0)