Code Duplication    Length = 61-69 lines in 2 locations

src/Event/Events/AdminEvent.php 1 location

@@ 10-78 (lines=69) @@
7
use Symfony\Component\EventDispatcher\Event;
8
use Symfony\Component\HttpFoundation\Request;
9
10
class AdminEvent extends Event
11
{
12
    /**
13
     * @var AdminInterface
14
     */
15
    private $admin;
16
17
    /**
18
     * @var ActionInterface
19
     */
20
    private $action;
21
22
    /**
23
     * @var Request
24
     */
25
    private $request;
26
27
    /**
28
     * AdminEvent constructor.
29
     *
30
     * @param AdminInterface   $admin
31
     * @param Request $request
32
     */
33
    public function __construct(AdminInterface $admin, Request $request)
34
    {
35
        $this->admin = $admin;
36
        $this->request = $request;
37
    }
38
39
    /**
40
     * @return AdminInterface
41
     */
42
    public function getAdmin(): AdminInterface
43
    {
44
        return $this->admin;
45
    }
46
47
    /**
48
     * @return ActionInterface
49
     */
50
    public function getAction(): ActionInterface
51
    {
52
        return $this->action;
53
    }
54
55
    /**
56
     * @return bool
57
     */
58
    public function hasAction(): bool
59
    {
60
        return null !== $this->action;
61
    }
62
63
    /**
64
     * @param ActionInterface $action
65
     */
66
    public function setAction(ActionInterface $action)
67
    {
68
        $this->action = $action;
69
    }
70
71
    /**
72
     * @return Request
73
     */
74
    public function getRequest(): Request
75
    {
76
        return $this->request;
77
    }
78
}
79

src/Event/Events/ViewEvent.php 1 location

@@ 10-70 (lines=61) @@
7
use Symfony\Component\EventDispatcher\Event;
8
use Symfony\Component\HttpFoundation\Request;
9
10
class ViewEvent extends Event
11
{
12
    /**
13
     * @var ViewInterface
14
     */
15
    private $view;
16
17
    /**
18
     * @var AdminInterface
19
     */
20
    private $admin;
21
22
    /**
23
     * @var Request
24
     */
25
    private $request;
26
27
    /**
28
     * ViewEvent constructor.
29
     *
30
     * @param AdminInterface $admin
31
     * @param Request        $request
32
     */
33
    public function __construct(AdminInterface $admin, Request $request)
34
    {
35
        $this->admin = $admin;
36
        $this->request = $request;
37
    }
38
39
    /**
40
     * @return ViewInterface
41
     */
42
    public function getView(): ViewInterface
43
    {
44
        return $this->view;
45
    }
46
47
    /**
48
     * @param ViewInterface $view
49
     */
50
    public function setView(ViewInterface $view)
51
    {
52
        $this->view = $view;
53
    }
54
55
    /**
56
     * @return AdminInterface
57
     */
58
    public function getAdmin(): AdminInterface
59
    {
60
        return $this->admin;
61
    }
62
63
    /**
64
     * @return Request
65
     */
66
    public function getRequest(): Request
67
    {
68
        return $this->request;
69
    }
70
}
71