Passed
Push — master ( ffa83f...6ce442 )
by Andrea
04:02
created

OpzioniTabellaController::indexAction()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 70
Code Lines 55

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 30
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 55
dl 0
loc 70
ccs 30
cts 30
cp 1
rs 8.9818
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1

How to fix   Long Method   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
3
/* Qui Bundle */
4
//namespace Fi\DemoBundle\Controller;
5
6
namespace Fi\CoreBundle\Controller;
7
8
use Symfony\Component\HttpFoundation\Request;
9
use Symfony\Component\HttpFoundation\Response;
10
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
11
12
/**
13
 * OpzioniTabella controller.
14
 */
15
class OpzioniTabellaController extends FiCoreController
16
{
17
18
    /**
19
     * Lists all opzioniTabella entities.
20
     */
21 1
    public function indexAction(Request $request)
22
    {
23
        /* @var $em \Doctrine\ORM\EntityManager */
24 1
        $this->setup($request);
25 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...
26 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...
27 1
        $controller = $this->getController();
28 1
        $container = $this->container;
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
30 1
        $nomebundle = $namespace . $bundle . 'Bundle';
31
32
        $dettaglij = array(
33 1
            'descrizione' => array(
34
                array(
35
                    'nomecampo' => 'descrizione',
36
                    'lunghezza' => '400',
37
                    'descrizione' => 'Descrizione',
38
                    'tipo' => 'text',),),
39
            'parametro' => array(
40
                array(
41
                    'nomecampo' => 'parametro',
42
                    'lunghezza' => '300',
43
                    'descrizione' => 'Parametro',
44
                    'tipo' => 'text',),),
45
            'valore' => array(
46
                array(
47
                    'nomecampo' => 'valore',
48
                    'lunghezza' => '300',
49
                    'descrizione' => 'Valore',
50
                    'tipo' => 'text',),),
51
            'tabelle_id' => array(
52
                array(
53
                    'nomecampo' => 'tabelle.nometabella',
54
                    'lunghezza' => '400',
55
                    'descrizione' => 'Tabella',
56
                    'tipo' => 'text',),
57
            ),
58
        );
59
60 1
        $escludi = array();
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...
61
        $paricevuti = array(
62 1
            'nomebundle' => $nomebundle,
63 1
            'nometabella' => $controller,
64 1
            'dettaglij' => $dettaglij,
65 1
            'escludere' => $escludi,
66 1
            'container' => $container,
67
        );
68
69 1
        $griglia = $this->get("ficorebundle.griglia");
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 8 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...
Coding Style Comprehensibility introduced by
The string literal ficorebundle.griglia 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...
70 1
        $testatagriglia = $griglia->testataPerGriglia($paricevuti);
71
72 1
        $testatagriglia['multisearch'] = 1;
73 1
        $testatagriglia['showconfig'] = 1;
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...
74 1
        $testatagriglia['showadd'] = 1;
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...
75 1
        $testatagriglia['showedit'] = 1;
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...
76 1
        $testatagriglia['showdel'] = 1;
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...
77 1
        $testatagriglia['editinline'] = 0;
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...
78 1
        $testatagriglia['overlayopen'] = 1;
79
80 1
        $testatagriglia['parametritesta'] = json_encode($paricevuti);
81 1
        $this->setParametriGriglia(array('request' => $request));
82 1
        $testatagriglia['parametrigriglia'] = json_encode(self::$parametrigriglia);
83
84 1
        $testata = json_encode($testatagriglia);
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...
85
        $twigparms = array(
86 1
            'nomecontroller' => $controller,
87 1
            'testata' => $testata,
88
        );
89
90 1
        return $this->render($nomebundle . ':' . $controller . ':index.html.twig', $twigparms);
91
    }
92
93 1
    public function setParametriGriglia($prepar = array())
94
    {
95 1
        $this->setup($prepar['request']);
96 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...
97 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...
98 1
        $controller = $this->getController();
99
100 1
        $nomebundle = $namespace . $bundle . 'Bundle';
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 13 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...
101 1
        $escludi = array();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 16 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...
102 1
        $tabellej = array();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 15 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...
103 1
        $tabellej['tabelle_id'] = array('tabella' => 'tabelle', 'campi' => array('nometabella'));
104
105
        $paricevuti = array(
106 1
            'container' => $this->container,
107 1
            'nomebundle' => $nomebundle,
108 1
            'tabellej' => $tabellej,
109 1
            'nometabella' => $controller,
110 1
            'escludere' => $escludi,);
111
112 1
        if (!empty($prepar)) {
113 1
            $paricevuti = array_merge($paricevuti, $prepar);
114
        }
115
116 1
        self::$parametrigriglia = $paricevuti;
117 1
    }
118
119
    /**
120
     * Creates a new table entity.
121
     */
122 1
    public function createAction(Request $request)
123
    {
124 1
        $this->setup($request);
125 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...
126 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...
127 1
        $controller = $this->getController();
128
129 1
        if (!self::$canCreate) {
130
            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...
131
        }
132
133 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...
134 1
        $classbundle = $namespace . '\\' . $bundle . 'Bundle' . '\\Entity\\' . $controller;
135 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...
136
137 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...
138 1
        $formType = $formbundle . 'Type';
139
140 1
        $form = $this->createForm(
141 1
            $formType,
142 1
            $entity,
143
            array('attr' => array(
144 1
                'id' => 'formdati' . $controller,
145
                ),
146 1
                'action' => $this->generateUrl($controller . '_create'),
147
                )
148
        );
149
150 1
        $form->submit($request->request->get($form->getName()));
151
152 1
        if ($form->isValid()) {
153 1
            $em = $this->getDoctrine()->getManager();
154 1
            $em->persist($entity);
155 1
            $em->flush();
156 1
            $em->getConfiguration()->getResultCacheImpl()->delete($controller);
157
158 1
            $continua = (int) $request->get('continua');
159 1
            if ($continua === 0) {
160 1
                return new Response('OK');
161
            } else {
162
                return $this->redirect($this->generateUrl($controller . '_edit', array('id' => $entity->getId())));
163
            }
164
        }
165
166
        return $this->render(
167
            $nomebundle . ':' . $controller . ':new.html.twig',
168
            array(
169
                    'nomecontroller' => $controller,
170
                    'entity' => $entity,
171
                    'form' => $form->createView(),
172
                        )
173
        );
174
    }
175
176
    /**
177
     * Edits an existing table entity.
178
     */
179 1
    public function updateAction(Request $request, $id)
180
    {
181
        /* @var $em \Doctrine\ORM\EntityManager */
182 1
        $this->setup($request);
183 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...
184 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...
185 1
        $controller = $this->getController();
186
187 1
        if (!self::$canUpdate) {
188
            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...
189
        }
190
191 1
        $nomebundle = $namespace . $bundle . 'Bundle';
192 1
        $formbundle = $namespace . '\\' . $bundle . 'Bundle' . '\\Form\\' . $controller;
193 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...
194
195 1
        $repoStorico = $this->container->get('Storicomodifiche_repository');
196
197 1
        $em = $this->getDoctrine()->getManager();
198
199 1
        $entity = $em->getRepository($nomebundle . ':' . $controller)->find($id);
200
201 1
        if (!$entity) {
202
            throw $this->createNotFoundException('Unable to find ' . $controller . ' entity.');
203
        }
204
205 1
        $deleteForm = $this->createDeleteForm($id);
206
207 1
        $editForm = $this->createForm(
208 1
            $formType,
209 1
            $entity,
210
            array('attr' => array(
211 1
                'id' => 'formdati' . $controller,
212
                ),
213 1
                'action' => $this->generateUrl($controller . '_update', array('id' => $entity->getId())),
214
                )
215
        );
216
217 1
        $editForm->submit($request->request->get($editForm->getName()));
218
219 1
        if ($editForm->isValid()) {
220 1
            $originalData = $em->getUnitOfWork()->getOriginalEntityData($entity);
221
222 1
            $em->persist($entity);
223 1
            $em->flush();
224 1
            $em->getConfiguration()->getResultCacheImpl()->delete($controller);
225
226 1
            $newData = $em->getUnitOfWork()->getOriginalEntityData($entity);
227 1
            $changes = $repoStorico->isRecordChanged($nomebundle, $controller, $originalData, $newData);
228
229 1
            if ($changes) {
230
                $repoStorico->saveHistory($controller, $changes, $id, $this->getUser());
231
            }
232
233 1
            $continua = (int) $request->get('continua');
234 1
            if ($continua === 0) {
235 1
                return new Response('OK');
236
            } else {
237
                return $this->redirect($this->generateUrl($controller . '_edit', array('id' => $id)));
238
            }
239
        }
240
241
        return $this->render(
242
            $nomebundle . ':' . $controller . ':edit.html.twig',
243
            array(
244
                    'entity' => $entity,
245
                    'edit_form' => $editForm->createView(),
246
                    'delete_form' => $deleteForm->createView(),
247
                    'nomecontroller' => $controller,
248
                        )
249
        );
250
    }
251
252
    /**
253
     * Deletes a table entity.
254
     */
255 1
    public function deleteAction(Request $request)
256
    {
257
        /* @var $em \Doctrine\ORM\EntityManager */
258 1
        $this->setup($request);
259 1
        if (!self::$canDelete) {
260
            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...
261
        }
262 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...
263 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...
264 1
        $controller = $this->getController();
265
266 1
        $nomebundle = $namespace . $bundle . 'Bundle';
267
268
        try {
269 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...
270 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...
271 1
            $ids = explode(',', $request->get('id'));
272 1
            $qb->delete($nomebundle . ':' . $controller, 'u')
273 1
                    ->andWhere('u.id IN (:ids)')
274 1
                    ->setParameter('ids', $ids);
275
276 1
            $query = $qb->getQuery();
277 1
            $query->execute();
278 1
            $em->getConfiguration()->getResultCacheImpl()->delete($controller);
279
        } catch (\Exception $e) {
280
            $response = new Response();
281
            $response->setStatusCode('200');
282
283
            return new Response('404');
284
        }
285
286 1
        return new Response('OK');
287
    }
288
}
289