Code Duplication    Length = 21-31 lines in 3 locations

core/domain/services/admin/events/editor/AdvancedEditorData.php 3 locations

@@ 403-433 (lines=31) @@
400
     * @return array|null
401
     * @since $VID:$
402
     */
403
    protected function getGraphQLPriceTypes()
404
    {
405
        $field_key = lcfirst($this->namespace) . 'PriceTypes';
406
        $query = <<<QUERY
407
        query GET_PRICES {
408
            {$field_key} {
409
                nodes {
410
                    id
411
                    dbId
412
                    baseType
413
                    isBasePrice
414
                    isDiscount
415
                    isPercent
416
                    isTax
417
                    isTrashed
418
                    name
419
                    order
420
                    __typename
421
                }
422
                __typename
423
            }
424
        }
425
QUERY;
426
        $data = [
427
            'operation_name' => 'GET_PRICES',
428
            'query' => $query,
429
        ];
430
431
        $responseData = $this->makeGraphQLRequest($data);
432
        return !empty($responseData[ $field_key ]) ? $responseData[ $field_key ] : null;
433
    }
434
435
436
    /**
@@ 440-468 (lines=29) @@
437
     * @return array|null
438
     * @since $VID:$
439
     */
440
    protected function getGraphQLCurrentUser()
441
    {
442
        $field_key = 'viewer';
443
        $query = <<<QUERY
444
        query GET_CURRENT_USER {
445
            {$field_key} {
446
                description
447
                email
448
                firstName
449
                id
450
                name
451
                nicename
452
                nickname
453
                lastName
454
                locale
455
                userId
456
                username
457
                __typename
458
            }
459
        }
460
QUERY;
461
        $data = [
462
            'operation_name' => 'GET_CURRENT_USER',
463
            'query' => $query,
464
        ];
465
466
        $responseData = $this->makeGraphQLRequest($data);
467
        return !empty($responseData[ $field_key ]) ? $responseData[ $field_key ] : null;
468
    }
469
470
471
    /**
@@ 475-495 (lines=21) @@
472
     * @return array|null
473
     * @since $VID:$
474
     */
475
    protected function getGraphQLGeneralSettings()
476
    {
477
        $field_key = 'generalSettings';
478
        $query = <<<QUERY
479
        query GET_GENERAL_SETTINGS {
480
            {$field_key} {
481
                dateFormat
482
                timeFormat
483
                timezone
484
                __typename
485
            }
486
        }
487
QUERY;
488
        $data = [
489
            'operation_name' => 'GET_CURRENT_USER',
490
            'query' => $query,
491
        ];
492
493
        $responseData = $this->makeGraphQLRequest($data);
494
        return !empty($responseData[ $field_key ]) ? $responseData[ $field_key ] : null;
495
    }
496
497
498
    /**