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

DatetimesConnectionOrderbyEnum   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 6 6 1
A getValues() 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\enums;
4
5
use EventEspresso\core\services\graphql\enums\EnumBase;
6
7
/**
8
 * Class DatetimesConnectionOrderbyEnum
9
 * Description
10
 *
11
 * @package EventEspresso\core\domain\services\graphql\enums
12
 * @author  Manzoor Wani
13
 * @since   $VID:$
14
 */
15 View Code Duplication
class DatetimesConnectionOrderbyEnum extends EnumBase
16
{
17
18
    /**
19
     * DatetimesConnectionOrderbyEnum constructor.
20
     */
21
    public function __construct()
22
    {
23
        $this->setName('DatetimesConnectionOrderbyEnum');
24
        $this->setDescription(esc_html__('Field to order the connection by', 'event_espresso'));
25
        parent::__construct();
26
    }
27
28
29
    /**
30
     * @return array
31
     * @since $VID:$
32
     */
33
    protected function getValues()
34
    {
35
        return [
36
            'NAME'     => [
37
                'value'       => 'DTT_name',
38
                'description' => esc_html__('Order by name', 'event_espresso'),
39
            ],
40
            'START_DATE'     => [
41
                'value'       => 'DTT_EVT_start',
42
                'description' => esc_html__('Order by start date', 'event_espresso'),
43
            ],
44
        ];
45
    }
46
}
47