diff --git a/src/Flow/JSONPath/JSONPath.php b/src/Flow/JSONPath/JSONPath.php index 1e2bcde..b6d992f 100644 --- a/src/Flow/JSONPath/JSONPath.php +++ b/src/Flow/JSONPath/JSONPath.php @@ -21,12 +21,22 @@ class JSONPath implements ArrayAccess, Iterator, JsonSerializable, Countable * @param $data * @param int $options */ - public function __construct($data, $options = 0) + public function __construct($data = null, $options = 0) { $this->data = $data; $this->options = $options; } + /** + * @param null $data + * @return JSONPath + */ + public function setData($data): JSONPath + { + $this->data = $data; + return $this; + } + /** * Evaluate an expression *