Code Duplication    Length = 4-4 lines in 3 locations

core/domain/services/graphql/data/mutations/DatetimeMutation.php 1 location

@@ 29-32 (lines=4) @@
26
27
        if (! empty($input['eventId'])) {
28
            $args['EVT_ID'] = absint($input['eventId']);
29
        } elseif (! empty($input['event'])) {
30
            $parts = Relay::fromGlobalId($input['event']);
31
            $args['EVT_ID'] = (! empty($parts['id']) && is_int($parts['id'])) ? $parts['id'] : null;
32
        }
33
34
        if (! empty($input['name'])) {
35
            $args['DTT_name'] = sanitize_text_field($input['name']);

core/domain/services/graphql/data/mutations/PriceMutation.php 2 locations

@@ 27-30 (lines=4) @@
24
25
        $args = [];
26
27
        if (! empty($input['priceType'])) {
28
            $parts = Relay::fromGlobalId(sanitize_text_field($input['priceType']));
29
            $args['PRT_ID'] = ! empty($parts['id']) ? absint($parts['id']) : 0;
30
        }
31
32
        if (! empty($input['name'])) {
33
            $args['PRC_name'] = sanitize_text_field($input['name']);
@@ 56-59 (lines=4) @@
53
            $args['PRC_order'] = intval($input['order']);
54
        }
55
56
        if (! empty($input['parent'])) {
57
            $parts = Relay::fromGlobalId(sanitize_text_field($input['parent']));
58
            $args['PRC_parent'] = ! empty($parts['id']) ? absint($parts['id']) : 0;
59
        }
60
61
        return $args;
62
    }