Code Duplication    Length = 29-37 lines in 2 locations

core/domain/entities/admin/GraphQLData/CurrentUser.php 1 location

@@ 13-49 (lines=37) @@
10
 * @author  Manzoor Wani
11
 * @since   $VID:$
12
 */
13
class CurrentUser extends GraphQLData
14
{
15
16
    /**
17
     * @param array $where_params
18
     * @return array|null
19
     * @since $VID:$
20
     */
21
    public function getData(array $where_params = [])
22
    {
23
        $field_key = 'viewer';
24
        $query = <<<QUERY
25
        query GET_CURRENT_USER {
26
            {$field_key} {
27
                description
28
                email
29
                firstName
30
                id
31
                name
32
                nicename
33
                nickname
34
                lastName
35
                locale
36
                userId
37
                username
38
                __typename
39
            }
40
        }
41
QUERY;
42
        $this->setParams([
43
            'operation_name' => 'GET_CURRENT_USER',
44
            'query'          => $query,
45
        ]);
46
47
        return $this->getQueryResponse($field_key, $where_params);
48
    }
49
}
50

core/domain/entities/admin/GraphQLData/GeneralSettings.php 1 location

@@ 13-41 (lines=29) @@
10
 * @author  Manzoor Wani
11
 * @since   $VID:$
12
 */
13
class GeneralSettings extends GraphQLData
14
{
15
16
    /**
17
     * @param array $where_params
18
     * @return array|null
19
     * @since $VID:$
20
     */
21
    public function getData(array $where_params = [])
22
    {
23
        $field_key = 'generalSettings';
24
        $query = <<<QUERY
25
        query GET_GENERAL_SETTINGS {
26
            {$field_key} {
27
                dateFormat
28
                timeFormat
29
                timezone
30
                __typename
31
            }
32
        }
33
QUERY;
34
        $this->setParams([
35
            'operation_name' => 'GET_GENERAL_SETTINGS',
36
            'query'          => $query,
37
        ]);
38
39
        return $this->getQueryResponse($field_key, $where_params);
40
    }
41
}
42