Code Duplication    Length = 4-4 lines in 3 locations

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

@@ 35-38 (lines=4) @@
32
33
        if (! empty($input['eventId'])) {
34
            $args['EVT_ID'] = absint($input['eventId']);
35
        } elseif (! empty($input['event'])) {
36
            $parts = Relay::fromGlobalId($input['event']);
37
            $args['EVT_ID'] = (! empty($parts['id']) && is_int($parts['id'])) ? $parts['id'] : null;
38
        }
39
40
        if (! empty($input['name'])) {
41
            $args['DTT_name'] = sanitize_text_field($input['name']);

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

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