Skip to content

Commit eb2eb4d

Browse files
committed
Restore TypedTextContentTrait::setContent
1 parent 4cdecf9 commit eb2eb4d

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/XML/TypedTextContentTrait.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,21 @@ trait TypedTextContentTrait
2727
* @param \SimpleSAML\XMLSchema\Type\Interface\ValueTypeInterface $content
2828
*/
2929
public function __construct(
30-
protected ValueTypeInterface $content,
30+
ValueTypeInterface $content,
3131
) {
32+
$this->setContent($content);
33+
}
34+
35+
36+
/**
37+
* Set the content of the element.
38+
*
39+
* @param \SimpleSAML\XMLSchema\Type\Interface\ValueTypeInterface $content The value to go in the XML textContent
40+
*/
41+
protected function setContent(ValueTypeInterface $content): void
42+
{
43+
Assert::isAOf($content, self::getTextContentType(), InvalidValueTypeException::class);
44+
$this->content = $content;
3245
}
3346

3447

0 commit comments

Comments
 (0)