9
9
10
10
namespace ML \JsonLD ;
11
11
12
- use stdClass as Object ;
12
+ use stdClass as JsonObject ;
13
13
use ML \JsonLD \Exception \JsonLdException ;
14
14
use ML \JsonLD \Exception \InvalidQuadException ;
15
15
use ML \IRI \IRI ;
@@ -72,8 +72,8 @@ class JsonLD
72
72
* The options parameter might be passed as associative array or as
73
73
* object.
74
74
*
75
- * @param string|object |array $input The JSON-LD document to process.
76
- * @param null|array|object $options Options to configure the processing.
75
+ * @param string|JsonObject |array $input The JSON-LD document to process.
76
+ * @param null|array|JsonObject $options Options to configure the processing.
77
77
*
78
78
* @return Document The parsed JSON-LD document.
79
79
*
@@ -121,9 +121,9 @@ public static function getDocument($input, $options = null)
121
121
* The options parameter might be passed as associative array or as
122
122
* object.
123
123
*
124
- * @param string|object |array $input The JSON-LD document to expand.
125
- * @param null|array|object $options Options to configure the expansion
126
- * process.
124
+ * @param string|JsonObject |array $input The JSON-LD document to expand.
125
+ * @param null|array|JsonObject $options Options to configure the expansion
126
+ * process.
127
127
*
128
128
* @return array The expanded JSON-LD document.
129
129
*
@@ -209,13 +209,13 @@ public static function expand($input, $options = null)
209
209
* The options parameter might be passed as associative array or as
210
210
* object.
211
211
*
212
- * @param string|object |array $input The JSON-LD document to
212
+ * @param string|JsonObject |array $input The JSON-LD document to
213
213
* compact.
214
- * @param null|string|object |array $context The context.
215
- * @param null|array|object $options Options to configure the
214
+ * @param null|string|JsonObject |array $context The context.
215
+ * @param null|array|JsonObject $options Options to configure the
216
216
* compaction process.
217
217
*
218
- * @return object The compacted JSON-LD document.
218
+ * @return JsonObject The compacted JSON-LD document.
219
219
*
220
220
* @throws JsonLdException
221
221
*
@@ -236,17 +236,17 @@ public static function compact($input, $context = null, $options = null)
236
236
* In contrast to {@link compact()}, this method assumes that the input
237
237
* has already been expanded.
238
238
*
239
- * @param array $input The JSON-LD document to
240
- * compact.
241
- * @param null|string|object |array $context The context.
242
- * @param object $options Options to configure the
243
- * compaction process.
244
- * @param bool $alwaysGraph If set to true, the resulting
245
- * document will always explicitly
246
- * contain the default graph at
247
- * the top-level.
239
+ * @param array $input The JSON-LD document to
240
+ * compact.
241
+ * @param null|string|JsonObject |array $context The context.
242
+ * @param JsonObject $options Options to configure the
243
+ * compaction process.
244
+ * @param bool $alwaysGraph If set to true, the resulting
245
+ * document will always explicitly
246
+ * contain the default graph at
247
+ * the top-level.
248
248
*
249
- * @return object The compacted JSON-LD document.
249
+ * @return JsonObject The compacted JSON-LD document.
250
250
*
251
251
* @throws JsonLdException
252
252
*/
@@ -274,7 +274,7 @@ private static function doCompact($input, $context, $options, $alwaysGraph = fal
274
274
275
275
$ processor ->compact ($ input , $ activectx , $ inversectx );
276
276
277
- $ compactedDocument = new Object ();
277
+ $ compactedDocument = new JsonObject ();
278
278
if (null !== $ context ) {
279
279
$ compactedDocument ->{'@context ' } = $ context ;
280
280
}
@@ -335,15 +335,15 @@ private static function doCompact($input, $context, $options, $alwaysGraph = fal
335
335
* The options parameter might be passed as associative array or as
336
336
* object.
337
337
*
338
- * @param string|object |array $input The JSON-LD document to flatten.
339
- * @param null|string|object |array $context The context to compact the
340
- * flattened document. If
341
- * <em>null</em> is passed, the
342
- * result will not be compacted.
343
- * @param null|array|object $options Options to configure the
344
- * flattening process.
338
+ * @param string|JsonObject |array $input The JSON-LD document to flatten.
339
+ * @param null|string|JsonObject |array $context The context to compact the
340
+ * flattened document. If
341
+ * <em>null</em> is passed, the
342
+ * result will not be compacted.
343
+ * @param null|array|JsonObject $options Options to configure the
344
+ * flattening process.
345
345
*
346
- * @return object The flattened JSON-LD document.
346
+ * @return JsonObject The flattened JSON-LD document.
347
347
*
348
348
* @throws JsonLdException
349
349
*
@@ -394,9 +394,9 @@ public static function flatten($input, $context = null, $options = null)
394
394
* The options parameter might be passed as associative array or as
395
395
* object.
396
396
*
397
- * @param string|object |array $input The JSON-LD document to expand.
398
- * @param null|array|object $options Options to configure the expansion
399
- * process.
397
+ * @param string|JsonObject |array $input The JSON-LD document to expand.
398
+ * @param null|array|JsonObject $options Options to configure the expansion
399
+ * process.
400
400
*
401
401
* @return Quad[] The extracted quads.
402
402
*
@@ -445,9 +445,9 @@ public static function toRdf($input, $options = null)
445
445
* The options parameter might be passed as associative array or as
446
446
* object.
447
447
*
448
- * @param Quad[] $quads Array of quads.
449
- * @param null|array|object $options Options to configure the expansion
450
- * process.
448
+ * @param Quad[] $quads Array of quads.
449
+ * @param null|array|JsonObject $options Options to configure the expansion
450
+ * process.
451
451
*
452
452
* @return array The JSON-LD document in expanded form.
453
453
*
@@ -503,12 +503,12 @@ public static function fromRdf(array $quads, $options = null)
503
503
* The options parameter might be passed as associative array or as
504
504
* object.
505
505
*
506
- * @param string|object |array $input The JSON-LD document to compact.
507
- * @param string|object $frame The frame.
508
- * @param null|array|object $options Options to configure the framing
509
- * process.
506
+ * @param string|JsonObject |array $input The JSON-LD document to compact.
507
+ * @param string|JsonObject $frame The frame.
508
+ * @param null|array|JsonObject $options Options to configure the framing
509
+ * process.
510
510
*
511
- * @return object The framed JSON-LD document.
511
+ * @return JsonObject The framed JSON-LD document.
512
512
*
513
513
* @throws JsonLdException
514
514
*
@@ -534,7 +534,7 @@ public static function frame($input, $frame, $options = null)
534
534
$ processor = new Processor ($ options );
535
535
536
536
// Store the frame's context as $frame gets modified
537
- $ frameContext = new Object ();
537
+ $ frameContext = new JsonObject ();
538
538
if (property_exists ($ frame , '@context ' )) {
539
539
$ frameContext ->{'@context ' } = $ frame ->{'@context ' };
540
540
}
@@ -604,9 +604,9 @@ function ($match) {
604
604
/**
605
605
* Merge the passed options with the options' default values.
606
606
*
607
- * @param null|array|object $options The options.
607
+ * @param null|array|JsonObject $options The options.
608
608
*
609
- * @return object The merged options.
609
+ * @return JsonObject The merged options.
610
610
*/
611
611
private static function mergeOptions ($ options )
612
612
{
0 commit comments