Completed
Push — master ( bd4cbc...df0c76 )
by Arnaud
9s
created

ActionCreateEvent   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 63
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 1
dl 63
loc 63
ccs 14
cts 14
cp 1
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 6 6 1
A getActionConfiguration() 4 4 1
A getActionName() 4 4 1
A getAdmin() 4 4 1
A setActionConfiguration() 4 4 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 LAG\AdminBundle\Action\Event;
4
5
use LAG\AdminBundle\Admin\AdminInterface;
6
use Symfony\Component\EventDispatcher\Event;
7
8 View Code Duplication
class ActionCreateEvent extends Event
9
{
10
    /**
11
     * @var array
12
     */
13
    protected $actionConfiguration;
14
15
    /**
16
     * @var string
17
     */
18
    protected $actionName;
19
20
    /**
21
     * @var AdminInterface
22
     */
23
    protected $admin;
24
25
    /**
26
     * ActionCreateEvent constructor.
27
     *
28
     * @param string $actionName
29
     * @param array $actionConfiguration
30
     * @param AdminInterface $admin
31
     */
32 3
    public function __construct($actionName, array $actionConfiguration, AdminInterface $admin)
33
    {
34 3
        $this->actionConfiguration = $actionConfiguration;
35 3
        $this->actionName = $actionName;
36 3
        $this->admin = $admin;
37 3
    }
38
39
    /**
40
     * @return array
41
     */
42 1
    public function getActionConfiguration()
43
    {
44 1
        return $this->actionConfiguration;
45
    }
46
47
    /**
48
     * @return string
49
     */
50 1
    public function getActionName()
51
    {
52 1
        return $this->actionName;
53
    }
54
55
    /**
56
     * @return AdminInterface
57
     */
58 1
    public function getAdmin()
59
    {
60 1
        return $this->admin;
61
    }
62
63
    /**
64
     * @param array $actionConfiguration
65
     */
66 1
    public function setActionConfiguration($actionConfiguration)
67
    {
68 1
        $this->actionConfiguration = $actionConfiguration;
69 1
    }
70
}
71