1 | <?php |
||
12 | class Control extends TableColumn |
||
13 | { |
||
14 | /** |
||
15 | * @var string |
||
16 | */ |
||
17 | protected $view = 'column.control'; |
||
18 | |||
19 | /** |
||
20 | * @var string |
||
21 | */ |
||
22 | protected $width = '90px'; |
||
23 | |||
24 | /** |
||
25 | * @var Collection |
||
26 | */ |
||
27 | protected $buttons; |
||
28 | |||
29 | /** |
||
30 | * @var bool |
||
31 | */ |
||
32 | protected $editable = true; |
||
33 | |||
34 | /** |
||
35 | * @var bool |
||
36 | */ |
||
37 | protected $deletable = true; |
||
38 | |||
39 | /** |
||
40 | * @var bool |
||
41 | */ |
||
42 | protected $destroyable = true; |
||
43 | |||
44 | /** |
||
45 | * @var bool |
||
46 | */ |
||
47 | protected $restorable = true; |
||
48 | |||
49 | /** |
||
50 | * Control constructor. |
||
51 | * |
||
52 | * @param string|null $label |
||
53 | */ |
||
54 | public function __construct($label = null) |
||
62 | |||
63 | public function initialize() |
||
111 | |||
112 | /** |
||
113 | * @param ControlButtonInterface $button |
||
114 | * |
||
115 | * @return $this |
||
116 | */ |
||
117 | public function addButton(ControlButtonInterface $button) |
||
123 | |||
124 | /** |
||
125 | * @param ControlButtonInterface $button |
||
126 | * |
||
127 | * @return $this |
||
128 | */ |
||
129 | public function addButtons(array $buttons) |
||
139 | |||
140 | /** |
||
141 | * @param bool $editable |
||
142 | * @return $this |
||
143 | */ |
||
144 | public function setEditable($editable) |
||
150 | |||
151 | /** |
||
152 | * @param bool $deletable |
||
153 | * @return $this |
||
154 | */ |
||
155 | public function setDeletable($deletable) |
||
161 | |||
162 | /** |
||
163 | * @param bool $destroyable |
||
164 | * @return $this |
||
165 | */ |
||
166 | public function setDestroyable($destroyable) |
||
172 | |||
173 | /** |
||
174 | * @param bool $restorable |
||
175 | * @return $this |
||
176 | */ |
||
177 | public function setRestorable($restorable) |
||
183 | |||
184 | /** |
||
185 | * Check if instance supports soft-deletes and trashed. |
||
186 | * |
||
187 | * @return bool |
||
188 | */ |
||
189 | protected function isTrashed() |
||
197 | |||
198 | /** |
||
199 | * Check if instance editable. |
||
200 | * |
||
201 | * @return bool |
||
202 | */ |
||
203 | protected function isEditable() |
||
214 | |||
215 | /** |
||
216 | * Check if instance is deletable. |
||
217 | * |
||
218 | * @return bool |
||
219 | */ |
||
220 | protected function isDeletable() |
||
231 | |||
232 | /** |
||
233 | * Check if instance is force deletable. |
||
234 | * |
||
235 | * @return bool |
||
236 | */ |
||
237 | protected function isDestroyable() |
||
248 | |||
249 | /** |
||
250 | * Check if instance is restorable. |
||
251 | * |
||
252 | * @return bool |
||
253 | */ |
||
254 | protected function isRestorable() |
||
265 | |||
266 | /** |
||
267 | * @param Model $model |
||
268 | * |
||
269 | * @return $this |
||
270 | */ |
||
271 | public function setModel(Model $model) |
||
277 | |||
278 | /** |
||
279 | * @return array |
||
280 | */ |
||
281 | public function toArray() |
||
296 | } |
||
297 |
This check looks at variables that are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
An additional type check may prevent trouble.