Skip to content

Commit 2113aac

Browse files
committed
Fix doc comments (and add more)
1 parent 345056c commit 2113aac

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

classes/Types.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,13 @@ ZEND_ARG_OBJ_INFO(0, buffer, pmmp\\encoding\\ByteBufferWriter, 0)
3636
ZEND_ARG_ARRAY_INFO(0, values, 0)
3737
ZEND_END_ARG_INFO()
3838

39-
static const char* read_int_array_doc_comment = "/**\n\t * @return int[]\n\t * @phpstan-return list<int>\n\t */";
40-
static const char* read_float_array_doc_comment = "/**\n\t * @return float[]\n\t * @phpstan-return list<float>\n\t */";
39+
#if PHP_VERSION_ID >= 80400
40+
static const char* read_int_array_doc_comment = "/**\n\t * @return int[]\n\t * @phpstan-return list<int>\n\t * @throws DataDecodeException\n\t */";
41+
static const char* read_float_array_doc_comment = "/**\n\t * @return float[]\n\t * @phpstan-return list<float>\n\t * @throws DataDecodeException\n\t */";
4142
static const char* write_int_array_doc_comment = "/**\n\t * @param int[] $values\n\t * @phpstan-param list<int> $values\n\t */";
4243
static const char* write_float_array_doc_comment = "/**\n\t * @param float[] $values\n\t * @phpstan-param list<float> $values\n\t */";
44+
static const char* read_generic_doc_comment = "/** @throws DataDecodeException */";
45+
#endif
4346

4447
template<typename TValue>
4548
static inline void zval_long_wrapper(zval* zv, TValue value) {
@@ -258,10 +261,11 @@ ZEND_NAMED_FUNCTION(pmmp_encoding_private_constructor) {
258261
#endif
259262

260263
#define TYPE_ENTRIES(zend_name, native_type, read_type, read_result_wrapper, arg_info_read, write_parameter_wrapper, write_type, arg_info_write) \
261-
BC_ZEND_RAW_FENTRY( \
264+
BC_ZEND_RAW_FENTRY_WITH_DOC_COMMENT( \
262265
"read" zend_name, \
263266
(zif_readType<native_type, read_type, read_result_wrapper<native_type>>), \
264-
arg_info_read \
267+
arg_info_read, \
268+
read_generic_doc_comment \
265269
) \
266270
\
267271
BC_ZEND_RAW_FENTRY( \

0 commit comments

Comments
 (0)