File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616 */
1717final class Transform extends AbstractDsElement
1818{
19- /** @var \SimpleSAML\XML\Chunk[] */
20- protected array $ elements = [];
21-
2219 /** @var string */
2320 protected string $ Algorithm ;
2421
22+ /** @var \SimpleSAML\XML\Chunk[] */
23+ protected array $ elements = [];
24+
2525
2626 /**
2727 * Initialize a ds:Transform
2828 *
29- * @param \SimpleSAML\XML\Chunk[] $elements
3029 * @param string $Algorithm
30+ * @param \SimpleSAML\XML\Chunk[] $elements
3131 */
32- public function __construct (array $ elements = [], string $ Algorithm = 'http://www.w3.org/TR/1999/REC-xpath-19991116 ' )
33- {
32+ public function __construct (
33+ string $ Algorithm ,
34+ array $ elements = []
35+ ) {
3436 $ this ->setElements ($ elements );
3537 $ this ->setAlgorithm ($ Algorithm );
3638 }
@@ -117,7 +119,7 @@ public static function fromXML(DOMElement $xml): object
117119 $ elements [] = new Chunk ($ element );
118120 }
119121
120- return new self ($ elements , $ Algorithm );
122+ return new self ($ Algorithm , $ elements );
121123 }
122124
123125
Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ public function setUp(): void
4343 public function testMarshalling (): void
4444 {
4545 $ transform = new Transform (
46+ 'http://www.w3.org/TR/1999/REC-xpath-19991116 ' ,
4647 [
4748 new Chunk (DOMDocumentFactory::fromString ('<some:Chunk>Random</some:Chunk> ' )->documentElement ),
4849 new Chunk (DOMDocumentFactory::fromString ('<ds:XPath>count(//. | //@* | //namespace::*)</ds:XPath> ' )->documentElement )
@@ -94,7 +95,7 @@ public function testUnmarshalling(): void
9495 public function testMarshallingEmptyElement (): void
9596 {
9697 $ ds_ns = Transform::NS ;
97- $ transform = new Transform ([]);
98+ $ transform = new Transform (' http://www.w3.org/TR/1999/REC-xpath-19991116 ' , []);
9899 $ this ->assertEquals (
99100 "<ds:Transform xmlns:ds= \"$ ds_ns \" Algorithm= \"http://www.w3.org/TR/1999/REC-xpath-19991116 \"/> " ,
100101 strval ($ transform )
You can’t perform that action at this time.
0 commit comments