1 | <?php |
||
23 | class Widget implements WidgetInterface |
||
24 | { |
||
25 | const TYPE_HTML = 1; |
||
26 | |||
27 | protected $types = [ |
||
28 | self::TYPE_HTML => "\\SWP\\TemplatesSystem\\Gimme\\Widget\\HtmlWidget" |
||
29 | ]; |
||
30 | |||
31 | /** |
||
32 | * @var int |
||
33 | */ |
||
34 | protected $id; |
||
35 | |||
36 | /** |
||
37 | * @var string |
||
38 | */ |
||
39 | protected $type; |
||
40 | |||
41 | /** |
||
42 | * @var string |
||
43 | */ |
||
44 | protected $name; |
||
45 | |||
46 | /** |
||
47 | * @var boolean |
||
48 | */ |
||
49 | protected $visible; |
||
50 | |||
51 | /** |
||
52 | * @var [] |
||
53 | */ |
||
54 | protected $parameters; |
||
55 | |||
56 | public function __construct() |
||
61 | |||
62 | /** |
||
63 | * Get id. |
||
64 | * |
||
65 | * @return int |
||
66 | */ |
||
67 | public function getId() |
||
71 | |||
72 | /** |
||
73 | * Set id. |
||
74 | * |
||
75 | * @param string $id |
||
76 | * |
||
77 | * @return self |
||
78 | */ |
||
79 | public function setId($id) |
||
85 | |||
86 | /** |
||
87 | * Set name. |
||
88 | * |
||
89 | * @param string $name |
||
90 | * |
||
91 | * @return self |
||
92 | */ |
||
93 | public function setName($name) |
||
99 | |||
100 | /** |
||
101 | * Get name. |
||
102 | * |
||
103 | * @return string |
||
104 | */ |
||
105 | public function getName() |
||
109 | |||
110 | /** |
||
111 | * Gets the value of visible. |
||
112 | * |
||
113 | * @return boolean |
||
114 | */ |
||
115 | public function getVisible() |
||
119 | |||
120 | /** |
||
121 | * Sets the value of visible. |
||
122 | * |
||
123 | * @param boolean $visible the visible |
||
124 | * |
||
125 | * @return self |
||
126 | */ |
||
127 | public function setVisible($visible) |
||
133 | |||
134 | /** |
||
135 | * Gets the value of type. |
||
136 | * |
||
137 | * @return integer |
||
138 | */ |
||
139 | public function getType() |
||
143 | |||
144 | /** |
||
145 | * Sets the value of type. |
||
146 | * |
||
147 | * @param integer $type the type |
||
148 | * |
||
149 | * @return self |
||
150 | */ |
||
151 | public function setType($type = self::TYPE_HTML) |
||
161 | |||
162 | /** |
||
163 | * Gets the value of parameters. |
||
164 | * |
||
165 | * @return [] |
||
166 | */ |
||
167 | public function getParameters() |
||
171 | |||
172 | /** |
||
173 | * Sets the value of parameters. |
||
174 | * |
||
175 | * @param [] $parameters the parameters |
||
176 | * |
||
177 | * @return self |
||
178 | */ |
||
179 | public function setParameters($parameters) |
||
185 | } |
||
186 |
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.