Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix schema path and strict flag forwarding #2

Merged
merged 3 commits into from
Apr 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Ifdo.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public static function fromFile($path, $strict = false): Ifdo

public static function fromString($data, $strict = false): Ifdo
{
return new Ifdo($data, true);
return new Ifdo($data, $strict);
}

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

if ($this->getDebug() && ! empty($this->getErrors()))
{
Expand Down
Loading