You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (!(Z_TYPE_P(filter) ==IS_ARRAY||Z_TYPE_P(filter) ==IS_OBJECT)) {
324
-
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENTTSRMLS_CC, "Expected filter to be array or object, %s given", zend_get_type_by_const(Z_TYPE_P(filter)));
325
-
return false;
323
+
if (bson_iter_init_find(&iter, bson, key) &&BSON_ITER_HOLDS_INT32(&iter)) {
324
+
returnbson_iter_int32(&iter);
326
325
}
327
-
convert_to_object(filter);
328
326
329
-
MAKE_STD_ZVAL(zquery);
330
-
array_init(zquery);
327
+
returnfallback;
328
+
}
331
329
332
-
if (options) {
333
-
/* TODO: Ensure batchSize, limit, and skip are 32-bit */
if (modifiers&& !(Z_TYPE_P(modifiers) ==IS_ARRAY||Z_TYPE_P(modifiers) ==IS_OBJECT)) {
352
-
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENTTSRMLS_CC, "Expected modifiers to be array or object, %s given", zend_get_type_by_const(Z_TYPE_P(modifiers)));
if (bson_iter_init_find(&iter, options, "projection")) {
389
+
uint32_tlen=0;
390
+
constuint8_t*data=NULL;
362
391
363
-
if (projection&& !(Z_TYPE_P(projection) ==IS_ARRAY||Z_TYPE_P(projection) ==IS_OBJECT)) {
364
-
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENTTSRMLS_CC, "Expected projection to be array or object, %s given", zend_get_type_by_const(Z_TYPE_P(projection)));
365
-
zval_ptr_dtor(&zquery);
392
+
if (! (BSON_ITER_HOLDS_DOCUMENT (&iter) ||BSON_ITER_HOLDS_ARRAY (&iter))) {
393
+
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENTTSRMLS_CC, "Expected projection to be array or object, %d given", bson_iter_type(&iter));
if (bson_iter_init_find(&iter, options, "sort")) {
402
+
bson_ttmp;
403
+
uint32_tlen=0;
404
+
constuint8_t*data=NULL;
375
405
376
-
if (sort&& !(Z_TYPE_P(sort) ==IS_ARRAY||Z_TYPE_P(sort) ==IS_OBJECT)) {
377
-
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENTTSRMLS_CC, "Expected sort to be array or object, %s given", zend_get_type_by_const(Z_TYPE_P(sort)));
378
-
zval_ptr_dtor(&zquery);
406
+
if (! (BSON_ITER_HOLDS_DOCUMENT (&iter) ||BSON_ITER_HOLDS_ARRAY (&iter))) {
407
+
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENTTSRMLS_CC, "Expected sort to be array or object, %d given", bson_iter_type(&iter));
0 commit comments