Skip to content

Commit

Permalink
Add trailing comma's (part 2)
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdijen committed Jul 18, 2024
1 parent 79c6b30 commit 18210e9
Show file tree
Hide file tree
Showing 34 changed files with 73 additions and 61 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function __construct(
* @param \SimpleSAML\SAML2\Assertion\Validation\SubjectConfirmationConstraintValidator $constraint
*/
public function addConstraintValidator(
SubjectConfirmationConstraintValidator $constraint
SubjectConfirmationConstraintValidator $constraint,
): void {
if ($constraint instanceof IdentityProviderAware) {
$constraint->setIdentityProvider($this->identityProvider);
Expand Down
2 changes: 1 addition & 1 deletion src/SAML2/Binding.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public static function getCurrentBinding(ServerRequestInterface $request): Bindi

if (!empty($query)) {
$logger->warning(
$method . " parameters: '" . implode("', '", array_map('addslashes', array_keys($query))) . "'"
$method . " parameters: '" . implode("', '", array_map('addslashes', array_keys($query))) . "'",
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/SAML2/Compat/MockContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function debugMessage($message, string $type): void
*/
public function getPOSTRedirectURL(
/** @scrutinizer ignore-unused */string $url = null,
/** @scrutinizer ignore-unused */array $data = []
/** @scrutinizer ignore-unused */array $data = [],
): string {
return strval($url);
}
Expand Down
2 changes: 1 addition & 1 deletion src/SAML2/Configuration/SimpleSAMLConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ protected static function enrichForDecryptionProvider(

if ($configuration->hasValue('encryption.blacklisted-algorithms')) {
$baseConfiguration['blacklistedEncryptionAlgorithms'] = $configuration->getValue(
'encryption.blacklisted-algorithms'
'encryption.blacklisted-algorithms',
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/SAML2/HTTPArtifact.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public function receive(ServerRequestInterface $request): AbstractMessage
}

Utils::getContainer()->getLogger()->debug(
"ArtifactResolutionService endpoint being used is := " . $endpoint['Location']
"ArtifactResolutionService endpoint being used is := " . $endpoint['Location'],
);

/**
Expand Down
2 changes: 1 addition & 1 deletion src/SAML2/HTTPRedirect.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public function send(AbstractMessage $message): ResponseInterface
{
$destination = $this->getRedirectURL($message);
Utils::getContainer()->getLogger()->debug(
'Redirect to ' . strlen($destination) . ' byte URL: ' . $destination
'Redirect to ' . strlen($destination) . ' byte URL: ' . $destination,
);
return new Response(303, ['Location' => $destination]);
}
Expand Down
2 changes: 1 addition & 1 deletion src/SAML2/SOAPClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function send(
if ($cert !== false) {
$configUtils = new Config();
$ctxOpts['ssl']['local_cert'] = $configUtils->getCertPath(
$srcMetadata->getString('saml.SOAPClient.certificate')
$srcMetadata->getString('saml.SOAPClient.certificate'),
);
if ($srcMetadata->hasValue('saml.SOAPClient.privatekey_pass')) {
$ctxOpts['ssl']['passphrase'] = $srcMetadata->getString('saml.SOAPClient.privatekey_pass');
Expand Down
2 changes: 1 addition & 1 deletion src/SAML2/XML/ecp/RequestAuthenticated.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ final class RequestAuthenticated extends AbstractEcpElement
* @param bool $mustUnderstand
*/
public function __construct(
protected bool $mustUnderstand
protected bool $mustUnderstand,
) {
}

Expand Down
2 changes: 1 addition & 1 deletion src/SAML2/XML/md/AbstractRoleDescriptor.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public static function fromXML(DOMElement $xml): static
Assert::true(
$xml->hasAttributeNS(C::NS_XSI, 'type'),
'Missing required xsi:type in <saml:RoleDescriptor> element.',
SchemaViolationException::class
SchemaViolationException::class,
);

$type = $xml->getAttributeNS(C::NS_XSI, 'type');
Expand Down
2 changes: 1 addition & 1 deletion src/SAML2/XML/md/AbstractRoleDescriptorType.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function __construct(
protected array $keyDescriptor = [],
protected ?Organization $organization = null,
protected array $contact = [],
array $namespacedAttributes = []
array $namespacedAttributes = [],
) {
Assert::maxCount($protocolSupportEnumeration, C::UNBOUNDED_LIMIT);
Assert::minCount(
Expand Down
4 changes: 2 additions & 2 deletions src/SAML2/XML/md/AttributeAuthorityDescriptor.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function __construct(
?Organization $organization = null,
array $keyDescriptor = [],
array $contact = [],
array $namespacedAttributes = []
array $namespacedAttributes = [],
) {
Assert::maxCount($attributeService, C::UNBOUNDED_LIMIT);
Assert::minCount(
Expand Down Expand Up @@ -91,7 +91,7 @@ public function __construct(
$keyDescriptor,
$organization,
$contact,
$namespacedAttributes
$namespacedAttributes,
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/SAML2/XML/md/KeyDescriptor.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ final class KeyDescriptor extends AbstractMdElement
public function __construct(
protected KeyInfo $keyInfo,
protected ?string $use = null,
protected array $encryptionMethod = []
protected array $encryptionMethod = [],
) {
Assert::nullOrOneOf(
$use,
Expand Down
4 changes: 2 additions & 2 deletions src/SAML2/XML/md/SPSSODescriptor.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function __construct(
$artifactResolutionService,
$singleLogoutService,
$manageNameIDService,
$nameIDFormat
$nameIDFormat,
);

Assert::maxCount($assertionConsumerService, C::UNBOUNDED_LIMIT);
Expand All @@ -99,7 +99,7 @@ public function __construct(
$attributeConsumingService,
function (AttributeConsumingService $acs) {
return $acs->getIsDefault() === true;
}
},
),
1,
'Only one md:AttributeConsumingService can be set as default.',
Expand Down
2 changes: 1 addition & 1 deletion src/SAML2/XML/md/UnknownRoleDescriptor.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ protected function __construct(
array $keyDescriptors = [],
?Organization $organization = null,
array $contacts = [],
array $namespacedAttributes = []
array $namespacedAttributes = [],
) {
parent::__construct(
$type,
Expand Down
2 changes: 1 addition & 1 deletion tests/SAML2/XML/init/RequestInitiatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ final class RequestInitiatorTest extends TestCase
public static function setUpBeforeClass(): void
{
self::$ext = new Chunk(DOMDocumentFactory::fromString(
'<some:Ext xmlns:some="urn:mace:some:metadata:1.0">SomeExtension</some:Ext>'
'<some:Ext xmlns:some="urn:mace:some:metadata:1.0">SomeExtension</some:Ext>',
)->documentElement);

self::$schemaFile = dirname(__FILE__, 5) . '/resources/schemas/sstc-request-initiation.xsd';
Expand Down
4 changes: 2 additions & 2 deletions tests/SAML2/XML/md/AffiliationDescriptorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public function testUnmarshallingWithoutMembers(): void
<md:AffiliationDescriptor xmlns:md="{$mdNamespace}" affiliationOwnerID="{$entity_idp}" ID="TheID"
validUntil="2009-02-13T23:31:30Z" cacheDuration="PT5000S">
</md:AffiliationDescriptor>
XML
XML,
);
$this->expectException(Exception::class);
$this->expectExceptionMessage('List of affiliated members must not be empty.');
Expand All @@ -159,7 +159,7 @@ public function testUnmarshallingWithoutOwner(): void
<md:AffiliateMember>{$entity_sp}</md:AffiliateMember>
<md:AffiliateMember>{$entity_other}</md:AffiliateMember>
</md:AffiliationDescriptor>
XML
XML,
);

$this->expectException(MissingAttributeException::class);
Expand Down
2 changes: 1 addition & 1 deletion tests/SAML2/XML/md/ArtifactResolutionServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ final class ArtifactResolutionServiceTest extends TestCase
public static function setUpBeforeClass(): void
{
self::$ext = new Chunk(DOMDocumentFactory::fromString(
'<some:Ext xmlns:some="urn:mace:some:metadata:1.0">SomeExtension</some:Ext>'
'<some:Ext xmlns:some="urn:mace:some:metadata:1.0">SomeExtension</some:Ext>',
)->documentElement);

self::$attr = new XMLAttribute('urn:x-simplesamlphp:namespace', 'ssp', 'attr1', 'testval1');
Expand Down
6 changes: 3 additions & 3 deletions tests/SAML2/XML/md/AttributeAuthorityDescriptorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ public function testUnmarshallingWithoutOptionalElements(): void
<md:AttributeService Binding="urn:oasis:names:tc:SAML:2.0:bindings:SOAP"
Location="https://IdentityProvider.com/SAML/AA/SOAP"/>
</md:AttributeAuthorityDescriptor>
XML
XML,
);

$aad = AttributeAuthorityDescriptor::fromXML($document->documentElement);
Expand Down Expand Up @@ -271,7 +271,7 @@ public function testUnmarshallingWithEmptyNameIDFormat(): void
Location="https://IdentityProvider.com/SAML/AA/SOAP"/>
<md:NameIDFormat></md:NameIDFormat>
</md:AttributeAuthorityDescriptor>
XML
XML,
);
$this->expectException(SchemaViolationException::class);
AttributeAuthorityDescriptor::fromXML($document->documentElement);
Expand All @@ -290,7 +290,7 @@ public function testUnmarshallingWithEmptyAttributeProfile(): void
Location="https://IdentityProvider.com/SAML/AA/SOAP"/>
<md:AttributeProfile></md:AttributeProfile>
</md:AttributeAuthorityDescriptor>
XML
XML,
);
$this->expectException(SchemaViolationException::class);
AttributeAuthorityDescriptor::fromXML($document->documentElement);
Expand Down
2 changes: 1 addition & 1 deletion tests/SAML2/XML/md/ContactPersonTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ public function testUnmarshallingWithoutOptionalArguments(): void
$mdNamespace = C::NS_MD;
$document = DOMDocumentFactory::fromString(<<<XML
<md:ContactPerson contactType="other" xmlns:md="{$mdNamespace}"/>
XML
XML,
);
$cp = ContactPerson::fromXML($document->documentElement);
$this->assertEquals($document->saveXML($document->documentElement), strval($cp));
Expand Down
2 changes: 1 addition & 1 deletion tests/SAML2/XML/md/EncryptionMethodTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function testMarshalling(): void
{
$alg = C::KEY_TRANSPORT_OAEP_MGF1P;
$chunkXml = DOMDocumentFactory::fromString(
'<ssp:Chunk xmlns:ssp="urn:x-simplesamlphp:namespace">Value</ssp:Chunk>'
'<ssp:Chunk xmlns:ssp="urn:x-simplesamlphp:namespace">Value</ssp:Chunk>',
);
$chunk = Chunk::fromXML($chunkXml->documentElement);

Expand Down
2 changes: 1 addition & 1 deletion tests/SAML2/XML/md/EndpointTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ public function testUnmarshallingWithoutOptionalAttributes(): void

$document = DOMDocumentFactory::fromString(<<<XML
<md:AttributeService xmlns:md="{$mdNamespace}" Binding="urn:x-simplesamlphp:namespace" Location="{$location}" />
XML
XML,
);
$as = AttributeService::fromXML($document->documentElement);
$this->assertNull($as->getResponseLocation());
Expand Down
18 changes: 9 additions & 9 deletions tests/SAML2/XML/md/EntityDescriptorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public function testMarshalling(): void
new PublicationInfo(
publisher: 'http://publisher.ra/',
creationInstant: new DateTimeImmutable('2020-02-03T13:46:24Z'),
usagePolicy: [new UsagePolicy('en', 'http://publisher.ra/policy.txt')]
usagePolicy: [new UsagePolicy('en', 'http://publisher.ra/policy.txt')],
),
]);

Expand Down Expand Up @@ -227,7 +227,7 @@ public function testMarshallingWithAffiliationDescriptor(): void
<md:AdditionalMetadataLocation
namespace="urn:x-simplesamlphp:namespace">https://example.edu/more/metadata.xml</md:AdditionalMetadataLocation>
</md:EntityDescriptor>
XML
XML,
);

$entityid = C::ENTITY_IDP;
Expand Down Expand Up @@ -446,7 +446,7 @@ public function testUnmarshallingWithoutEntityId(): void
<AffiliateMember>{$entity_sp}</AffiliateMember>
</AffiliationDescriptor>
</EntityDescriptor>
XML
XML,
);
$this->expectException(MissingAttributeException::class);
$this->expectExceptionMessage('Missing \'entityID\' attribute on md:EntityDescriptor.');
Expand All @@ -464,7 +464,7 @@ public function testUnmarshallingWithoutDescriptors(): void

$document = DOMDocumentFactory::fromString(<<<XML
<EntityDescriptor entityID="{$entity_idp}" xmlns="{$saml_md}"></EntityDescriptor>
XML
XML,
);
$this->expectException(ProtocolViolationException::class);
$this->expectExceptionMessage(
Expand All @@ -488,7 +488,7 @@ public function testUnmarshallingWithInvalidValidUntil(): void
<AffiliateMember>{$entity_sp}</AffiliateMember>
</AffiliationDescriptor>
</EntityDescriptor>
XML
XML,
);
$this->expectException(AssertionFailedException::class);
$this->expectExceptionMessage('\'asdf\' is not a valid xs:dateTime');
Expand All @@ -514,7 +514,7 @@ public function testUnmarshallingWithAffiliationDescriptor(): void
<AffiliateMember>{$entity_other}</AffiliateMember>
</AffiliationDescriptor>
</EntityDescriptor>
XML
XML,
);
$entityDescriptor = EntityDescriptor::fromXML($document->documentElement);
$this->assertEquals([], $entityDescriptor->getRoleDescriptor());
Expand Down Expand Up @@ -543,7 +543,7 @@ public function testUnmarshallingWithSeveralAffiliationDescriptors(): void
<AffiliateMember>{$entity_sp}</AffiliateMember>
</AffiliationDescriptor>
</EntityDescriptor>
XML
XML,
);
$this->expectException(TooManyElementsException::class);
$this->expectExceptionMessage('More than one AffiliationDescriptor in the entity.');
Expand Down Expand Up @@ -576,7 +576,7 @@ public function testUnmarshallingWithMultipleOrganizations(): void
<OrganizationURL xml:lang="no">https://IdentityProvider.com</OrganizationURL>
</Organization>
</EntityDescriptor>
XML
XML,
);
$this->expectException(TooManyElementsException::class);
$this->expectExceptionMessage('More than one Organization in the entity.');
Expand Down Expand Up @@ -610,7 +610,7 @@ public function testUnmarshallingWithRoleandAffiliationDescriptors(): void
<OrganizationURL xml:lang="en">https://IdentityProvider.com</OrganizationURL>
</Organization>
</EntityDescriptor>
XML
XML,
);
$this->expectException(ProtocolViolationException::class);
$this->expectExceptionMessage(
Expand Down
2 changes: 1 addition & 1 deletion tests/SAML2/XML/md/ExtensionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public function testUnmarshalling(): void
</emd:RepublishRequest>
<ns:SomeChunk foo="bar">SomeText</ns:SomeChunk>
</md:Extensions>
XML
XML,
);
$extensions = Extensions::fromXML($document->documentElement);
$list = $extensions->getList();
Expand Down
2 changes: 1 addition & 1 deletion tests/SAML2/XML/md/IDPSSODescriptorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ public function testUnmarshallingWithoutOptionalArguments(): void
<md:SingleSignOnService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"
Location="https://IdentityProvider.com/SAML/SSO/Browser"/>
</md:IDPSSODescriptor>
XML
XML,
);
$idpssod = IDPSSODescriptor::fromXML($document->documentElement);
$this->assertCount(1, $idpssod->getSingleSignOnService());
Expand Down
4 changes: 2 additions & 2 deletions tests/SAML2/XML/md/KeyDescriptorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public function testMarshallingWithoutOptionalParameters(): void
<ds:KeyName>IdentityProvider.com SSO Key</ds:KeyName>
</ds:KeyInfo>
</md:KeyDescriptor>
XML
XML,
,
strval($kd),
);
Expand Down Expand Up @@ -137,7 +137,7 @@ public function testUnmarshallingWithoutOptionalParameters(): void
<ds:KeyName>IdentityProvider.com SSO Key</ds:KeyName>
</ds:KeyInfo>
</md:KeyDescriptor>
XML
XML,
);

$kd = KeyDescriptor::fromXML($document->documentElement);
Expand Down
2 changes: 1 addition & 1 deletion tests/SAML2/XML/md/OrganizationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public static function setUpBeforeClass(): void
self::$testedClass = Organization::class;

self::$ext = DOMDocumentFactory::fromString(
'<some:Ext xmlns:some="urn:mace:some:metadata:1.0">SomeExtension</some:Ext>'
'<some:Ext xmlns:some="urn:mace:some:metadata:1.0">SomeExtension</some:Ext>',
);

self::$arrayRepresentation = [
Expand Down
2 changes: 1 addition & 1 deletion tests/SAML2/XML/md/PDPDescriptorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ public function testUnmarshallingWithoutOptionalArguments(): void
<md:AuthzService Binding="urn:oasis:names:tc:SAML:2.0:bindings:SOAP"
Location="https://IdentityProvider.com/SAML/AA/SOAP"/>
</md:PDPDescriptor>
XML
XML,
);
$pdpd = PDPDescriptor::fromXML($document->documentElement);
$this->assertEmpty($pdpd->getAssertionIDRequestService());
Expand Down
2 changes: 1 addition & 1 deletion tests/SAML2/XML/md/SPSSODescriptorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ public function testUnmarshallingWithoutOptionalArguments(): void
<md:AssertionConsumerService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact"
Location="https://ServiceProvider.com/SAML/SSO/Artifact" index="0" isDefault="true"/>
</md:SPSSODescriptor>
XML
XML,
);

$spssod = SPSSODescriptor::fromXML($document->documentElement);
Expand Down
4 changes: 2 additions & 2 deletions tests/SAML2/XML/mdattr/EntityAttributesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,13 @@ public function testMarshalling(): void
'_93af655219464fb403b34436cfb0c5cb1d9a5502',
$subject,
$conditions,
[$attrStatement]
[$attrStatement],
);

// Sign the assertion
$signer = (new SignatureAlgorithmFactory())->getAlgorithm(
C::SIG_RSA_SHA256,
PEMCertificatesMock::getPrivateKey(PEMCertificatesMock::PRIVATE_KEY)
PEMCertificatesMock::getPrivateKey(PEMCertificatesMock::PRIVATE_KEY),
);
$unsignedAssertion->sign($signer);
$signedAssertion = Assertion::fromXML($unsignedAssertion->toXML());
Expand Down
Loading

0 comments on commit 18210e9

Please sign in to comment.