1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Fi\CoreBundle\Controller; |
4
|
|
|
|
5
|
|
|
use Symfony\Bundle\FrameworkBundle\Controller\Controller; |
6
|
|
|
use Symfony\Component\HttpFoundation\Request; |
7
|
|
|
use Symfony\Component\HttpFoundation\Response; |
8
|
|
|
use Symfony\Component\Security\Core\Exception\AccessDeniedException; |
9
|
|
|
|
10
|
|
|
class FiCrudController extends Controller |
11
|
|
|
{ |
12
|
|
|
|
13
|
|
|
public static $namespace; |
14
|
|
|
public static $bundle; |
15
|
|
|
public static $controller; |
16
|
|
|
public static $action; |
17
|
|
|
public static $parametrigriglia; |
18
|
|
|
public static $canRead; |
19
|
|
|
public static $canDelete; |
20
|
|
|
public static $canCreate; |
21
|
|
|
public static $canUpdate; |
22
|
|
|
|
23
|
30 |
|
protected function setup(Request $request) |
24
|
|
|
{ |
25
|
30 |
|
$matches = array(); |
|
|
|
|
26
|
30 |
|
$controllo = new \ReflectionClass(get_class($this)); |
27
|
|
|
|
28
|
30 |
|
preg_match('/(.*)\\\(.*)Bundle\\\Controller\\\(.*)Controller/', $controllo->name, $matches); |
29
|
30 |
|
if (count($matches) == 0) { |
30
|
|
|
preg_match('/(.*)(.*)\\\Controller\\\(.*)Controller/', $controllo->name, $matches); |
31
|
|
|
} |
32
|
30 |
|
self::$namespace = $matches[1]; |
|
|
|
|
33
|
30 |
|
self::$bundle = $matches[2]; |
|
|
|
|
34
|
30 |
|
self::$controller = $matches[3]; |
35
|
30 |
|
self::$action = substr($request->attributes->get('_controller'), strrpos($request->attributes->get('_controller'), ':') + 1); |
|
|
|
|
36
|
|
|
|
37
|
30 |
|
$gestionepermessi = $this->get('ficorebundle.gestionepermessi'); |
38
|
30 |
|
self::$canRead = ($gestionepermessi->leggere(array('modulo' => self::$controller)) ? 1 : 0); |
|
|
|
|
39
|
30 |
|
self::$canDelete = ($gestionepermessi->cancellare(array('modulo' => self::$controller)) ? 1 : 0); |
|
|
|
|
40
|
30 |
|
self::$canCreate = ($gestionepermessi->creare(array('modulo' => self::$controller)) ? 1 : 0); |
|
|
|
|
41
|
30 |
|
self::$canUpdate = ($gestionepermessi->aggiornare(array('modulo' => self::$controller)) ? 1 : 0); |
|
|
|
|
42
|
30 |
|
} |
43
|
|
|
|
44
|
|
|
/** |
45
|
|
|
* Lists all tables entities. |
46
|
|
|
*/ |
47
|
21 |
|
public function indexAction(Request $request) |
48
|
|
|
{ |
49
|
|
|
/* @var $em \Doctrine\ORM\EntityManager */ |
50
|
21 |
|
$this->setup($request); |
51
|
21 |
|
$namespace = $this->getNamespace(); |
|
|
|
|
52
|
21 |
|
$bundle = $this->getBundle(); |
|
|
|
|
53
|
21 |
|
$controller = $this->getController(); |
54
|
|
|
|
55
|
21 |
|
if (!self::$canRead) { |
56
|
15 |
|
throw new AccessDeniedException("Non si hanno i permessi per visualizzare questo contenuto"); |
|
|
|
|
57
|
|
|
} |
58
|
|
|
|
59
|
8 |
|
$container = $this->container; |
60
|
|
|
|
61
|
8 |
|
$idpassato = $request->get('id'); |
62
|
|
|
|
63
|
8 |
|
$nomebundle = $namespace . $bundle . 'Bundle'; |
64
|
|
|
|
65
|
8 |
|
$repotabelle = $this->get('OpzioniTabella_repository'); |
66
|
|
|
|
67
|
8 |
|
$paricevuti = array('nomebundle' => $nomebundle, 'nometabella' => $controller, 'container' => $container); |
68
|
|
|
|
69
|
8 |
|
$griglia = $this->get("ficorebundle.griglia"); |
|
|
|
|
70
|
8 |
|
$testatagriglia = $griglia->testataPerGriglia($paricevuti); |
71
|
|
|
|
72
|
8 |
|
$testatagriglia['multisearch'] = 1; |
|
|
|
|
73
|
8 |
|
$testatagriglia['showconfig'] = 1; |
|
|
|
|
74
|
8 |
|
$testatagriglia['overlayopen'] = 1; |
|
|
|
|
75
|
8 |
|
$testatagriglia['showadd'] = self::$canCreate; |
|
|
|
|
76
|
8 |
|
$testatagriglia['showedit'] = self::$canUpdate; |
|
|
|
|
77
|
8 |
|
$testatagriglia['showdel'] = self::$canDelete; |
|
|
|
|
78
|
8 |
|
$testatagriglia["filterToolbar_searchOnEnter"] = true; |
|
|
|
|
79
|
8 |
|
$testatagriglia["filterToolbar_searchOperators"] = true; |
|
|
|
|
80
|
|
|
|
81
|
8 |
|
$testatagriglia['parametritesta'] = json_encode($paricevuti); |
82
|
|
|
|
83
|
8 |
|
$this->setParametriGriglia(array('request' => $request)); |
|
|
|
|
84
|
8 |
|
$testatagriglia['parametrigriglia'] = json_encode(self::$parametrigriglia); |
85
|
|
|
|
86
|
8 |
|
$template = $nomebundle . ':' . $controller . ':index.html.twig'; |
87
|
8 |
|
if (!$this->get('templating')->exists($template)) { |
88
|
|
|
$template = $controller . '/index.html.twig'; |
89
|
|
|
} |
90
|
|
|
|
91
|
8 |
|
$testata = $repotabelle->editTestataFormTabelle($testatagriglia, $controller, $container); |
92
|
8 |
|
return $this->render( |
93
|
8 |
|
$template, |
94
|
|
|
array( |
95
|
8 |
|
'nomecontroller' => $controller, |
96
|
8 |
|
'testata' => $testata, |
97
|
8 |
|
'canread' => self::$canRead, |
98
|
8 |
|
'idpassato' => $idpassato, |
99
|
|
|
) |
100
|
|
|
); |
101
|
|
|
} |
102
|
|
|
|
103
|
|
|
/** |
104
|
|
|
* Creates a new table entity. |
105
|
|
|
*/ |
106
|
17 |
|
public function createAction(Request $request) |
107
|
|
|
{ |
108
|
17 |
|
$this->setup($request); |
109
|
17 |
|
$namespace = $this->getNamespace(); |
|
|
|
|
110
|
17 |
|
$bundle = $this->getBundle(); |
|
|
|
|
111
|
17 |
|
$controller = $this->getController(); |
112
|
|
|
|
113
|
17 |
|
if (!self::$canCreate) { |
114
|
15 |
|
throw new AccessDeniedException("Non si hanno i permessi per creare questo contenuto"); |
|
|
|
|
115
|
|
|
} |
116
|
|
|
|
117
|
6 |
|
$nomebundle = $namespace . $bundle . 'Bundle'; |
|
|
|
|
118
|
6 |
|
$classbundle = $namespace . '\\' . $bundle . 'Bundle' . '\\Entity\\' . $controller; |
119
|
6 |
|
$formbundle = $namespace . '\\' . $bundle . 'Bundle' . '\\Form\\' . $controller; |
|
|
|
|
120
|
|
|
|
121
|
6 |
|
if (!class_exists($classbundle)) { |
122
|
|
|
$nomebundle = $namespace . $bundle . 'Bundle'; |
|
|
|
|
123
|
|
|
$classbundle = $namespace . '\\Entity\\' . $controller; |
124
|
|
|
$formbundle = $namespace . '\\Form\\' . $controller; |
|
|
|
|
125
|
|
|
$template = $controller . '/new.html.twig'; |
|
|
|
|
126
|
|
|
} else { |
127
|
6 |
|
$template = $nomebundle . ':' . $controller . ':new.html.twig'; |
128
|
|
|
} |
129
|
|
|
|
130
|
6 |
|
$entity = new $classbundle(); |
|
|
|
|
131
|
6 |
|
$formType = $formbundle . 'Type'; |
132
|
|
|
|
133
|
6 |
|
$form = $this->createForm( |
134
|
6 |
|
$formType, |
135
|
6 |
|
$entity, |
136
|
|
|
array('attr' => array( |
137
|
6 |
|
'id' => 'formdati' . $controller, |
138
|
|
|
), |
139
|
6 |
|
'action' => $this->generateUrl($controller . '_create'), |
140
|
|
|
) |
141
|
|
|
); |
142
|
|
|
|
143
|
6 |
|
$form->submit($request->request->get($form->getName())); |
144
|
|
|
|
145
|
6 |
|
if ($form->isValid()) { |
146
|
2 |
|
$em = $this->getDoctrine()->getManager(); |
147
|
2 |
|
$em->persist($entity); |
148
|
2 |
|
$em->flush(); |
149
|
|
|
|
150
|
2 |
|
$continua = (int) $request->get('continua'); |
151
|
2 |
|
if ($continua === 0) { |
152
|
2 |
|
return new Response('OK'); |
153
|
|
|
} else { |
154
|
|
|
return $this->redirect($this->generateUrl($controller . '_edit', array('id' => $entity->getId()))); |
155
|
|
|
} |
156
|
|
|
} |
157
|
|
|
|
158
|
4 |
|
return $this->render( |
159
|
4 |
|
$template, |
160
|
|
|
array( |
161
|
4 |
|
'nomecontroller' => $controller, |
162
|
4 |
|
'entity' => $entity, |
163
|
4 |
|
'form' => $form->createView(), |
164
|
|
|
) |
165
|
|
|
); |
166
|
|
|
} |
167
|
|
|
|
168
|
|
|
/** |
169
|
|
|
* Displays a form to create a new table entity. |
170
|
|
|
*/ |
171
|
3 |
|
public function newAction(Request $request) |
172
|
|
|
{ |
173
|
3 |
|
$this->setup($request); |
174
|
3 |
|
$namespace = $this->getNamespace(); |
|
|
|
|
175
|
3 |
|
$bundle = $this->getBundle(); |
|
|
|
|
176
|
3 |
|
$controller = $this->getController(); |
177
|
|
|
|
178
|
3 |
|
if (!self::$canCreate) { |
179
|
|
|
throw new AccessDeniedException("Non si hanno i permessi per creare questo contenuto"); |
|
|
|
|
180
|
|
|
} |
181
|
|
|
|
182
|
3 |
|
$nomebundle = $namespace . $bundle . 'Bundle'; |
|
|
|
|
183
|
3 |
|
$classbundle = $namespace . '\\' . $bundle . 'Bundle' . '\\Entity\\' . $controller; |
184
|
3 |
|
$formbundle = $namespace . '\\' . $bundle . 'Bundle' . '\\Form\\' . $controller; |
|
|
|
|
185
|
3 |
|
$formType = $formbundle . 'Type'; |
|
|
|
|
186
|
3 |
|
if (!class_exists($classbundle)) { |
187
|
|
|
$nomebundle = $namespace . $bundle . 'Bundle'; |
|
|
|
|
188
|
|
|
$classbundle = $namespace . '\\Entity\\' . $controller; |
189
|
|
|
$formbundle = $namespace . '\\Form\\' . $controller; |
|
|
|
|
190
|
|
|
$formType = $formbundle . 'Type'; |
|
|
|
|
191
|
|
|
$template = $controller . '/new.html.twig'; |
|
|
|
|
192
|
|
|
} else { |
193
|
3 |
|
$template = $nomebundle . ':' . $controller . ':new.html.twig'; |
194
|
|
|
} |
195
|
3 |
|
$entity = new $classbundle(); |
196
|
|
|
|
197
|
3 |
|
$form = $this->createForm( |
198
|
3 |
|
$formType, |
199
|
3 |
|
$entity, |
200
|
|
|
array('attr' => array( |
201
|
3 |
|
'id' => 'formdati' . $controller, |
202
|
|
|
), |
203
|
3 |
|
'action' => $this->generateUrl($controller . '_create'), |
204
|
|
|
) |
205
|
|
|
); |
206
|
|
|
|
207
|
3 |
|
return $this->render( |
208
|
3 |
|
$template, |
209
|
|
|
array( |
210
|
3 |
|
'nomecontroller' => $controller, |
211
|
3 |
|
'entity' => $entity, |
212
|
3 |
|
'form' => $form->createView(), |
213
|
|
|
) |
214
|
|
|
); |
215
|
|
|
} |
216
|
|
|
|
217
|
|
|
/** |
218
|
|
|
* Displays a form to edit an existing table entity. |
219
|
|
|
*/ |
220
|
18 |
|
public function editAction(Request $request, $id) |
221
|
|
|
{ |
222
|
|
|
/* @var $em \Doctrine\ORM\EntityManager */ |
223
|
18 |
|
$this->setup($request); |
224
|
18 |
|
$namespace = $this->getNamespace(); |
|
|
|
|
225
|
18 |
|
$bundle = $this->getBundle(); |
|
|
|
|
226
|
18 |
|
$controller = $this->getController(); |
227
|
|
|
|
228
|
18 |
|
if (!self::$canUpdate) { |
229
|
15 |
|
throw new AccessDeniedException("Non si hanno i permessi per modificare questo contenuto"); |
|
|
|
|
230
|
|
|
} |
231
|
|
|
|
232
|
7 |
|
$nomebundle = $namespace . $bundle . 'Bundle'; |
233
|
7 |
|
$formbundle = $namespace . '\\' . $bundle . 'Bundle' . '\\Form\\' . $controller; |
234
|
7 |
|
$formType = $formbundle . 'Type'; |
|
|
|
|
235
|
7 |
|
if (!class_exists($formType)) { |
236
|
|
|
$nomebundle = $namespace . $bundle . 'Bundle'; |
237
|
|
|
$formbundle = $namespace . '\\Form\\' . $controller; |
238
|
|
|
$formType = $formbundle . 'Type'; |
|
|
|
|
239
|
|
|
$template = $controller . '/edit.html.twig'; |
|
|
|
|
240
|
|
|
} else { |
241
|
7 |
|
$template = $nomebundle . ':' . $controller . ':edit.html.twig'; |
242
|
|
|
} |
243
|
|
|
|
244
|
7 |
|
$elencomodifiche = $this->elencoModifiche($controller, $id); |
|
|
|
|
245
|
|
|
|
246
|
7 |
|
$em = $this->getDoctrine()->getManager(); |
247
|
|
|
|
248
|
7 |
|
$entity = $em->getRepository($nomebundle . ':' . $controller)->find($id); |
249
|
|
|
|
250
|
7 |
|
if (!$entity) { |
251
|
|
|
throw $this->createNotFoundException('Unable to find ' . $controller . ' entity.'); |
252
|
|
|
} |
253
|
|
|
|
254
|
7 |
|
$editForm = $this->createForm( |
255
|
7 |
|
$formType, |
256
|
7 |
|
$entity, |
257
|
|
|
array('attr' => array( |
258
|
7 |
|
'id' => 'formdati' . $controller, |
259
|
|
|
), |
260
|
7 |
|
'action' => $this->generateUrl($controller . '_update', array('id' => $entity->getId())), |
261
|
|
|
) |
262
|
|
|
); |
263
|
|
|
|
264
|
7 |
|
$deleteForm = $this->createDeleteForm($id); |
265
|
|
|
|
266
|
7 |
|
return $this->render( |
267
|
7 |
|
$template, |
268
|
|
|
array( |
269
|
7 |
|
'entity' => $entity, |
270
|
7 |
|
'nomecontroller' => $controller, |
271
|
7 |
|
'edit_form' => $editForm->createView(), |
272
|
7 |
|
'delete_form' => $deleteForm->createView(), |
273
|
7 |
|
'elencomodifiche' => $elencomodifiche, |
274
|
|
|
) |
275
|
|
|
); |
276
|
|
|
} |
277
|
|
|
|
278
|
|
|
/** |
279
|
|
|
* Edits an existing table entity. |
280
|
|
|
*/ |
281
|
17 |
|
public function updateAction(Request $request, $id) |
282
|
|
|
{ |
283
|
|
|
/* @var $em \Doctrine\ORM\EntityManager */ |
284
|
17 |
|
$this->setup($request); |
285
|
17 |
|
$namespace = $this->getNamespace(); |
|
|
|
|
286
|
17 |
|
$bundle = $this->getBundle(); |
|
|
|
|
287
|
17 |
|
$controller = $this->getController(); |
288
|
|
|
|
289
|
17 |
|
if (!self::$canUpdate) { |
290
|
15 |
|
throw new AccessDeniedException("Non si hanno i permessi per aggiornare questo contenuto"); |
|
|
|
|
291
|
|
|
} |
292
|
|
|
|
293
|
6 |
|
$nomebundle = $namespace . $bundle . 'Bundle'; |
294
|
6 |
|
$formbundle = $namespace . '\\' . $bundle . 'Bundle' . '\\Form\\' . $controller; |
295
|
6 |
|
$formType = $formbundle . 'Type'; |
|
|
|
|
296
|
|
|
|
297
|
6 |
|
if (!class_exists($formType)) { |
298
|
|
|
$nomebundle = $namespace . $bundle . 'Bundle'; |
299
|
|
|
$formbundle = $namespace . '\\Form\\' . $controller; |
300
|
|
|
$formType = $formbundle . 'Type'; |
|
|
|
|
301
|
|
|
$template = $controller . '/edit.html.twig'; |
|
|
|
|
302
|
|
|
} else { |
303
|
6 |
|
$template = $nomebundle . ':' . $controller . ':edit.html.twig'; |
304
|
|
|
} |
305
|
|
|
|
306
|
6 |
|
$repoStorico = $this->container->get('Storicomodifiche_repository'); |
307
|
|
|
|
308
|
6 |
|
$em = $this->getDoctrine()->getManager(); |
309
|
|
|
|
310
|
6 |
|
$entity = $em->getRepository($nomebundle . ':' . $controller)->find($id); |
311
|
|
|
|
312
|
6 |
|
if (!$entity) { |
313
|
|
|
throw $this->createNotFoundException('Unable to find ' . $controller . ' entity.'); |
314
|
|
|
} |
315
|
|
|
|
316
|
6 |
|
$deleteForm = $this->createDeleteForm($id); |
317
|
|
|
|
318
|
6 |
|
$editForm = $this->createForm( |
319
|
6 |
|
$formType, |
320
|
6 |
|
$entity, |
321
|
|
|
array('attr' => array( |
322
|
6 |
|
'id' => 'formdati' . $controller, |
323
|
|
|
), |
324
|
6 |
|
'action' => $this->generateUrl($controller . '_update', array('id' => $entity->getId())), |
325
|
|
|
) |
326
|
|
|
); |
327
|
|
|
|
328
|
6 |
|
$editForm->submit($request->request->get($editForm->getName())); |
329
|
|
|
|
330
|
6 |
|
if ($editForm->isValid()) { |
331
|
3 |
|
$originalData = $em->getUnitOfWork()->getOriginalEntityData($entity); |
332
|
|
|
|
333
|
3 |
|
$em->persist($entity); |
334
|
3 |
|
$em->flush(); |
335
|
|
|
|
336
|
3 |
|
$newData = $em->getUnitOfWork()->getOriginalEntityData($entity); |
337
|
3 |
|
$changes = $repoStorico->isRecordChanged($nomebundle, $controller, $originalData, $newData); |
338
|
|
|
|
339
|
3 |
|
if ($changes) { |
340
|
1 |
|
$repoStorico->saveHistory($controller, $changes, $id, $this->getUser()); |
341
|
|
|
} |
342
|
|
|
|
343
|
3 |
|
$continua = (int) $request->get('continua'); |
344
|
3 |
|
if ($continua === 0) { |
345
|
3 |
|
return new Response('OK'); |
346
|
|
|
} else { |
347
|
|
|
return $this->redirect($this->generateUrl($controller . '_edit', array('id' => $id))); |
348
|
|
|
} |
349
|
|
|
} |
350
|
|
|
|
351
|
3 |
|
return $this->render( |
352
|
3 |
|
$template, |
353
|
|
|
array( |
354
|
3 |
|
'entity' => $entity, |
355
|
3 |
|
'edit_form' => $editForm->createView(), |
356
|
3 |
|
'delete_form' => $deleteForm->createView(), |
357
|
3 |
|
'nomecontroller' => $controller, |
358
|
|
|
) |
359
|
|
|
); |
360
|
|
|
} |
361
|
|
|
|
362
|
|
|
/** |
363
|
|
|
* Edits an existing table entity. |
364
|
|
|
*/ |
365
|
|
|
public function aggiornaAction(Request $request) |
366
|
|
|
{ |
367
|
|
|
/* @var $em \Doctrine\ORM\EntityManager */ |
368
|
|
|
$this->setup($request); |
369
|
|
|
$namespace = $this->getNamespace(); |
|
|
|
|
370
|
|
|
$bundle = $this->getBundle(); |
|
|
|
|
371
|
|
|
$controller = $this->getController(); |
372
|
|
|
|
373
|
|
|
if (!self::$canUpdate) { |
374
|
|
|
throw new AccessDeniedException("Non si hanno i permessi per aggiornare questo contenuto"); |
|
|
|
|
375
|
|
|
} |
376
|
|
|
|
377
|
|
|
$nomebundle = $namespace . $bundle . 'Bundle'; |
378
|
|
|
|
379
|
|
|
$id = $this->get('request')->request->get('id'); |
380
|
|
|
|
381
|
|
|
$em = $this->getDoctrine()->getManager(); |
382
|
|
|
|
383
|
|
|
$entity = $em->getRepository($nomebundle . ':' . $controller)->find($id); |
384
|
|
|
|
385
|
|
|
if (!$entity) { |
386
|
|
|
throw $this->createNotFoundException('Unable to find ' . $controller . ' entity.'); |
387
|
|
|
} |
388
|
|
|
|
389
|
|
|
throw $this->createNotFoundException("Implementare a seconda dell'esigenza 'aggiornaAction' del controller " |
390
|
|
|
. $nomebundle |
391
|
|
|
. '/' |
392
|
|
|
. $controller); |
393
|
|
|
} |
394
|
|
|
|
395
|
|
|
/** |
396
|
|
|
* Deletes a table entity. |
397
|
|
|
*/ |
398
|
17 |
|
public function deleteAction(Request $request) |
399
|
|
|
{ |
400
|
|
|
/* @var $em \Doctrine\ORM\EntityManager */ |
401
|
17 |
|
$this->setup($request); |
402
|
17 |
|
if (!self::$canDelete) { |
403
|
15 |
|
throw new AccessDeniedException("Non si hanno i permessi per aggiornare questo contenuto"); |
|
|
|
|
404
|
|
|
} |
405
|
6 |
|
$namespace = $this->getNamespace(); |
|
|
|
|
406
|
6 |
|
$bundle = $this->getBundle(); |
|
|
|
|
407
|
6 |
|
$controller = $this->getController(); |
408
|
|
|
|
409
|
6 |
|
$nomebundle = $namespace . $bundle . 'Bundle'; |
410
|
|
|
|
411
|
|
|
try { |
412
|
6 |
|
$em = $this->getDoctrine()->getManager(); |
|
|
|
|
413
|
6 |
|
$qb = $em->createQueryBuilder(); |
|
|
|
|
414
|
6 |
|
$ids = explode(',', $request->get('id')); |
415
|
6 |
|
$qb->delete($nomebundle . ':' . $controller, 'u') |
416
|
6 |
|
->andWhere('u.id IN (:ids)') |
417
|
6 |
|
->setParameter('ids', $ids); |
418
|
|
|
|
419
|
6 |
|
$query = $qb->getQuery(); |
420
|
6 |
|
$query->execute(); |
421
|
|
|
} catch (\Exception $e) { |
422
|
|
|
$response = new Response(); |
423
|
|
|
$response->setStatusCode('200'); |
424
|
|
|
|
425
|
|
|
return new Response('404'); |
426
|
|
|
} |
427
|
|
|
|
428
|
6 |
|
return new Response('OK'); |
429
|
|
|
} |
430
|
|
|
|
431
|
|
|
/** |
432
|
|
|
* Creates a form to delete a table entity by id. |
433
|
|
|
* |
434
|
|
|
* @param mixed $id The entity id |
435
|
|
|
* |
436
|
|
|
* @return \Symfony\Component\Form\Form The form |
437
|
|
|
*/ |
438
|
6 |
|
protected function createDeleteForm($id) |
439
|
|
|
{ |
440
|
6 |
|
return $this->createFormBuilder(array('id' => $id)) |
441
|
6 |
|
->add('id', get_class(new \Symfony\Component\Form\Extension\Core\Type\HiddenType())) |
442
|
6 |
|
->getForm(); |
443
|
|
|
} |
444
|
|
|
|
445
|
30 |
|
protected function getNamespace() |
446
|
|
|
{ |
447
|
30 |
|
return self::$namespace; |
448
|
|
|
} |
449
|
|
|
|
450
|
30 |
|
protected function getBundle() |
451
|
|
|
{ |
452
|
30 |
|
return self::$bundle; |
453
|
|
|
} |
454
|
|
|
|
455
|
30 |
|
protected function getController() |
456
|
|
|
{ |
457
|
30 |
|
return self::$controller; |
458
|
|
|
} |
459
|
|
|
|
460
|
|
|
protected function getAction() |
461
|
|
|
{ |
462
|
|
|
return self::$action; |
463
|
|
|
} |
464
|
|
|
} |
465
|
|
|
|
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.
To visualize
will produce issues in the first and second line, while this second example
will produce no issues.