@@ -244,7 +244,7 @@ function simdjson_is_valid(string $json, int $depth = 512): bool {}
244
244
* When false, JSON objects will be returned as objects.
245
245
* @param int $depth the maximum nesting depth of the structure being decoded.
246
246
* @return array|stdClass|string|float|int|bool|null
247
- * @throws SimdJsonException for invalid JSON
247
+ * @throws SimdJsonDecoderException for invalid JSON
248
248
* (or $json over 4GB long, or out of range integer/float)
249
249
* @throws ValueError for invalid $depth
250
250
*/
@@ -259,7 +259,7 @@ function simdjson_decode(string $json, bool $associative = false, int $depth = 5
259
259
* When false, JSON objects will be returned as objects.
260
260
* @param int $depth the maximum nesting depth of the structure being decoded.
261
261
* @return array|stdClass|string|float|int|bool|null
262
- * @throws SimdJsonException for invalid JSON
262
+ * @throws SimdJsonDecoderException for invalid JSON
263
263
* (or $json over 4GB long, or out of range integer/float)
264
264
* @throws ValueError for invalid $depth
265
265
*/
@@ -274,7 +274,7 @@ function simdjson_decode_from_stream($res, bool $associative = false, int $depth
274
274
* @param bool $associative When true, JSON objects will be returned as associative arrays.
275
275
* When false, JSON objects will be returned as objects.
276
276
* @return array|stdClass|string|float|int|bool|null the value at $key
277
- * @throws SimdJsonException for invalid JSON or invalid JSON pointer
277
+ * @throws SimdJsonDecoderException for invalid JSON or invalid JSON pointer
278
278
* (or document over 4GB, or out of range integer/float)
279
279
* @throws ValueError for invalid $depth
280
280
* @see https://www.rfc-editor.org/rfc/rfc6901.html
@@ -291,7 +291,7 @@ function simdjson_key_value(string $json, string $key, bool $associative = false
291
291
* returning 0 for JSON pointers
292
292
* to values that are neither objects nor arrays.
293
293
* @return int
294
- * @throws SimdJsonException for invalid JSON or invalid JSON pointer
294
+ * @throws SimdJsonDecoderException for invalid JSON or invalid JSON pointer
295
295
* (or document over 4GB, or out of range integer/float)
296
296
* @throws ValueError for invalid $depth
297
297
* @see https://www.rfc-editor.org/rfc/rfc6901.html
@@ -305,7 +305,7 @@ function simdjson_key_count(string $json, string $key, int $depth = 512, bool $t
305
305
* @param string $key The JSON pointer being requested
306
306
* @param int $depth the maximum nesting depth of the structure being decoded.
307
307
* @return bool (false if key is not found)
308
- * @throws SimdJsonException for invalid JSON or invalid JSON pointer
308
+ * @throws SimdJsonDecoderException for invalid JSON or invalid JSON pointer
309
309
* (or document over 4GB, or out of range integer/float)
310
310
* @throws ValueError for invalid $depth
311
311
* @see https://www.rfc-editor.org/rfc/rfc6901.html
@@ -332,21 +332,25 @@ function simdjson_is_valid_utf8(string $string): bool {}
332
332
* @param int $flags Bitmask consisting of SIMDJSON_PRETTY_PRINT or SIMDJSON_APPEND_NEWLINE.
333
333
* @param int $depth Set the maximum depth. Must be greater than zero.
334
334
* @return string
335
+ * @throws SimdJsonEncoderException
336
+ * @throws ValueError for invalid $depth
335
337
*/
336
338
function simdjson_encode (mixed $ value , int $ flags = 0 , int $ depth = 512 ): string {}
337
339
338
340
/**
339
341
* Writes the JSON representation of a value to given stream
340
342
*
341
- * @param mixed $value The value being encoded. Can be any type except a resource.
342
- * @param resource $res A file system pointer resource that is typically created using fopen().
343
- * @param int $flags Bitmask consisting of SIMDJSON_PRETTY_PRINT, SIMDJSON_APPEND_NEWLINE or SIMDJSON_INVALID_UTF8_SUBSTITUTE.
344
- * @param int $depth Set the maximum depth. Must be greater than zero.
345
- * @return bool
343
+ * @param mixed $value The value being encoded. Can be any type except a resource.
344
+ * @param resource $res A file system pointer resource that is typically created using fopen().
345
+ * @param int $flags Bitmask consisting of SIMDJSON_PRETTY_PRINT, SIMDJSON_APPEND_NEWLINE or SIMDJSON_INVALID_UTF8_SUBSTITUTE.
346
+ * @param int $depth Set the maximum depth. Must be greater than zero.
347
+ * @return bool
348
+ * @throws SimdJsonEncoderException
349
+ * @throws ValueError for invalid $depth
346
350
*/
347
351
function simdjson_encode_to_stream (mixed $ value , $ res , int $ flags = 0 , int $ depth = 512 ) : true {}
348
352
349
- class SimdJsonException extends RuntimeException {}
353
+ abstract class SimdJsonException extends RuntimeException {}
350
354
351
355
class SimdJsonDecoderException extends SimdJsonException {}
352
356
0 commit comments