Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdijen committed Jul 23, 2024
1 parent d926eb0 commit ec56649
Show file tree
Hide file tree
Showing 25 changed files with 10 additions and 26 deletions.
1 change: 0 additions & 1 deletion src/SAML2/XML/alg/DigestMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
use SimpleSAML\SAML2\Assert\Assert as SAMLAssert;
use SimpleSAML\XML\Chunk;
use SimpleSAML\XML\Exception\InvalidDOMElementException;
use SimpleSAML\XML\Exception\SchemaViolationException;
use SimpleSAML\XML\ExtendableElementTrait;
use SimpleSAML\XML\XsNamespace as NS;

Expand Down
1 change: 0 additions & 1 deletion src/SAML2/XML/alg/SigningMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
use SimpleSAML\SAML2\Assert\Assert as SAMLAssert;
use SimpleSAML\XML\Chunk;
use SimpleSAML\XML\Exception\InvalidDOMElementException;
use SimpleSAML\XML\Exception\SchemaViolationException;
use SimpleSAML\XML\ExtendableElementTrait;
use SimpleSAML\XML\XsNamespace as NS;

Expand Down
1 change: 0 additions & 1 deletion src/SAML2/XML/ecp/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
use SimpleSAML\SOAP\Constants as C;
use SimpleSAML\XML\Exception\InvalidDOMElementException;
use SimpleSAML\XML\Exception\MissingAttributeException;
use SimpleSAML\XML\Exception\SchemaViolationException;

/**
* Class representing the ECP Response element.
Expand Down
1 change: 0 additions & 1 deletion src/SAML2/XML/ecp/SubjectConfirmation.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
use SimpleSAML\SOAP\Constants as C;
use SimpleSAML\XML\Exception\InvalidDOMElementException;
use SimpleSAML\XML\Exception\MissingAttributeException;
use SimpleSAML\XML\Exception\SchemaViolationException;
use SimpleSAML\XML\Exception\TooManyElementsException;

/**
Expand Down
1 change: 0 additions & 1 deletion src/SAML2/XML/md/AbstractEndpointType.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
use SimpleSAML\XML\Attribute as XMLAttribute;
use SimpleSAML\XML\Chunk;
use SimpleSAML\XML\Exception\InvalidDOMElementException;
use SimpleSAML\XML\Exception\SchemaViolationException;
use SimpleSAML\XML\ExtendableAttributesTrait;
use SimpleSAML\XML\ExtendableElementTrait;
use SimpleSAML\XML\SerializableElementInterface;
Expand Down
1 change: 0 additions & 1 deletion src/SAML2/XML/md/AbstractLocalizedURI.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

use SimpleSAML\Assert\Assert;
use SimpleSAML\SAML2\Assert\Assert as SAMLAssert;
use SimpleSAML\XML\Exception\SchemaViolationException;

/**
* Abstract class implementing LocalizedURIType.
Expand Down
1 change: 0 additions & 1 deletion src/SAML2/XML/md/AffiliateMember.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
use SimpleSAML\SAML2\Assert\Assert as SAMLAssert;
use SimpleSAML\SAML2\Constants as C;
use SimpleSAML\SAML2\Exception\ProtocolViolationException;
use SimpleSAML\XML\Exception\SchemaViolationException;
use SimpleSAML\XML\StringElementTrait;

/**
Expand Down
1 change: 0 additions & 1 deletion src/SAML2/XML/md/AffiliationDescriptor.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
use SimpleSAML\SAML2\Constants as C;
use SimpleSAML\SAML2\Exception\ProtocolViolationException;
use SimpleSAML\XML\Exception\InvalidDOMElementException;
use SimpleSAML\XML\Exception\SchemaViolationException;
use SimpleSAML\XML\Exception\TooManyElementsException;
use SimpleSAML\XML\ExtendableAttributesTrait;
use SimpleSAML\XML\XsNamespace as NS;
Expand Down
1 change: 0 additions & 1 deletion src/SAML2/XML/md/AttributeProfile.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
use SimpleSAML\Assert\Assert;
use SimpleSAML\SAML2\Assert\Assert as SAMLAssert;
use SimpleSAML\XML\Exception\InvalidDOMElementException;
use SimpleSAML\XML\Exception\SchemaViolationException;
use SimpleSAML\XML\StringElementTrait;

/**
Expand Down
1 change: 0 additions & 1 deletion src/SAML2/XML/md/EntityDescriptor.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
use SimpleSAML\SAML2\Constants as C;
use SimpleSAML\SAML2\Exception\ProtocolViolationException;
use SimpleSAML\XML\Exception\InvalidDOMElementException;
use SimpleSAML\XML\Exception\SchemaViolationException;
use SimpleSAML\XML\Exception\TooManyElementsException;
use SimpleSAML\XML\ExtendableAttributesTrait;
use SimpleSAML\XML\XsNamespace as NS;
Expand Down
1 change: 0 additions & 1 deletion src/SAML2/XML/md/NameIDFormat.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
use SimpleSAML\Assert\Assert;
use SimpleSAML\SAML2\Assert\Assert as SAMLAssert;
use SimpleSAML\XML\Exception\InvalidDOMElementException;
use SimpleSAML\XML\Exception\SchemaViolationException;
use SimpleSAML\XML\StringElementTrait;

use function trim;
Expand Down
1 change: 0 additions & 1 deletion src/SAML2/XML/saml/Action.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
use SimpleSAML\Assert\Assert;
use SimpleSAML\SAML2\Assert\Assert as SAMLAssert;
use SimpleSAML\XML\Exception\InvalidDOMElementException;
use SimpleSAML\XML\Exception\SchemaViolationException;
use SimpleSAML\XML\StringElementTrait;

/**
Expand Down
1 change: 0 additions & 1 deletion src/SAML2/XML/saml/AssertionURIRef.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
use SimpleSAML\Assert\Assert;
use SimpleSAML\SAML2\Assert\Assert as SAMLAssert;
use SimpleSAML\XML\Exception\InvalidDOMElementException;
use SimpleSAML\XML\Exception\SchemaViolationException;
use SimpleSAML\XML\StringElementTrait;

/**
Expand Down
10 changes: 8 additions & 2 deletions src/SAML2/XML/saml/Attribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,15 @@ public function __construct(
Assert::allIsInstanceOf($attributeValue, AttributeValue::class, 'Invalid AttributeValue.');

if ($nameFormat === C::NAMEFORMAT_URI) {
SAMLAssert::validURI($name, sprintf("Attribute name `%s` does not match its declared format `%s`", $name, $nameFormat));
SAMLAssert::validURI(
$name,
sprintf("Attribute name `%s` does not match its declared format `%s`", $name, $nameFormat),
);
} elseif ($nameFormat === C::NAMEFORMAT_BASIC) {
Assert::validNCName($name, sprintf("Attribute name `%s` does not match its declared format `%s`", $name, $nameFormat));
Assert::validNCName(
$name,
sprintf("Attribute name `%s` does not match its declared format `%s`", $name, $nameFormat),
);
}

$this->setAttributesNS($namespacedAttribute);
Expand Down
1 change: 0 additions & 1 deletion src/SAML2/XML/saml/Audience.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
use SimpleSAML\Assert\Assert;
use SimpleSAML\SAML2\Assert\Assert as SAMLAssert;
use SimpleSAML\XML\Exception\InvalidDOMElementException;
use SimpleSAML\XML\Exception\SchemaViolationException;
use SimpleSAML\XML\StringElementTrait;

/**
Expand Down
1 change: 0 additions & 1 deletion src/SAML2/XML/saml/AuthenticatingAuthority.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
use SimpleSAML\Assert\Assert;
use SimpleSAML\SAML2\Assert\Assert as SAMLAssert;
use SimpleSAML\XML\Exception\InvalidDOMElementException;
use SimpleSAML\XML\Exception\SchemaViolationException;
use SimpleSAML\XML\StringElementTrait;

/**
Expand Down
1 change: 0 additions & 1 deletion src/SAML2/XML/saml/AuthnContextClassRef.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
namespace SimpleSAML\SAML2\XML\saml;

use SimpleSAML\SAML2\Assert\Assert as SAMLAssert;
use SimpleSAML\XML\Exception\SchemaViolationException;
use SimpleSAML\XML\StringElementTrait;

/**
Expand Down
1 change: 0 additions & 1 deletion src/SAML2/XML/saml/AuthnContextDeclRef.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
namespace SimpleSAML\SAML2\XML\saml;

use SimpleSAML\SAML2\Assert\Assert as SAMLAssert;
use SimpleSAML\XML\Exception\SchemaViolationException;
use SimpleSAML\XML\StringElementTrait;

/**
Expand Down
1 change: 0 additions & 1 deletion src/SAML2/XML/saml/SubjectConfirmation.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
use SimpleSAML\SAML2\Assert\Assert as SAMLAssert;
use SimpleSAML\SAML2\XML\IdentifierTrait;
use SimpleSAML\XML\Exception\InvalidDOMElementException;
use SimpleSAML\XML\Exception\SchemaViolationException;
use SimpleSAML\XML\Exception\TooManyElementsException;

use function array_pop;
Expand Down
1 change: 0 additions & 1 deletion src/SAML2/XML/samlp/GetComplete.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
use SimpleSAML\SAML2\Assert\Assert as SAMLAssert;
use SimpleSAML\SAML2\Exception\ArrayValidationException;
use SimpleSAML\XML\Exception\InvalidDOMElementException;
use SimpleSAML\XML\Exception\SchemaViolationException;
use SimpleSAML\XML\StringElementTrait;

use function array_key_first;
Expand Down
1 change: 0 additions & 1 deletion src/SAML2/XML/samlp/IDPEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
use SimpleSAML\SAML2\Assert\Assert as SAMLAssert;
use SimpleSAML\SAML2\Exception\ArrayValidationException;
use SimpleSAML\XML\Exception\InvalidDOMElementException;
use SimpleSAML\XML\Exception\SchemaViolationException;

use function array_change_key_case;
use function array_filter;
Expand Down
1 change: 0 additions & 1 deletion src/SAML2/XML/samlp/RequesterID.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
use SimpleSAML\SAML2\Assert\Assert as SAMLAssert;
use SimpleSAML\SAML2\Exception\ArrayValidationException;
use SimpleSAML\XML\Exception\InvalidDOMElementException;
use SimpleSAML\XML\Exception\SchemaViolationException;
use SimpleSAML\XML\StringElementTrait;

use function array_key_first;
Expand Down
1 change: 0 additions & 1 deletion src/SAML2/XML/samlp/StatusCode.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
use SimpleSAML\SAML2\Assert\Assert as SAMLAssert;
use SimpleSAML\SAML2\Constants as C;
use SimpleSAML\XML\Exception\InvalidDOMElementException;
use SimpleSAML\XML\Exception\SchemaViolationException;

/**
* SAML StatusCode data type.
Expand Down
2 changes: 1 addition & 1 deletion tests/SAML2/Assert/DateTimeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function testValidDateTime(bool $shouldPass, string $timestamp): void
try {
SAML2Assert::validDateTime($timestamp);
$this->assertTrue($shouldPass);
} catch (ProtocolViolationException|SchemaViolationException $e) {
} catch (ProtocolViolationException | SchemaViolationException $e) {
$this->assertFalse($shouldPass);
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/SAML2/Assert/URITest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function testValidURI(bool $shouldPass, string $uri): void
try {
SAML2Assert::validURI($uri);
$this->assertTrue($shouldPass);
} catch (ProtocolViolationException|SchemaViolationException $e) {
} catch (ProtocolViolationException | SchemaViolationException $e) {
$this->assertFalse($shouldPass);
}
}
Expand Down

0 comments on commit ec56649

Please sign in to comment.