We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4cdecf9 commit eb2eb4dCopy full SHA for eb2eb4d
src/XML/TypedTextContentTrait.php
@@ -27,8 +27,21 @@ trait TypedTextContentTrait
27
* @param \SimpleSAML\XMLSchema\Type\Interface\ValueTypeInterface $content
28
*/
29
public function __construct(
30
- protected ValueTypeInterface $content,
+ ValueTypeInterface $content,
31
) {
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;
45
}
46
47
0 commit comments