Skip to content

Commit 5f2e2f0

Browse files
Implement getStringAttributeWithDefault()
1 parent d7f6229 commit 5f2e2f0

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/TextUI/Configuration/Xml/Loader.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -581,6 +581,15 @@ private function getStringAttribute(DOMElement $element, string $attribute): ?st
581581
return $element->getAttribute($attribute);
582582
}
583583

584+
private function getStringAttributeWithDefault(DOMElement $element, string $attribute, string $default): string
585+
{
586+
if (!$element->hasAttribute($attribute)) {
587+
return $default;
588+
}
589+
590+
return $element->getAttribute($attribute);
591+
}
592+
584593
private function getInteger(string $value, int $default): int
585594
{
586595
if (is_numeric($value)) {

0 commit comments

Comments
 (0)