Skip to content

Commit ccd8c2a

Browse files
committed
switch case
1 parent ade7adc commit ccd8c2a

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

includes/activity/class-activity.php

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,11 +177,17 @@ public function set_object( $data, $pre_fill = true ) {
177177
} elseif ( in_array( $type, Actor::DEFAULT_TYPES, true ) ) {
178178
$object = Actor::init_from_array( $data );
179179
} elseif ( in_array( $type, Base_Object::DEFAULT_TYPES, true ) ) {
180-
$object = match ( $type ) {
181-
'Event' => Event::init_from_array( $data ),
182-
'Place' => Place::init_from_array( $data ),
183-
default => Base_Object::init_from_array( $data ),
184-
};
180+
switch ( $type ) {
181+
case 'Event':
182+
$object = Event::init_from_array( $data );
183+
break;
184+
case 'Place':
185+
$object = Place::init_from_array( $data );
186+
break;
187+
default:
188+
$object = Base_Object::init_from_array( $data );
189+
break;
190+
}
185191
} else {
186192
$object = Generic_Object::init_from_array( $data );
187193
}

0 commit comments

Comments
 (0)