Skip to content

Commit

Permalink
Fix PHPstan + PHPcs issues
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdijen committed Dec 3, 2024
1 parent ab12a34 commit 2d37815
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
9 changes: 4 additions & 5 deletions src/XML/ds/AbstractDSAKeyValueType.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ abstract class AbstractDSAKeyValueType extends AbstractDsElement
* @param \SimpleSAML\XMLSecurity\XML\ds\J|null $j
* @param \SimpleSAML\XMLSecurity\XML\ds\P|null $p
* @param \SimpleSAML\XMLSecurity\XML\ds\Q|null $q
* @param \SimpleSAML\XMLSecurity\XML\ds\Generator|null $generator
* @param \SimpleSAML\XMLSecurity\XML\ds\Seed|null $seed
* @param \SimpleSAML\XMLSecurity\XML\ds\PgenCounter|null $pgenCounter
*/
Expand Down Expand Up @@ -68,9 +67,9 @@ public function getY(): Y
/**
* Get the G.
*
* @return \SimpleSAML\XMLSecurity\XML\ds\G
* @return \SimpleSAML\XMLSecurity\XML\ds\G|null
*/
public function getG(): G
public function getG(): ?G
{
return $this->g;
}
Expand All @@ -79,9 +78,9 @@ public function getG(): G
/**
* Get the J.
*
* @return \SimpleSAML\XMLSecurity\XML\ds\J
* @return \SimpleSAML\XMLSecurity\XML\ds\J|null
*/
public function getJ(): J
public function getJ(): ?J
{
return $this->j;
}
Expand Down
4 changes: 3 additions & 1 deletion src/XML/ds/AbstractSPKIDataType.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ abstract class AbstractSPKIDataType extends AbstractDsElement
/**
* Initialize a SPKIData element.
*
* @param array{array{\SimpleSAML\XMLSecurity\XML\ds\SPKISexp, \SimpleSAML\XML\SerializableElementInterface|null}} $tuples
* @param array{
* array{\SimpleSAML\XMLSecurity\XML\ds\SPKISexp, \SimpleSAML\XML\SerializableElementInterface|null}
* } $tuples
*/
final public function __construct(
protected array $tuples,
Expand Down
4 changes: 3 additions & 1 deletion tests/XML/ds/KeyValueTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ public function testMarshallingEmpty(): void
public function testUnmarshallingWithOtherElement(): void
{
$document = self::$empty;
$document->documentElement->appendChild($document->importNode(self::$encryptionProperty->documentElement, true));
$document->documentElement->appendChild(
$document->importNode(self::$encryptionProperty->documentElement, true),
);

$keyValue = KeyValue::fromXML($document->documentElement);

Expand Down
9 changes: 6 additions & 3 deletions tests/XML/ds/RetrievalMethodTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,12 @@ public static function setUpBeforeClass(): void
*/
public function testMarshalling(): void
{
$transforms = new Transforms(
[new Transform(C::XPATH10_URI, new XPath('self::xenc:CipherValue[@Id="example1"]', ['xenc' => C::NS_XENC]))],
);
$transforms = new Transforms([
new Transform(
C::XPATH10_URI,
new XPath('self::xenc:CipherValue[@Id="example1"]', ['xenc' => C::NS_XENC]),
),
]);

$retrievalMethod = new RetrievalMethod($transforms, '#Encrypted_KEY_ID', C:: XMLENC_ENCRYPTEDKEY);

Expand Down

0 comments on commit 2d37815

Please sign in to comment.