Skip to content

Commit 8471636

Browse files
committed
Fix warning on file_get_contents
1 parent 1235d2e commit 8471636

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/JsonSchema/Uri/Retrievers/FileGetContents.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,13 @@ public function retrieve($uri)
3232
'method' => 'GET',
3333
'header' => "Accept: " . Validator::SCHEMA_MEDIA_TYPE
3434
)));
35-
35+
36+
set_error_handler(function() use ($uri) {
37+
throw new ResourceNotFoundException('JSON schema not found at ' . $uri);
38+
});
3639
$response = file_get_contents($uri);
40+
restore_error_handler();
41+
3742
if (false === $response) {
3843
throw new ResourceNotFoundException('JSON schema not found at ' . $uri);
3944
}

0 commit comments

Comments
 (0)