Completed
Branch EDTR/master (5c103b)
by
unknown
10:13 queued 38s
created

GeneralSettings   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 29
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 29
loc 29
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getData() 20 20 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
3
namespace EventEspresso\core\domain\entities\admin\GraphQLData;
4
5
/**
6
 * Class GeneralSettings
7
 * Description
8
 *
9
 * @package EventEspresso\core\domain\entities\admin\GraphQLData
10
 * @author  Manzoor Wani
11
 * @since   $VID:$
12
 */
13 View Code Duplication
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