Code Duplication    Length = 15-18 lines in 2 locations

core/domain/services/graphql/resolvers/FieldResolver.php 2 locations

@@ 235-249 (lines=15) @@
232
     * @throws InvalidInterfaceException
233
     * @since $VID:$
234
     */
235
    public function resolveState($source)
236
    {
237
        switch (true) {
238
            case $source instanceof EE_Attendee:
239
            case $source instanceof EE_Venue:
240
                $state_id = $source->state_ID();
241
                break;
242
            default:
243
                $state_id = null;
244
                break;
245
        }
246
        return $state_id
247
            ? EEM_State::instance()->get_one_by_ID($state_id)
248
            : null;
249
    }
250
251
252
    /**
@@ 261-278 (lines=18) @@
258
     * @throws InvalidInterfaceException
259
     * @since $VID:$
260
     */
261
    public function resolveCountry($source)
262
    {
263
        switch (true) {
264
            case $source instanceof EE_State:
265
                $country_iso = $source->country_iso();
266
                break;
267
            case $source instanceof EE_Venue:
268
                $country_iso = $source->country_ID();
269
                break;
270
            default:
271
                $country_iso = null;
272
                break;
273
        }
274
275
        return $country_iso
276
            ? EEM_Country::instance()->get_one_by_ID($country_iso)
277
            : null;
278
    }
279
}
280