Passed
Push — master ( d27c52...62b14a )
by Andrea
18:17
created

MenuApplicazioneController::editAction()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 46
Code Lines 29

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 27
CRAP Score 3.0029

Importance

Changes 0
Metric Value
eloc 29
dl 0
loc 46
ccs 27
cts 29
cp 0.931
rs 9.456
c 0
b 0
f 0
cc 3
nc 3
nop 2
crap 3.0029
1
<?php
2
3
namespace Fi\CoreBundle\Controller;
4
5
use Symfony\Component\HttpFoundation\Request;
6
use Symfony\Component\HttpFoundation\Response;
7
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
8
9
/**
10
 * MenuApplicazione controller.
11
 */
12
class MenuApplicazioneController extends FiCoreController
13
{
14
    /**
15
     * Displays a form to create a new table entity.
16
     */
17 1
    public function newAction(Request $request)
18
    {
19 1
        $this->setup($request);
20 1
        $namespace = $this->getNamespace();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 2 spaces but found 1 space

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

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
21 1
        $bundle = $this->getBundle();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 5 spaces but found 1 space

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

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
22 1
        $controller = $this->getController();
23
24 1
        if (!self::$canCreate) {
25
            throw new AccessDeniedException("Non si hanno i permessi per creare questo contenuto");
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal Non si hanno i permessi ...creare questo contenuto does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
26
        }
27
28 1
        $nomebundle = $namespace . $bundle . 'Bundle';
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 2 spaces but found 1 space

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

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
29 1
        $classbundle = $namespace . '\\' . $bundle . 'Bundle' . '\\Entity\\' . $controller;
30 1
        $formbundle = $namespace . '\\' . $bundle . 'Bundle' . '\\Form\\' . $controller;
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 2 spaces but found 1 space

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

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
31 1
        $formType = $formbundle . 'Type';
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 4 spaces but found 1 space

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

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
32
33 1
        $entity = new $classbundle();
34 1
        $em = $this->getDoctrine()->getManager();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 5 spaces but found 1 space

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

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
35 1
        $form = $this->createForm(
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 3 spaces but found 1 space

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

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
36 1
            $formType,
37 1
            $entity,
38 1
            array('entity_manager' => $em, 'attr' => array(
39 1
                'id' => 'formdati' . $controller,
40
                ),
41 1
                'action' => $this->generateUrl($controller . '_create'),
42
                )
43
        );
44
45 1
        return $this->render(
46 1
            $nomebundle . ':' . $controller . ':new.html.twig',
47
            array(
48 1
                    'nomecontroller' => $controller,
49 1
                    'entity' => $entity,
50 1
                    'form' => $form->createView(),
51
                        )
52
        );
53
    }
54
    /**
55
     * Displays a form to edit an existing table entity.
56
     */
57 1
    public function editAction(Request $request, $id)
58
    {
59
        /* @var $em \Doctrine\ORM\EntityManager */
60 1
        $this->setup($request);
61 1
        $namespace = $this->getNamespace();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 2 spaces but found 1 space

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

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
62 1
        $bundle = $this->getBundle();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 5 spaces but found 1 space

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

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
63 1
        $controller = $this->getController();
64
65 1
        if (!self::$canUpdate) {
66
            throw new AccessDeniedException("Non si hanno i permessi per modificare questo contenuto");
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal Non si hanno i permessi ...ficare questo contenuto does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
67
        }
68
69 1
        $nomebundle = $namespace . $bundle . 'Bundle';
70 1
        $formbundle = $namespace . '\\' . $bundle . 'Bundle' . '\\Form\\' . $controller;
71 1
        $formType = $formbundle . 'Type';
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 3 spaces but found 1 space

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

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
72
73 1
        $elencomodifiche = $this->elencoModifiche($controller, $id);
74
75 1
        $em = $this->getDoctrine()->getManager();
76
77 1
        $entity = $em->getRepository($nomebundle . ':' . $controller)->find($id);
78
79 1
        if (!$entity) {
80
            throw $this->createNotFoundException('Unable to find ' . $controller . ' entity.');
81
        }
82
83 1
        $editForm = $this->createForm(
84 1
            $formType,
85 1
            $entity,
86 1
            array('entity_manager' => $em, 'attr' => array(
87 1
                'id' => 'formdati' . $controller,
88
                ),
89 1
                'action' => $this->generateUrl($controller . '_update', array('id' => $entity->getId())),
90
                )
91
        );
92
93 1
        $deleteForm = $this->createDeleteForm($id);
94
95 1
        return $this->render(
96 1
            $nomebundle . ':' . $controller . ':edit.html.twig',
97
            array(
98 1
                    'entity' => $entity,
99 1
                    'nomecontroller' => $controller,
100 1
                    'edit_form' => $editForm->createView(),
101 1
                    'delete_form' => $deleteForm->createView(),
102 1
                    'elencomodifiche' => $elencomodifiche,
103
                        )
104
        );
105
    }
106
    /**
107
     * Creates a new table entity.
108
     */
109 1
    public function createAction(Request $request)
110
    {
111 1
        $this->setup($request);
112 1
        $namespace = $this->getNamespace();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 2 spaces but found 1 space

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

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
113 1
        $bundle = $this->getBundle();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 5 spaces but found 1 space

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

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
114 1
        $controller = $this->getController();
115
116 1
        if (!self::$canCreate) {
117
            throw new AccessDeniedException("Non si hanno i permessi per creare questo contenuto");
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal Non si hanno i permessi ...creare questo contenuto does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
118
        }
119
120 1
        $nomebundle = $namespace . $bundle . 'Bundle';
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 2 spaces but found 1 space

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

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
121 1
        $classbundle = $namespace . '\\' . $bundle . 'Bundle' . '\\Entity\\' . $controller;
122 1
        $formbundle = $namespace . '\\' . $bundle . 'Bundle' . '\\Form\\' . $controller;
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 2 spaces but found 1 space

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

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
123
124 1
        $entity = new $classbundle();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 3 spaces but found 1 space

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

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
125 1
        $formType = $formbundle . 'Type';
126 1
        $em = $this->getDoctrine()->getManager();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 7 spaces but found 1 space

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

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
127 1
        $form = $this->createForm(
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 5 spaces but found 1 space

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

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
128 1
            $formType,
129 1
            $entity,
130 1
            array('entity_manager' => $em, 'attr' => array(
131 1
                'id' => 'formdati' . $controller,
132
                ),
133 1
                'action' => $this->generateUrl($controller . '_create'),
134
                )
135
        );
136
137 1
        $form->submit($request->request->get($form->getName()));
138
139 1
        if ($form->isValid()) {
140 1
            $em = $this->getDoctrine()->getManager();
141 1
            $em->persist($entity);
142 1
            $em->flush();
143 1
            $em->getConfiguration()->getResultCacheImpl()->delete($controller);
144
145 1
            $continua = (int) $request->get('continua');
146 1
            if ($continua === 0) {
147 1
                return new Response('OK');
148
            } else {
149
                return $this->redirect($this->generateUrl($controller . '_edit', array('id' => $entity->getId())));
150
            }
151
        }
152
153
        return $this->render(
154
            $nomebundle . ':' . $controller . ':new.html.twig',
155
            array(
156
                    'nomecontroller' => $controller,
157
                    'entity' => $entity,
158
                    'form' => $form->createView(),
159
                        )
160
        );
161
    }
162
    /**
163
     * Edits an existing table entity.
164
     */
165 1
    public function updateAction(Request $request, $id)
166
    {
167
        /* @var $em \Doctrine\ORM\EntityManager */
168 1
        $this->setup($request);
169 1
        $namespace = $this->getNamespace();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 2 spaces but found 1 space

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

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
170 1
        $bundle = $this->getBundle();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 5 spaces but found 1 space

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

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
171 1
        $controller = $this->getController();
172
173 1
        if (!self::$canUpdate) {
174
            throw new AccessDeniedException("Non si hanno i permessi per aggiornare questo contenuto");
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal Non si hanno i permessi ...ornare questo contenuto does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
175
        }
176
177 1
        $nomebundle = $namespace . $bundle . 'Bundle';
178 1
        $formbundle = $namespace . '\\' . $bundle . 'Bundle' . '\\Form\\' . $controller;
179 1
        $formType = $formbundle . 'Type';
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 3 spaces but found 1 space

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

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
180
181 1
        $repoStorico = $this->container->get('Storicomodifiche_repository');
182
183 1
        $em = $this->getDoctrine()->getManager();
184
185 1
        $entity = $em->getRepository($nomebundle . ':' . $controller)->find($id);
186
187 1
        if (!$entity) {
188
            throw $this->createNotFoundException('Unable to find ' . $controller . ' entity.');
189
        }
190
191 1
        $deleteForm = $this->createDeleteForm($id);
192
193 1
        $editForm = $this->createForm(
194 1
            $formType,
195 1
            $entity,
196 1
            array('entity_manager' => $em, 'attr' => array(
197 1
                'id' => 'formdati' . $controller,
198
                ),
199 1
                'action' => $this->generateUrl($controller . '_update', array('id' => $entity->getId())),
200
                )
201
        );
202
203 1
        $editForm->submit($request->request->get($editForm->getName()));
204
205 1
        if ($editForm->isValid()) {
206 1
            $originalData = $em->getUnitOfWork()->getOriginalEntityData($entity);
207
208 1
            $em->persist($entity);
209 1
            $em->flush();
210 1
            $em->getConfiguration()->getResultCacheImpl()->delete($controller);
211
212 1
            $newData = $em->getUnitOfWork()->getOriginalEntityData($entity);
213 1
            $changes = $repoStorico->isRecordChanged($nomebundle, $controller, $originalData, $newData);
214
215 1
            if ($changes) {
216
                $repoStorico->saveHistory($controller, $changes, $id, $this->getUser());
217
            }
218
219 1
            $continua = (int) $request->get('continua');
220 1
            if ($continua === 0) {
221 1
                return new Response('OK');
222
            } else {
223
                return $this->redirect($this->generateUrl($controller . '_edit', array('id' => $id)));
224
            }
225
        }
226
227
        return $this->render(
228
            $nomebundle . ':' . $controller . ':edit.html.twig',
229
            array(
230
                    'entity' => $entity,
231
                    'edit_form' => $editForm->createView(),
232
                    'delete_form' => $deleteForm->createView(),
233
                    'nomecontroller' => $controller,
234
                        )
235
        );
236
    }
237
    /**
238
     * Deletes a table entity.
239
     */
240 1
    public function deleteAction(Request $request)
241
    {
242
        /* @var $em \Doctrine\ORM\EntityManager */
243 1
        $this->setup($request);
244 1
        if (!self::$canDelete) {
245
            throw new AccessDeniedException("Non si hanno i permessi per aggiornare questo contenuto");
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal Non si hanno i permessi ...ornare questo contenuto does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
246
        }
247 1
        $namespace = $this->getNamespace();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 2 spaces but found 1 space

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

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
248 1
        $bundle = $this->getBundle();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 5 spaces but found 1 space

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

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
249 1
        $controller = $this->getController();
250
251 1
        $nomebundle = $namespace . $bundle . 'Bundle';
252
253
        try {
254 1
            $em = $this->getDoctrine()->getManager();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 2 spaces but found 1 space

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

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
255 1
            $qb = $em->createQueryBuilder();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 2 spaces but found 1 space

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

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
256 1
            $ids = explode(', ', $request->get('id'));
257 1
            $qb->delete($nomebundle . ':' . $controller, 'u')
258 1
                    ->andWhere('u.id IN (:ids)')
259 1
                    ->setParameter('ids', $ids);
260
261 1
            $query = $qb->getQuery();
262 1
            $query->execute();
263 1
            $em->getConfiguration()->getResultCacheImpl()->delete($controller);
264
        } catch (\Exception $e) {
265
            $response = new Response();
266
            $response->setStatusCode('200');
267
268
            return new Response('404');
269
        }
270
271 1
        return new Response('OK');
272
    }
273
}
274