diff --git a/src/XML/SignableElementInterface.php b/src/XML/SignableElementInterface.php index c2cea1fd..50a00ecd 100644 --- a/src/XML/SignableElementInterface.php +++ b/src/XML/SignableElementInterface.php @@ -37,6 +37,6 @@ public function getId(): ?string; public function sign( SignatureAlgorithmInterface $signer, string $canonicalizationAlg, - ?KeyInfo $keyInfo = null + ?KeyInfo $keyInfo = null, ): void; } diff --git a/src/XML/SignableElementTrait.php b/src/XML/SignableElementTrait.php index 9da5c1d6..e55edd31 100644 --- a/src/XML/SignableElementTrait.php +++ b/src/XML/SignableElementTrait.php @@ -73,7 +73,7 @@ abstract public function getId(): ?string; public function sign( SignatureAlgorithmInterface $signer, string $canonicalizationAlg = C::C14N_EXCLUSIVE_WITHOUT_COMMENTS, - ?KeyInfo $keyInfo = null + ?KeyInfo $keyInfo = null, ): void { $this->signer = $signer; $this->keyInfo = $keyInfo; diff --git a/src/XML/SignedElementTrait.php b/src/XML/SignedElementTrait.php index d3dc9baa..83eb7319 100644 --- a/src/XML/SignedElementTrait.php +++ b/src/XML/SignedElementTrait.php @@ -286,7 +286,7 @@ public function verify(SignatureAlgorithmInterface $verifier = null): SignedElem // build a valid PEM for the certificate $cert = sprintf( "-----BEGIN CERTIFICATE-----\n%s\n-----END CERTIFICATE-----", - $data->getRawContent() + $data->getRawContent(), ); $cert = new Key\X509Certificate(PEM::fromString($cert)); diff --git a/src/XML/ds/KeyValue.php b/src/XML/ds/KeyValue.php index 7a0063e8..32a7ce0e 100644 --- a/src/XML/ds/KeyValue.php +++ b/src/XML/ds/KeyValue.php @@ -80,7 +80,7 @@ public static function fromXML(DOMElement $xml): static $RSAKeyValue, 1, 'A can contain exactly one ', - TooManyElementsException::class + TooManyElementsException::class, ); $elements = []; @@ -95,7 +95,7 @@ public static function fromXML(DOMElement $xml): static $elements, 1, 'A can contain exactly one element in namespace ##other', - TooManyElementsException::class + TooManyElementsException::class, ); return new static(array_pop($RSAKeyValue), array_pop($elements)); diff --git a/src/XML/ds/RSAKeyValue.php b/src/XML/ds/RSAKeyValue.php index ab061516..1a23e70b 100644 --- a/src/XML/ds/RSAKeyValue.php +++ b/src/XML/ds/RSAKeyValue.php @@ -71,13 +71,13 @@ public static function fromXML(DOMElement $xml): static $modulus, 1, 'An must contain exactly one ', - MissingElementException::class + MissingElementException::class, ); Assert::maxCount( $modulus, 1, 'An must contain exactly one ', - TooManyElementsException::class + TooManyElementsException::class, ); $exponent = Exponent::getChildrenOfClass($xml); @@ -85,13 +85,13 @@ public static function fromXML(DOMElement $xml): static $exponent, 1, 'An must contain exactly one ', - MissingElementException::class + MissingElementException::class, ); Assert::maxCount( $exponent, 1, 'An must contain exactly one ', - TooManyElementsException::class + TooManyElementsException::class, ); return new static(array_pop($modulus), array_pop($exponent)); diff --git a/src/XML/ds/RetrievalMethod.php b/src/XML/ds/RetrievalMethod.php index 03d0394a..e75fcca8 100644 --- a/src/XML/ds/RetrievalMethod.php +++ b/src/XML/ds/RetrievalMethod.php @@ -89,7 +89,7 @@ public static function fromXML(DOMElement $xml): static return new static( array_pop($transforms), $URI, - $Type + $Type, ); } diff --git a/src/XML/ds/Transform.php b/src/XML/ds/Transform.php index 25c0dea0..a1025881 100644 --- a/src/XML/ds/Transform.php +++ b/src/XML/ds/Transform.php @@ -53,7 +53,7 @@ final public function __construct( sprintf( 'Transform algorithm "%s" or "%s" required if InclusiveNamespaces provided.', C::C14N_EXCLUSIVE_WITH_COMMENTS, - C::C14N_EXCLUSIVE_WITHOUT_COMMENTS + C::C14N_EXCLUSIVE_WITHOUT_COMMENTS, ), ); } diff --git a/src/XML/ec/InclusiveNamespaces.php b/src/XML/ec/InclusiveNamespaces.php index b5162e46..7deff9eb 100644 --- a/src/XML/ec/InclusiveNamespaces.php +++ b/src/XML/ec/InclusiveNamespaces.php @@ -32,7 +32,7 @@ final public function __construct( Assert::allString( $prefixes, 'Can only add string InclusiveNamespaces prefixes.', - InvalidArgumentException::class + InvalidArgumentException::class, ); Assert::allRegex($prefixes, '/^[a-z0-9._\\-:]*$/i', SchemaViolationException::class); // xsd:NMTOKEN } diff --git a/src/XML/xenc/CipherData.php b/src/XML/xenc/CipherData.php index 093b1351..39ddc20a 100644 --- a/src/XML/xenc/CipherData.php +++ b/src/XML/xenc/CipherData.php @@ -79,7 +79,7 @@ public static function fromXML(DOMElement $xml): static $cv, 1, 'More than one CipherValue element in ', - TooManyElementsException::class + TooManyElementsException::class, ); $cr = CipherReference::getChildrenOfClass($xml); @@ -87,7 +87,7 @@ public static function fromXML(DOMElement $xml): static $cr, 1, 'More than one CipherReference element in ', - TooManyElementsException::class + TooManyElementsException::class, ); return new static( diff --git a/tests/XML/CustomSignable.php b/tests/XML/CustomSignable.php index bca43dbd..c25a8737 100644 --- a/tests/XML/CustomSignable.php +++ b/tests/XML/CustomSignable.php @@ -57,7 +57,7 @@ class CustomSignable extends AbstractElement implements */ final public function __construct( protected DOMElement $xml, - protected ?string $id + protected ?string $id, ) { } diff --git a/tests/XML/SignableElementTest.php b/tests/XML/SignableElementTest.php index 15004181..b1cc38ff 100644 --- a/tests/XML/SignableElementTest.php +++ b/tests/XML/SignableElementTest.php @@ -196,7 +196,7 @@ public function testSigningElementWithIdAndComments(): void $customSignable->sign($signer, C::C14N_EXCLUSIVE_WITH_COMMENTS, $keyInfo); $signed = DOMDocumentFactory::fromFile( - dirname(__FILE__, 2) . '/resources/xml/custom_CustomSignableSignedWithCommentsAndId.xml' + dirname(__FILE__, 2) . '/resources/xml/custom_CustomSignableSignedWithCommentsAndId.xml', ); $this->assertEquals( diff --git a/tests/XML/SignedElementTest.php b/tests/XML/SignedElementTest.php index 21d4bb88..80f63788 100644 --- a/tests/XML/SignedElementTest.php +++ b/tests/XML/SignedElementTest.php @@ -61,7 +61,7 @@ public function setUp(): void )->documentElement; $this->certificate = PEM::fromString( - PEMCertificatesMock::getPlainCertificate(PEMCertificatesMock::SELFSIGNED_CERTIFICATE) + PEMCertificatesMock::getPlainCertificate(PEMCertificatesMock::SELFSIGNED_CERTIFICATE), ); } diff --git a/tests/XML/ds/DigestMethodTest.php b/tests/XML/ds/DigestMethodTest.php index d98a2a40..d5003507 100644 --- a/tests/XML/ds/DigestMethodTest.php +++ b/tests/XML/ds/DigestMethodTest.php @@ -51,8 +51,8 @@ public function testMarshalling(): void C::DIGEST_SHA256, [ new Chunk(DOMDocumentFactory::fromString( - 'Random' - )->documentElement) + 'Random', + )->documentElement), ], ); diff --git a/tests/XML/ds/KeyInfoTest.php b/tests/XML/ds/KeyInfoTest.php index 68fe7eae..40a3f2f7 100644 --- a/tests/XML/ds/KeyInfoTest.php +++ b/tests/XML/ds/KeyInfoTest.php @@ -95,7 +95,7 @@ public function testMarshalling(): void ], ), new Chunk(DOMDocumentFactory::fromString( - 'some' + 'some', )->documentElement), ], 'fed654', diff --git a/tests/XML/ds/KeyValueTest.php b/tests/XML/ds/KeyValueTest.php index 46b65424..b6329157 100644 --- a/tests/XML/ds/KeyValueTest.php +++ b/tests/XML/ds/KeyValueTest.php @@ -113,7 +113,7 @@ public function testMarshallingEmpty(): void { $this->expectException(SchemaViolationException::class); $this->expectExceptionMessage( - 'A requires either a RSAKeyValue or an element in namespace ##other' + 'A requires either a RSAKeyValue or an element in namespace ##other', ); new KeyValue(null, null); @@ -147,7 +147,7 @@ public function testUnmarshallingEmpty(): void $this->expectException(SchemaViolationException::class); $this->expectExceptionMessage( - 'A requires either a RSAKeyValue or an element in namespace ##other' + 'A requires either a RSAKeyValue or an element in namespace ##other', ); KeyValue::fromXML($document->documentElement); diff --git a/tests/XML/ds/ObjectTest.php b/tests/XML/ds/ObjectTest.php index da707673..ad860bab 100644 --- a/tests/XML/ds/ObjectTest.php +++ b/tests/XML/ds/ObjectTest.php @@ -35,7 +35,7 @@ public static function setUpBeforeClass(): void self::$schemaFile = dirname(__FILE__, 4) . '/resources/schemas/xmldsig1-schema.xsd'; self::$xmlRepresentation = DOMDocumentFactory::fromFile( - dirname(__FILE__, 3) . '/resources/xml/ds_Object.xml' + dirname(__FILE__, 3) . '/resources/xml/ds_Object.xml', ); } @@ -53,15 +53,15 @@ public function testMarshalling(): void new Chunk( DOMDocumentFactory::fromString(sprintf( '%s', - $img - ))->documentElement - ) + $img, + ))->documentElement, + ), ], ); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($obj) + strval($obj), ); } @@ -75,7 +75,7 @@ public function testMarshallingEmptyElement(): void $obj = new DsObject(null, null, null, []); $this->assertEquals( "", - strval($obj) + strval($obj), ); $this->assertTrue($obj->isEmptyElement()); } diff --git a/tests/XML/ds/ReferenceTest.php b/tests/XML/ds/ReferenceTest.php index 025c8ad6..610890ab 100644 --- a/tests/XML/ds/ReferenceTest.php +++ b/tests/XML/ds/ReferenceTest.php @@ -82,7 +82,7 @@ public function testMarshallingReferenceElementOrdering(): void [ new Transform(C::XMLDSIG_ENVELOPED), new Transform(C::C14N_EXCLUSIVE_WITHOUT_COMMENTS), - ] + ], ), 'ghi789', 'urn:some:type', diff --git a/tests/XML/ds/SignaturePropertiesTest.php b/tests/XML/ds/SignaturePropertiesTest.php index 1e44b7fa..003592b3 100644 --- a/tests/XML/ds/SignaturePropertiesTest.php +++ b/tests/XML/ds/SignaturePropertiesTest.php @@ -49,19 +49,19 @@ public static function setUpBeforeClass(): void public function testMarshalling(): void { $document = DOMDocumentFactory::fromString( - '1234567890' + '1234567890', ); $signatureProperty = new SignatureProperty( [new Chunk($document->documentElement)], 'https://simplesamlphp.org/some/target', - 'abc123' + 'abc123', ); $signatureProperties = new SignatureProperties([$signatureProperty], 'def456'); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($signatureProperties) + strval($signatureProperties), ); } } diff --git a/tests/XML/ds/SignaturePropertyTest.php b/tests/XML/ds/SignaturePropertyTest.php index 23415df1..b5292934 100644 --- a/tests/XML/ds/SignaturePropertyTest.php +++ b/tests/XML/ds/SignaturePropertyTest.php @@ -54,12 +54,12 @@ public function testMarshalling(): void $signatureProperty = new SignatureProperty( [new Chunk($document->documentElement)], 'https://simplesamlphp.org/some/target', - 'abc123' + 'abc123', ); $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($signatureProperty) + strval($signatureProperty), ); } } diff --git a/tests/XML/ds/X509DataTest.php b/tests/XML/ds/X509DataTest.php index 176aef63..8a817003 100644 --- a/tests/XML/ds/X509DataTest.php +++ b/tests/XML/ds/X509DataTest.php @@ -89,7 +89,7 @@ public function testMarshalling(): void [ new Chunk( DOMDocumentFactory::fromString( - 'some' + 'some', )->documentElement, ), new X509Certificate(self::$certificate), @@ -102,8 +102,8 @@ public function testMarshalling(): void ), new X509SubjectName(self::$certData['name']), new Chunk(DOMDocumentFactory::fromString( - 'other' - )->documentElement) + 'other', + )->documentElement), ], ); diff --git a/tests/XML/xenc/EncryptedDataTest.php b/tests/XML/xenc/EncryptedDataTest.php index 791149b7..3923ca4d 100644 --- a/tests/XML/xenc/EncryptedDataTest.php +++ b/tests/XML/xenc/EncryptedDataTest.php @@ -129,7 +129,7 @@ public function testMarshallingElementOrdering(): void $encryptedDataElements = XPath::xpQuery( $encryptedDataElement, './xenc:EncryptionMethod/following-sibling::*', - $xpCache + $xpCache, ); $this->assertCount(2, $encryptedDataElements); $this->assertEquals('ds:KeyInfo', $encryptedDataElements[0]->tagName); diff --git a/tests/XML/xenc/ReferenceListTest.php b/tests/XML/xenc/ReferenceListTest.php index 6a8ebf16..e3fa10e9 100644 --- a/tests/XML/xenc/ReferenceListTest.php +++ b/tests/XML/xenc/ReferenceListTest.php @@ -68,10 +68,10 @@ public function testMarshalling(): void $referenceList = new ReferenceList( [ - new DataReference('#Encrypted_DATA_ID', [new Transforms([$transformData])]) + new DataReference('#Encrypted_DATA_ID', [new Transforms([$transformData])]), ], [ - new KeyReference('#Encrypted_KEY_ID', [new Transforms([$transformKey])]) + new KeyReference('#Encrypted_KEY_ID', [new Transforms([$transformKey])]), ], );