Passed
Push — master ( f8236f...94190f )
by Andrea
17:49
created

OpzioniTabellaController   A

Complexity

Total Complexity 16

Size/Duplication

Total Lines 271
Duplicated Lines 0 %

Test Coverage

Coverage 85.8%

Importance

Changes 0
Metric Value
wmc 16
dl 0
loc 271
ccs 145
cts 169
cp 0.858
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
B setParametriGriglia() 0 24 2
B createAction() 0 50 4
A indexAction() 0 69 1
B updateAction() 0 69 6
B deleteAction() 0 32 3
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
            'descrizione' => array(
34
                array(
35 1
                    'nomecampo' => 'descrizione',
36 1
                    'lunghezza' => '400',
37 1
                    'descrizione' => 'Descrizione',
38 1
                    'tipo' => 'text',),),
39
            'parametro' => array(
40
                array(
41 1
                    'nomecampo' => 'parametro',
42 1
                    'lunghezza' => '300',
43 1
                    'descrizione' => 'Parametro',
44 1
                    'tipo' => 'text',),),
45
            'valore' => array(
46
                array(
47 1
                    'nomecampo' => 'valore',
48 1
                    'lunghezza' => '300',
49 1
                    'descrizione' => 'Valore',
50 1
                    'tipo' => 'text',),),
51
            'tabelle_id' => array(
52
                array(
53 1
                    'nomecampo' => 'tabelle.nometabella',
54 1
                    'lunghezza' => '400',
55 1
                    'descrizione' => 'Tabella',
56 1
                    'tipo' => 'text',),
57 1
            ),
58 1
        );
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 1
        );
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
79 1
        $testatagriglia['parametritesta'] = json_encode($paricevuti);
80 1
        $this->setParametriGriglia(array('request' => $request));
81 1
        $testatagriglia['parametrigriglia'] = json_encode(self::$parametrigriglia);
82
83 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...
84
        $twigparms = array(
85 1
            'nomecontroller' => $controller,
86 1
            'testata' => $testata,
87 1
        );
88
89 1
        return $this->render($nomebundle . ':' . $controller . ':index.html.twig', $twigparms);
90
    }
91
92 1
    public function setParametriGriglia($prepar = array())
93
    {
94 1
        $this->setup($prepar['request']);
95 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...
96 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...
97 1
        $controller = $this->getController();
98
99 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...
100 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...
101 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...
102 1
        $tabellej['tabelle_id'] = array('tabella' => 'tabelle', 'campi' => array('nometabella'));
103
104
        $paricevuti = array(
105 1
            'container' => $this->container,
106 1
            'nomebundle' => $nomebundle,
107 1
            'tabellej' => $tabellej,
108 1
            'nometabella' => $controller,
109 1
            'escludere' => $escludi,);
110
111 1
        if (!empty($prepar)) {
112 1
            $paricevuti = array_merge($paricevuti, $prepar);
113 1
        }
114
115 1
        self::$parametrigriglia = $paricevuti;
116 1
    }
117
118
    /**
119
     * Creates a new table entity.
120
     */
121 1
    public function createAction(Request $request)
122
    {
123 1
        $this->setup($request);
124 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...
125 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...
126 1
        $controller = $this->getController();
127
128 1
        if (!self::$canCreate) {
129
            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...
130
        }
131
132 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...
133 1
        $classbundle = $namespace . '\\' . $bundle . 'Bundle' . '\\Entity\\' . $controller;
134 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...
135
136 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...
137 1
        $formType = $formbundle . 'Type';
138
139 1
        $form = $this->createForm(
140 1
            $formType,
141 1
            $entity,
142
            array('attr' => array(
143 1
                'id' => 'formdati' . $controller,
144 1
                ),
145 1
                'action' => $this->generateUrl($controller . '_create'),
146
                )
147 1
        );
148
149 1
        $form->submit($request->request->get($form->getName()));
150
151 1
        if ($form->isValid()) {
152 1
            $em = $this->getDoctrine()->getManager();
153 1
            $em->persist($entity);
154 1
            $em->flush();
155 1
            $em->getConfiguration()->getResultCacheImpl()->delete($controller);
156
157 1
            $continua = (int) $request->get('continua');
158 1
            if ($continua === 0) {
159 1
                return new Response('OK');
160
            } else {
161
                return $this->redirect($this->generateUrl($controller . '_edit', array('id' => $entity->getId())));
162
            }
163
        }
164
165
        return $this->render(
166
            $nomebundle . ':' . $controller . ':new.html.twig',
167
            array(
168
                    'nomecontroller' => $controller,
169
                    'entity' => $entity,
170
                    'form' => $form->createView(),
171
                        )
172
        );
173
    }
174
175
    /**
176
     * Edits an existing table entity.
177
     */
178 1
    public function updateAction(Request $request, $id)
179
    {
180
        /* @var $em \Doctrine\ORM\EntityManager */
181 1
        $this->setup($request);
182 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...
183 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...
184 1
        $controller = $this->getController();
185
186 1
        if (!self::$canUpdate) {
187
            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...
188
        }
189
190 1
        $nomebundle = $namespace . $bundle . 'Bundle';
191 1
        $formbundle = $namespace . '\\' . $bundle . 'Bundle' . '\\Form\\' . $controller;
192 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...
193
194 1
        $repoStorico = $this->container->get('Storicomodifiche_repository');
195
196 1
        $em = $this->getDoctrine()->getManager();
197
198 1
        $entity = $em->getRepository($nomebundle . ':' . $controller)->find($id);
199
200 1
        if (!$entity) {
201
            throw $this->createNotFoundException('Unable to find ' . $controller . ' entity.');
202
        }
203
204 1
        $deleteForm = $this->createDeleteForm($id);
205
206 1
        $editForm = $this->createForm(
207 1
            $formType,
208 1
            $entity,
209
            array('attr' => array(
210 1
                'id' => 'formdati' . $controller,
211 1
                ),
212 1
                'action' => $this->generateUrl($controller . '_update', array('id' => $entity->getId())),
213
                )
214 1
        );
215
216 1
        $editForm->submit($request->request->get($editForm->getName()));
217
218 1
        if ($editForm->isValid()) {
219 1
            $originalData = $em->getUnitOfWork()->getOriginalEntityData($entity);
220
221 1
            $em->persist($entity);
222 1
            $em->flush();
223 1
            $em->getConfiguration()->getResultCacheImpl()->delete($controller);
224
225 1
            $newData = $em->getUnitOfWork()->getOriginalEntityData($entity);
226 1
            $changes = $repoStorico->isRecordChanged($nomebundle, $controller, $originalData, $newData);
227
228 1
            if ($changes) {
229
                $repoStorico->saveHistory($controller, $changes, $id, $this->getUser());
230
            }
231
232 1
            $continua = (int) $request->get('continua');
233 1
            if ($continua === 0) {
234 1
                return new Response('OK');
235
            } else {
236
                return $this->redirect($this->generateUrl($controller . '_edit', array('id' => $id)));
237
            }
238
        }
239
240
        return $this->render(
241
            $nomebundle . ':' . $controller . ':edit.html.twig',
242
            array(
243
                    'entity' => $entity,
244
                    'edit_form' => $editForm->createView(),
245
                    'delete_form' => $deleteForm->createView(),
246
                    'nomecontroller' => $controller,
247
                        )
248
        );
249
    }
250
251
    /**
252
     * Deletes a table entity.
253
     */
254 1
    public function deleteAction(Request $request)
255
    {
256
        /* @var $em \Doctrine\ORM\EntityManager */
257 1
        $this->setup($request);
258 1
        if (!self::$canDelete) {
259
            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...
260
        }
261 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...
262 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...
263 1
        $controller = $this->getController();
264
265 1
        $nomebundle = $namespace . $bundle . 'Bundle';
266
267
        try {
268 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...
269 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...
270 1
            $ids = explode(',', $request->get('id'));
271 1
            $qb->delete($nomebundle . ':' . $controller, 'u')
272 1
                    ->andWhere('u.id IN (:ids)')
273 1
                    ->setParameter('ids', $ids);
274
275 1
            $query = $qb->getQuery();
276 1
            $query->execute();
277 1
            $em->getConfiguration()->getResultCacheImpl()->delete($controller);
278 1
        } catch (\Exception $e) {
279
            $response = new Response();
280
            $response->setStatusCode('200');
281
282
            return new Response('404');
283
        }
284
285 1
        return new Response('OK');
286
    }
287
}
288