Skip to content

Commit 558a08e

Browse files
committed
Allow calling ImageRegion's constructor without arguments
1 parent f6b4677 commit 558a08e

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/Metadata/Xmp/ImageRegion.php

+11-3
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,19 @@ class ImageRegion
8181
public $rbVertices;
8282

8383
/**
84-
* @param \DOMXPath $xpath
85-
* @param \DOMNode $node <rdf:li> node.
84+
* Initialize members if a node is provided.
85+
*
86+
* @param \DOMXPath|null $xpath
87+
* @param \DOMNode|null $node <rdf:li> node.
8688
*/
87-
public function __construct($xpath, $node)
89+
public function __construct($xpath = null, $node = null)
8890
{
91+
if (!$xpath || !$node) {
92+
// A test case probably wants to forge manually an instance of this
93+
// class.
94+
return;
95+
}
96+
8997
$this->id = self::getNodeValue($xpath, 'Iptc4xmpExt:rId', $node);
9098
$this->names = self::getNodeValues(
9199
$xpath,

0 commit comments

Comments
 (0)