Skip to content

Commit

Permalink
Add trailing comma's
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdijen committed Jun 16, 2024
1 parent 98ac793 commit b96e287
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/Base64ElementTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ protected function validateContent(string $content): void
// Note: content must already be sanitized before validating
Assert::stringPlausibleBase64(
$this->sanitizeContent($content),
SchemaViolationException::class
SchemaViolationException::class,
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Chunk.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ final class Chunk implements SerializableElementInterface
* @param \DOMElement $xml The element we should copy.
*/
public function __construct(
protected DOMElement $xml
protected DOMElement $xml,
) {
$this->setLocalName($xml->localName);
$this->setNamespaceURI($xml->namespaceURI);
Expand Down
2 changes: 1 addition & 1 deletion src/ExtendableElementTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ protected function setElements(array $elements): void
function (SerializableElementInterface $elt) {
return ($elt instanceof Chunk) ? $elt->getNamespaceURI() : $elt::getNamespaceURI();
},
$elements
$elements,
);

if ($namespace === NS::LOCAL) {
Expand Down
2 changes: 1 addition & 1 deletion src/TestUtils/SchemaValidationTestTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ private function validateDocument(XMLReader $xmlReader): bool
if ($msgs) {
throw new SchemaViolationException(sprintf(
"XML schema validation errors:\n - %s",
implode("\n - ", array_unique($msgs))
implode("\n - ", array_unique($msgs)),
));
}

Expand Down
2 changes: 1 addition & 1 deletion tests/Utils/Element.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ final class Element extends AbstractElement
public function __construct(
protected ?int $integer = null,
protected ?bool $boolean = null,
protected ?string $text = null
protected ?string $text = null,
) {
}

Expand Down
2 changes: 2 additions & 0 deletions tests/XML/Base64ElementTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ public static function provideBase64Cases(): array
<<<XML
<ssp:Base64Element xmlns:ssp="urn:x-simplesamlphp:namespace">/CTj03d1DB5e2t7CTo9BEzCf5S9NRzwnBgZRlm32REI=</ssp:Base64Element>
XML
,
],
'multiline' => [
<<<XML
Expand All @@ -103,6 +104,7 @@ public static function provideBase64Cases(): array
xZ4F8cWlMWJ7f0KkWvtw66HOf2VNR6Qan2Ra7Q==
</ssp:Base64Element>
XML
,
],
];
}
Expand Down
16 changes: 12 additions & 4 deletions tests/XML/ExtendableElementTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,24 +43,32 @@ final class ExtendableElementTraitTest extends TestCase
*/
public static function setUpBeforeClass(): void
{
$emptyDocument = DOMDocumentFactory::fromString(<<<XML
$emptyDocument = DOMDocumentFactory::fromString(
<<<XML
<chunk/>
XML
,
);

$localDocument = DOMDocumentFactory::fromString(<<<XML
$localDocument = DOMDocumentFactory::fromString(
<<<XML
<chunk>some</chunk>
XML
,
);

$targetDocument = DOMDocumentFactory::fromString(<<<XML
$targetDocument = DOMDocumentFactory::fromString(
<<<XML
<ssp:chunk xmlns:ssp="urn:x-simplesamlphp:namespace">some</ssp:chunk>
,
XML
);

$otherDocument = DOMDocumentFactory::fromString(<<<XML
$otherDocument = DOMDocumentFactory::fromString(
<<<XML
<dummy:chunk xmlns:dummy="urn:custom:dummy">some</dummy:chunk>
XML
,
);

/** @var \DOMElement $emptyElement */
Expand Down
6 changes: 3 additions & 3 deletions tests/XML/QNameElementTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function testMarshalling(): void

$this->assertEquals(
self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement),
strval($qnameElement)
strval($qnameElement),
);
}

Expand All @@ -59,7 +59,7 @@ public function testMarshallingNonNamespacedQualifiedName(): void

$this->assertEquals(
'<ssp:QNameElement xmlns:ssp="urn:x-simplesamlphp:namespace">Sender</ssp:QNameElement>',
strval($qnameElement)
strval($qnameElement),
);
}

Expand All @@ -79,7 +79,7 @@ public function testMarshallingInvalidQualifiedNameThrowsException(): void
public function testUnmarshallingNonNamepacedQualifiedName(): void
{
$doc = DOMDocumentFactory::fromString(
'<ssp:QNameElement xmlns:ssp="urn:x-simplesamlphp:namespace">Sender</ssp:QNameElement>'
'<ssp:QNameElement xmlns:ssp="urn:x-simplesamlphp:namespace">Sender</ssp:QNameElement>',
);

/** @var \DOMElement $element */
Expand Down

0 comments on commit b96e287

Please sign in to comment.