Skip to content

Commit 8a06661

Browse files
committed
Rename ce member for consistency
1 parent 1de4deb commit 8a06661

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/phongo_bson.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,7 @@ static void php_phongo_handle_field_path_entry_for_compound_type(php_phongo_bson
759759
break;
760760
case PHONGO_TYPEMAP_CLASS:
761761
element->type = entry->node.type;
762-
element->class = entry->node.class;
762+
element->ce = entry->node.ce;
763763
break;
764764
default:
765765
/* Do nothing - pacify compiler */
@@ -900,7 +900,7 @@ static bool php_phongo_bson_visit_document(const bson_iter_t* iter ARG_UNUSED, c
900900

901901
case PHONGO_TYPEMAP_CLASS: {
902902
zval obj;
903-
zend_class_entry* obj_ce = state.odm ? state.odm : state.map.document.class;
903+
zend_class_entry* obj_ce = state.odm ? state.odm : state.map.document.ce;
904904

905905
if (!php_phongo_bson_init_document_object(&state.zchild, obj_ce, &obj)) {
906906
/* Exception already thrown. Clean up and return
@@ -975,7 +975,7 @@ static bool php_phongo_bson_visit_array(const bson_iter_t* iter ARG_UNUSED, cons
975975
case PHONGO_TYPEMAP_CLASS: {
976976
zval obj;
977977

978-
object_init_ex(&obj, state.map.array.class);
978+
object_init_ex(&obj, state.map.array.ce);
979979
zend_call_method_with_1_params(PHONGO_COMPAT_OBJ_P(&obj), NULL, NULL, BSON_UNSERIALIZE_FUNC_NAME, NULL, &state.zchild);
980980
zval_ptr_dtor(&state.zchild);
981981
ZVAL_COPY_VALUE(&state.zchild, &obj);
@@ -1124,7 +1124,7 @@ bool php_phongo_bson_to_zval_ex(const bson_t* b, php_phongo_bson_state* state)
11241124

11251125
case PHONGO_TYPEMAP_CLASS: {
11261126
zval obj;
1127-
zend_class_entry* obj_ce = state->odm ? state->odm : state->map.root.class;
1127+
zend_class_entry* obj_ce = state->odm ? state->odm : state->map.root.ce;
11281128

11291129
#if PHP_VERSION_ID >= 80100
11301130
/* Enums require special handling for instantiation */
@@ -1267,12 +1267,12 @@ static bool php_phongo_bson_state_parse_type(zval* options, const char* name, ph
12671267

12681268
if (!strcasecmp(classname, "array")) {
12691269
element->type = PHONGO_TYPEMAP_NATIVE_ARRAY;
1270-
element->class = NULL;
1270+
element->ce = NULL;
12711271
} else if (!strcasecmp(classname, "stdclass") || !strcasecmp(classname, "object")) {
12721272
element->type = PHONGO_TYPEMAP_NATIVE_OBJECT;
1273-
element->class = NULL;
1273+
element->ce = NULL;
12741274
} else {
1275-
if ((element->class = php_phongo_bson_state_fetch_class(classname, classname_len, php_phongo_unserializable_ce))) {
1275+
if ((element->ce = php_phongo_bson_state_fetch_class(classname, classname_len, php_phongo_unserializable_ce))) {
12761276
element->type = PHONGO_TYPEMAP_CLASS;
12771277
} else {
12781278
retval = false;
@@ -1290,7 +1290,7 @@ static bool php_phongo_bson_state_parse_type(zval* options, const char* name, ph
12901290
static void field_path_map_element_set_info(php_phongo_field_path_map_element* element, php_phongo_bson_typemap_element* typemap_element)
12911291
{
12921292
element->node.type = typemap_element->type;
1293-
element->node.class = typemap_element->class;
1293+
element->node.ce = typemap_element->ce;
12941294
}
12951295

12961296
static void map_add_field_path_element(php_phongo_bson_typemap* map, php_phongo_field_path_map_element* element)

src/phongo_bson.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ typedef enum {
4949

5050
typedef struct {
5151
php_phongo_bson_typemap_types type;
52-
zend_class_entry* class;
52+
zend_class_entry* ce;
5353
} php_phongo_bson_typemap_element;
5454

5555
typedef struct {

0 commit comments

Comments
 (0)