Completed
Push — master ( 06c1ce...67d37c )
by Jeroen
06:20
created

AdaptSimpleFormEvent   A

Complexity

Total Complexity 11

Size/Duplication

Total Lines 120
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 11
lcom 0
cbo 1
dl 0
loc 120
ccs 31
cts 31
cp 1
rs 10
c 0
b 0
f 0

11 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A getTabPane() 0 4 1
A setTabPane() 0 4 1
A getRequest() 0 4 1
A setRequest() 0 4 1
A getFormType() 0 4 1
A setFormType() 0 4 1
A getData() 0 4 1
A setData() 0 4 1
A getOptions() 0 4 1
A setOptions() 0 4 1
1
<?php
2
3
namespace Kunstmaan\AdminBundle\Event;
4
5
use Kunstmaan\AdminBundle\Helper\FormWidgets\Tabs\TabPane;
6
use Symfony\Component\EventDispatcher\Event;
7
use Symfony\Component\HttpFoundation\Request;
8
9
/**
10
 * Class AdaptSimpleFormEvent
11
 */
12
class AdaptSimpleFormEvent extends Event
0 ignored issues
show
Deprecated Code introduced by
The class Symfony\Component\EventDispatcher\Event has been deprecated with message: since Symfony 4.3, use "Symfony\Contracts\EventDispatcher\Event" instead

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
13
{
14
    /**
15
     * @var Request
16
     */
17
    protected $request;
18
19
    /**
20
     * @var string
21
     */
22
    protected $formType;
23
24
    /**
25
     * @var TabPane
26
     */
27
    protected $tabPane;
28
29
    /**
30
     * @var
31
     */
32
    protected $data;
33
34
    /**
35
     * @var array
36
     */
37
    protected $options = array();
38
39
    /**
40
     * @param Request $request
41
     * @param string  $formType
42
     * @param $data
43
     */
44 1
    public function __construct(Request $request, $formType, $data, $options = array())
0 ignored issues
show
Bug introduced by
You have injected the Request via parameter $request. This is generally not recommended as there might be multiple instances during a request cycle (f.e. when using sub-requests). Instead, it is recommended to inject the RequestStack and retrieve the current request each time you need it via getCurrentRequest().
Loading history...
45
    {
46 1
        $this->request = $request;
47 1
        $this->formType = $formType;
48 1
        $this->data = $data;
49 1
        $this->options = $options;
50 1
    }
51
52
    /**
53
     * @return TabPane
54
     */
55 1
    public function getTabPane()
56
    {
57 1
        return $this->tabPane;
58
    }
59
60
    /**
61
     * @param TabPane $tabPane
62
     */
63 1
    public function setTabPane(TabPane $tabPane)
64
    {
65 1
        $this->tabPane = $tabPane;
66 1
    }
67
68
    /**
69
     * @return Request
70
     */
71 1
    public function getRequest()
72
    {
73 1
        return $this->request;
74
    }
75
76
    /**
77
     * @param Request $request
78
     */
79 1
    public function setRequest(Request $request)
0 ignored issues
show
Bug introduced by
You have injected the Request via parameter $request. This is generally not recommended as there might be multiple instances during a request cycle (f.e. when using sub-requests). Instead, it is recommended to inject the RequestStack and retrieve the current request each time you need it via getCurrentRequest().
Loading history...
80
    {
81 1
        $this->request = $request;
82 1
    }
83
84
    /**
85
     * @return string
86
     */
87 1
    public function getFormType()
88
    {
89 1
        return $this->formType;
90
    }
91
92
    /**
93
     * @param string $type
94
     */
95 1
    public function setFormType($type)
96
    {
97 1
        $this->formType = $type;
98 1
    }
99
100
    /**
101
     * @return mixed
102
     */
103 1
    public function getData()
104
    {
105 1
        return $this->data;
106
    }
107
108
    /**
109
     * @param $data
110
     */
111 1
    public function setData($data)
112
    {
113 1
        $this->data = $data;
114 1
    }
115
116
    /**
117
     * @return array
118
     */
119 1
    public function getOptions()
120
    {
121 1
        return $this->options;
122
    }
123
124
    /**
125
     * @param $options
126
     */
127 1
    public function setOptions($options)
128
    {
129 1
        $this->options = $options;
130 1
    }
131
}
132