Completed
Branch EDTR/master (dbc914)
by
unknown
09:15 queued 40s
created

RegistrationStatusEnum   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 45
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 45
loc 45
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() 26 26 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 EEM_Registration;
6
use EventEspresso\core\services\graphql\enums\EnumBase;
7
8
/**
9
 * Class RegistrationStatusEnum
10
 * Description
11
 *
12
 * @package EventEspresso\core\domain\services\graphql\enums
13
 * @author  Manzoor Wani
14
 * @since   $VID:$
15
 */
16 View Code Duplication
class RegistrationStatusEnum extends EnumBase
17
{
18
19
    /**
20
     * RegistrationStatusEnum constructor.
21
     */
22
    public function __construct()
23
    {
24
        $this->setName($this->namespace . 'RegistrationStatusEnum');
25
        $this->setDescription(esc_html__('Registration status', 'event_espresso'));
26
        parent::__construct();
27
    }
28
29
30
    /**
31
     * @return array
32
     * @since $VID:$
33
     */
34
    protected function getValues()
35
    {
36
        return [
37
            'APPROVED'        => [
38
                'value' => EEM_Registration::status_id_approved,
39
            ],
40
            'CANCELLED'       => [
41
                'value' => EEM_Registration::status_id_cancelled,
42
            ],
43
            'DECLINED'        => [
44
                'value' => EEM_Registration::status_id_declined,
45
            ],
46
            'INCOMPLETE'      => [
47
                'value' => EEM_Registration::status_id_incomplete,
48
            ],
49
            'PENDING_PAYMENT' => [
50
                'value' => EEM_Registration::status_id_pending_payment,
51
            ],
52
            'UNAPPROVED'      => [
53
                'value' => EEM_Registration::status_id_not_approved,
54
            ],
55
            'WAIT_LIST'       => [
56
                'value' => EEM_Registration::status_id_wait_list,
57
            ],
58
        ];
59
    }
60
}
61