1
0
Fork 0

Avoid warnings, added documentation

This commit is contained in:
Michael 2018-09-26 22:45:13 +00:00
commit 897929ad40
2 changed files with 14 additions and 7 deletions

View file

@ -6,6 +6,7 @@ namespace Friendica\Util;
use Friendica\Core\Cache;
use digitalbazaar\jsonld as DBJsonLD;
use Exception;
/**
* @brief This class contain methods to work with JsonLD data
@ -60,7 +61,14 @@ class JsonLD
$jsonobj = json_decode(json_encode($json, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE));
return jsonld_normalize($jsonobj, array('algorithm' => 'URDNA2015', 'format' => 'application/nquads'));
try {
$normalized = jsonld_normalize($jsonobj, array('algorithm' => 'URDNA2015', 'format' => 'application/nquads'));
}
catch (Exception $e) {
logger('normalise error:' . print_r($e, true), LOGGER_DEBUG);
}
return $normalized;
}
/**