Skip to content

Commit 531ba5a

Browse files
authored
Merge pull request #2 from biigle/mzur-patch-1
Fix schema path and strict flag forwarding
2 parents 3edfcdc + d1c52ca commit 531ba5a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Ifdo.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public static function fromFile($path, $strict = false): Ifdo
1919

2020
public static function fromString($data, $strict = false): Ifdo
2121
{
22-
return new Ifdo($data, true);
22+
return new Ifdo($data, $strict);
2323
}
2424

2525
public function __construct($json, $strict = false)
@@ -49,7 +49,7 @@ public function revalidate(): void
4949
$this->validator = new \JsonSchema\Validator;
5050
$version = $this->getIfdoVersion();
5151
$decoded = json_decode($this->toString());
52-
$this->validator->validate($decoded, (object) ['$ref' => 'file://' . realpath("assets/ifdo-$version.json")]);
52+
$this->validator->validate($decoded, (object) ['$ref' => 'file://'.__DIR__."/../assets/ifdo-$version.json"]);
5353

5454
if ($this->getDebug() && ! empty($this->getErrors()))
5555
{

0 commit comments

Comments
 (0)