diff --git a/src/SAML2/XML/md/AffiliateMember.php b/src/SAML2/XML/md/AffiliateMember.php index ec1ac5f62..d58d4a032 100644 --- a/src/SAML2/XML/md/AffiliateMember.php +++ b/src/SAML2/XML/md/AffiliateMember.php @@ -5,8 +5,6 @@ namespace SimpleSAML\SAML2\XML\md; use SimpleSAML\SAML2\Assert\Assert as SAMLAssert; -use SimpleSAML\SAML2\Constants as C; -use SimpleSAML\SAML2\Exception\ProtocolViolationException; use SimpleSAML\XML\StringElementTrait; /** diff --git a/src/SAML2/XML/md/AffiliationDescriptor.php b/src/SAML2/XML/md/AffiliationDescriptor.php index fe2bcc19a..4d0e4286c 100644 --- a/src/SAML2/XML/md/AffiliationDescriptor.php +++ b/src/SAML2/XML/md/AffiliationDescriptor.php @@ -9,7 +9,6 @@ use SimpleSAML\Assert\Assert; use SimpleSAML\SAML2\Assert\Assert as SAMLAssert; use SimpleSAML\SAML2\Constants as C; -use SimpleSAML\SAML2\Exception\ProtocolViolationException; use SimpleSAML\XML\Exception\InvalidDOMElementException; use SimpleSAML\XML\Exception\TooManyElementsException; use SimpleSAML\XML\ExtendableAttributesTrait; diff --git a/tests/InterOperability/EntitiesDescriptorTest.php b/tests/InterOperability/EntitiesDescriptorTest.php index b47ec6a90..7b1641ab9 100644 --- a/tests/InterOperability/EntitiesDescriptorTest.php +++ b/tests/InterOperability/EntitiesDescriptorTest.php @@ -8,10 +8,7 @@ use Exception; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; -use SimpleSAML\Assert\AssertionFailedException; -use SimpleSAML\SAML2\Constants as C; use SimpleSAML\SAML2\Utils\XPath; -use SimpleSAML\SAML2\XML\md\EntitiesDescriptor; use SimpleSAML\SAML2\XML\md\EntityDescriptor; use SimpleSAML\XML\DOMDocumentFactory; @@ -51,8 +48,12 @@ private function parseMetadata(DOMElement $metadata): void // Test for an EntitiesDescriptor or EntityDescriptor $entityDescriptorElements = XPath::xpQuery($metadata, './saml_metadata:EntityDescriptor', $xpCache); $entitiesDescriptorElements = XPath::xpQuery($metadata, './saml_metadata:EntitiesDescriptor', $xpCache); - $descriptors = array_merge($entityDescriptorElements ?? [], $entitiesDescriptorElement ?? []); + $descriptors = array_merge( + is_null($entityDescriptorElements) ? $entityDescriptorElements : [], + is_null($entitiesDescriptorElements) ? $entitiesDescriptorElements : [], + ); foreach ($descriptors as $descriptor) { + /** @var \DOMElement $descriptor */ $this->parseMetadata($descriptor); } } elseif ($metadata->localName === 'EntityDescriptor') { diff --git a/tests/SAML2/Assert/EntityIDTest.php b/tests/SAML2/Assert/EntityIDTest.php index 73546b3ac..60966bbd6 100644 --- a/tests/SAML2/Assert/EntityIDTest.php +++ b/tests/SAML2/Assert/EntityIDTest.php @@ -7,9 +7,9 @@ use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; +use SimpleSAML\SAML2\Assert\Assert as SAML2Assert; use SimpleSAML\SAML2\Constants as C; use SimpleSAML\SAML2\Exception\ProtocolViolationException; -use SimpleSAML\SAML2\Assert\Assert as SAML2Assert; use SimpleSAML\XML\Exception\SchemaViolationException; use function str_pad; diff --git a/tests/SAML2/Assert/URITest.php b/tests/SAML2/Assert/URITest.php index 146697c97..31213b52b 100644 --- a/tests/SAML2/Assert/URITest.php +++ b/tests/SAML2/Assert/URITest.php @@ -7,8 +7,8 @@ use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; -use SimpleSAML\SAML2\Exception\ProtocolViolationException; use SimpleSAML\SAML2\Assert\Assert as SAML2Assert; +use SimpleSAML\SAML2\Exception\ProtocolViolationException; use SimpleSAML\XML\Exception\SchemaViolationException; /**