Skip to content

Commit

Permalink
md:Organization add more assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdijen committed May 16, 2023
1 parent 2676b1c commit 71e0174
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/SAML2/XML/md/Organization.php
Expand Up @@ -8,6 +8,7 @@
use DOMElement;
use Exception;
use SimpleSAML\Assert\Assert;
use SimpleSAML\SAML2\Exception\ProtocolViolationException;
use SimpleSAML\SAML2\XML\ExtendableElementTrait;
use SimpleSAML\XML\Exception\InvalidDOMElementException;
use SimpleSAML\XML\Exception\MissingElementException;
Expand Down Expand Up @@ -49,6 +50,11 @@ public function __construct(
Assert::allIsInstanceOf($organizationDisplayName, OrganizationDisplayName::class);
Assert::allIsInstanceOf($organizationURL, OrganizationURL::class);

// [One or More]
Assert::minCount($organizationName, 1, ProtocolViolationException::class);
Assert::minCount($organizationDisplayName, 1, ProtocolViolationException::class);
Assert::minCount($organizationURL, 1, ProtocolViolationException::class);

$this->setExtensions($extensions);
$this->setAttributesNS($namespacedAttributes);
}
Expand Down

0 comments on commit 71e0174

Please sign in to comment.