Skip to content

Commit 7b9202d

Browse files
Replace strpos with str_starts_with (#247)
1 parent e20bfb0 commit 7b9202d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ArrayToXml.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ protected function convertElement(DOMElement $element, mixed $value): void
184184
$this->addNumericNode($element, $data);
185185
} elseif (str_starts_with($key, '__custom:')) {
186186
$this->addNode($element, str_replace('\:', ':', preg_split('/(?<!\\\):/', $key)[1]), $data);
187-
} elseif (strpos($key, '_comment') === 0 || strpos($key, '@comment') === 0) {
187+
} elseif (str_starts_with($key, '_comment') || str_starts_with($key, '@comment')) {
188188
$element->appendChild(new \DOMComment($data));
189189
} else {
190190
$this->addNode($element, $key, $data);

0 commit comments

Comments
 (0)