Skip to content

Commit 77950c5

Browse files
authored
PHPC-2130: Remove proto comments in favour of stubs (#1350)
* PHPC-2130: Remove proto comments in favour of stubs * Remove emacs folding markers
1 parent 7a0b04c commit 77950c5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+1381
-1865
lines changed

src/BSON/Binary.c

Lines changed: 33 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ zend_class_entry* php_phongo_binary_ce;
3030

3131
/* Initialize the object and return whether it was successful. An exception will
3232
* be thrown on error. */
33-
static bool php_phongo_binary_init(php_phongo_binary_t* intern, const char* data, size_t data_len, zend_long type) /* {{{ */
33+
static bool php_phongo_binary_init(php_phongo_binary_t* intern, const char* data, size_t data_len, zend_long type)
3434
{
3535
if (type < 0 || type > UINT8_MAX) {
3636
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENT, "Expected type to be an unsigned 8-bit integer, %" PHONGO_LONG_FORMAT " given", type);
@@ -47,11 +47,11 @@ static bool php_phongo_binary_init(php_phongo_binary_t* intern, const char* data
4747
intern->type = (uint8_t) type;
4848

4949
return true;
50-
} /* }}} */
50+
}
5151

5252
/* Initialize the object from a HashTable and return whether it was successful.
5353
* An exception will be thrown on error. */
54-
static bool php_phongo_binary_init_from_hash(php_phongo_binary_t* intern, HashTable* props) /* {{{ */
54+
static bool php_phongo_binary_init_from_hash(php_phongo_binary_t* intern, HashTable* props)
5555
{
5656
zval *data, *type;
5757

@@ -63,9 +63,9 @@ static bool php_phongo_binary_init_from_hash(php_phongo_binary_t* intern, HashTa
6363

6464
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENT, "%s initialization requires \"data\" string and \"type\" integer fields", ZSTR_VAL(php_phongo_binary_ce->name));
6565
return false;
66-
} /* }}} */
66+
}
6767

68-
static HashTable* php_phongo_binary_get_properties_hash(phongo_compat_object_handler_type* object, bool is_temp) /* {{{ */
68+
static HashTable* php_phongo_binary_get_properties_hash(phongo_compat_object_handler_type* object, bool is_temp)
6969
{
7070
php_phongo_binary_t* intern;
7171
HashTable* props;
@@ -89,10 +89,9 @@ static HashTable* php_phongo_binary_get_properties_hash(phongo_compat_object_han
8989
}
9090

9191
return props;
92-
} /* }}} */
92+
}
9393

94-
/* {{{ proto void MongoDB\BSON\Binary::__construct(string $data, int $type)
95-
Construct a new BSON binary type */
94+
/* Construct a new BSON binary type */
9695
static PHP_METHOD(MongoDB_BSON_Binary, __construct)
9796
{
9897
php_phongo_binary_t* intern;
@@ -108,10 +107,8 @@ static PHP_METHOD(MongoDB_BSON_Binary, __construct)
108107
PHONGO_PARSE_PARAMETERS_END();
109108

110109
php_phongo_binary_init(intern, data, data_len, type);
111-
} /* }}} */
110+
}
112111

113-
/* {{{ proto MongoDB\BSON\Binary MongoDB\BSON\Binary::__set_state(array $properties)
114-
*/
115112
static PHP_METHOD(MongoDB_BSON_Binary, __set_state)
116113
{
117114
php_phongo_binary_t* intern;
@@ -128,10 +125,9 @@ static PHP_METHOD(MongoDB_BSON_Binary, __set_state)
128125
props = Z_ARRVAL_P(array);
129126

130127
php_phongo_binary_init_from_hash(intern, props);
131-
} /* }}} */
128+
}
132129

133-
/* {{{ proto string MongoDB\BSON\Binary::__toString()
134-
Return the Binary's data string. */
130+
/* Return the Binary's data string. */
135131
static PHP_METHOD(MongoDB_BSON_Binary, __toString)
136132
{
137133
php_phongo_binary_t* intern;
@@ -141,10 +137,8 @@ static PHP_METHOD(MongoDB_BSON_Binary, __toString)
141137
intern = Z_BINARY_OBJ_P(getThis());
142138

143139
RETURN_STRINGL(intern->data, intern->data_len);
144-
} /* }}} */
140+
}
145141

146-
/* {{{ proto string MongoDB\BSON\Binary::getData()
147-
*/
148142
static PHP_METHOD(MongoDB_BSON_Binary, getData)
149143
{
150144
php_phongo_binary_t* intern;
@@ -154,10 +148,8 @@ static PHP_METHOD(MongoDB_BSON_Binary, getData)
154148
PHONGO_PARSE_PARAMETERS_NONE();
155149

156150
RETURN_STRINGL(intern->data, intern->data_len);
157-
} /* }}} */
151+
}
158152

159-
/* {{{ proto integer MongoDB\BSON\Binary::getType()
160-
*/
161153
static PHP_METHOD(MongoDB_BSON_Binary, getType)
162154
{
163155
php_phongo_binary_t* intern;
@@ -167,10 +159,8 @@ static PHP_METHOD(MongoDB_BSON_Binary, getType)
167159
PHONGO_PARSE_PARAMETERS_NONE();
168160

169161
RETURN_LONG(intern->type);
170-
} /* }}} */
162+
}
171163

172-
/* {{{ proto array MongoDB\BSON\Binary::jsonSerialize()
173-
*/
174164
static PHP_METHOD(MongoDB_BSON_Binary, jsonSerialize)
175165
{
176166
php_phongo_binary_t* intern;
@@ -191,10 +181,8 @@ static PHP_METHOD(MongoDB_BSON_Binary, jsonSerialize)
191181

192182
type_len = snprintf(type, sizeof(type), "%02x", intern->type);
193183
ADD_ASSOC_STRINGL(return_value, "$type", type, type_len);
194-
} /* }}} */
184+
}
195185

196-
/* {{{ proto string MongoDB\BSON\Binary::serialize()
197-
*/
198186
static PHP_METHOD(MongoDB_BSON_Binary, serialize)
199187
{
200188
php_phongo_binary_t* intern;
@@ -219,10 +207,8 @@ static PHP_METHOD(MongoDB_BSON_Binary, serialize)
219207

220208
smart_str_free(&buf);
221209
zval_ptr_dtor(&retval);
222-
} /* }}} */
210+
}
223211

224-
/* {{{ proto void MongoDB\BSON\Binary::unserialize(string $serialized)
225-
*/
226212
static PHP_METHOD(MongoDB_BSON_Binary, unserialize)
227213
{
228214
php_phongo_binary_t* intern;
@@ -249,19 +235,15 @@ static PHP_METHOD(MongoDB_BSON_Binary, unserialize)
249235

250236
php_phongo_binary_init_from_hash(intern, HASH_OF(&props));
251237
zval_ptr_dtor(&props);
252-
} /* }}} */
238+
}
253239

254-
/* {{{ proto array MongoDB\Driver\Binary::__serialize()
255-
*/
256240
static PHP_METHOD(MongoDB_BSON_Binary, __serialize)
257241
{
258242
PHONGO_PARSE_PARAMETERS_NONE();
259243

260244
RETURN_ARR(php_phongo_binary_get_properties_hash(PHONGO_COMPAT_OBJ_P(getThis()), true));
261-
} /* }}} */
245+
}
262246

263-
/* {{{ proto void MongoDB\Driver\Binary::__unserialize(array $data)
264-
*/
265247
static PHP_METHOD(MongoDB_BSON_Binary, __unserialize)
266248
{
267249
zval* data;
@@ -271,12 +253,12 @@ static PHP_METHOD(MongoDB_BSON_Binary, __unserialize)
271253
PHONGO_PARSE_PARAMETERS_END();
272254

273255
php_phongo_binary_init_from_hash(Z_BINARY_OBJ_P(getThis()), Z_ARRVAL_P(data));
274-
} /* }}} */
256+
}
275257

276-
/* {{{ MongoDB\BSON\Binary object handlers */
258+
/* MongoDB\BSON\Binary object handlers */
277259
static zend_object_handlers php_phongo_handler_binary;
278260

279-
static void php_phongo_binary_free_object(zend_object* object) /* {{{ */
261+
static void php_phongo_binary_free_object(zend_object* object)
280262
{
281263
php_phongo_binary_t* intern = Z_OBJ_BINARY(object);
282264

@@ -290,9 +272,9 @@ static void php_phongo_binary_free_object(zend_object* object) /* {{{ */
290272
zend_hash_destroy(intern->properties);
291273
FREE_HASHTABLE(intern->properties);
292274
}
293-
} /* }}} */
275+
}
294276

295-
static zend_object* php_phongo_binary_create_object(zend_class_entry* class_type) /* {{{ */
277+
static zend_object* php_phongo_binary_create_object(zend_class_entry* class_type)
296278
{
297279
php_phongo_binary_t* intern = zend_object_alloc(sizeof(php_phongo_binary_t), class_type);
298280

@@ -302,9 +284,9 @@ static zend_object* php_phongo_binary_create_object(zend_class_entry* class_type
302284
intern->std.handlers = &php_phongo_handler_binary;
303285

304286
return &intern->std;
305-
} /* }}} */
287+
}
306288

307-
static zend_object* php_phongo_binary_clone_object(phongo_compat_object_handler_type* object) /* {{{ */
289+
static zend_object* php_phongo_binary_clone_object(phongo_compat_object_handler_type* object)
308290
{
309291
php_phongo_binary_t* intern;
310292
php_phongo_binary_t* new_intern;
@@ -319,9 +301,9 @@ static zend_object* php_phongo_binary_clone_object(phongo_compat_object_handler_
319301
php_phongo_binary_init(new_intern, intern->data, intern->data_len, intern->type);
320302

321303
return new_object;
322-
} /* }}} */
304+
}
323305

324-
static int php_phongo_binary_compare_objects(zval* o1, zval* o2) /* {{{ */
306+
static int php_phongo_binary_compare_objects(zval* o1, zval* o2)
325307
{
326308
php_phongo_binary_t *intern1, *intern2;
327309

@@ -341,21 +323,20 @@ static int php_phongo_binary_compare_objects(zval* o1, zval* o2) /* {{{ */
341323
}
342324

343325
return zend_binary_strcmp(intern1->data, intern1->data_len, intern2->data, intern2->data_len);
344-
} /* }}} */
326+
}
345327

346-
static HashTable* php_phongo_binary_get_debug_info(phongo_compat_object_handler_type* object, int* is_temp) /* {{{ */
328+
static HashTable* php_phongo_binary_get_debug_info(phongo_compat_object_handler_type* object, int* is_temp)
347329
{
348330
*is_temp = 1;
349331
return php_phongo_binary_get_properties_hash(object, true);
350-
} /* }}} */
332+
}
351333

352-
static HashTable* php_phongo_binary_get_properties(phongo_compat_object_handler_type* object) /* {{{ */
334+
static HashTable* php_phongo_binary_get_properties(phongo_compat_object_handler_type* object)
353335
{
354336
return php_phongo_binary_get_properties_hash(object, false);
355-
} /* }}} */
356-
/* }}} */
337+
}
357338

358-
void php_phongo_binary_init_ce(INIT_FUNC_ARGS) /* {{{ */
339+
void php_phongo_binary_init_ce(INIT_FUNC_ARGS)
359340
{
360341
php_phongo_binary_ce = register_class_MongoDB_BSON_Binary(php_phongo_binary_interface_ce, php_phongo_json_serializable_ce, php_phongo_type_ce, zend_ce_serializable);
361342
php_phongo_binary_ce->create_object = php_phongo_binary_create_object;
@@ -371,4 +352,4 @@ void php_phongo_binary_init_ce(INIT_FUNC_ARGS) /* {{{ */
371352
php_phongo_handler_binary.get_properties = php_phongo_binary_get_properties;
372353
php_phongo_handler_binary.free_obj = php_phongo_binary_free_object;
373354
php_phongo_handler_binary.offset = XtOffsetOf(php_phongo_binary_t, std);
374-
} /* }}} */
355+
}

src/BSON/BinaryInterface.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
zend_class_entry* php_phongo_binary_interface_ce;
2323

24-
void php_phongo_binary_interface_init_ce(INIT_FUNC_ARGS) /* {{{ */
24+
void php_phongo_binary_interface_init_ce(INIT_FUNC_ARGS)
2525
{
2626
php_phongo_binary_interface_ce = register_class_MongoDB_BSON_BinaryInterface();
27-
} /* }}} */
27+
}

0 commit comments

Comments
 (0)