Completed
Branch EDTR/master (f9130a)
by
unknown
46:59 queued 38:09
created

TicketsConnectionOrderbyInput   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
dl 32
loc 32
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 6 6 1
A getFields() 13 13 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\services\graphql\inputs;
4
5
use EventEspresso\core\services\graphql\fields\GraphQLFieldInterface;
6
use EventEspresso\core\services\graphql\inputs\InputBase;
7
use EventEspresso\core\services\graphql\fields\GraphQLField;
8
use EventEspresso\core\services\graphql\fields\GraphQLInputField;
9
use EventEspresso\core\services\graphql\fields\GraphQLOutputField;
10
11
/**
12
 * Class TicketsConnectionOrderbyInput
13
 * Description
14
 *
15
 * @package EventEspresso\core\domain\services\graphql\inputs
16
 * @author  Manzoor Wani
17
 * @since   $VID:$
18
 */
19 View Code Duplication
class TicketsConnectionOrderbyInput extends InputBase
20
{
21
22
    /**
23
     * TicketsConnectionOrderbyInput constructor.
24
     */
25
    public function __construct()
26
    {
27
        $this->setName('TicketsConnectionOrderbyInput');
28
        $this->setDescription(esc_html__('Options for ordering the connection', 'event_espresso'));
29
        parent::__construct();
30
    }
31
32
33
    /**
34
     * @return GraphQLFieldInterface[]
35
     * @since $VID:$
36
     */
37
    protected function getFields()
38
    {
39
        return [
40
            new GraphQLField(
41
                'field',
42
                ['non_null' => 'TicketsConnectionOrderbyEnum']
43
            ),
44
            new GraphQLField(
45
                'order',
46
                'OrderEnum'
47
            ),
48
        ];
49
    }
50
}
51