Passed
Push — 4.1 ( 619165...98684d )
by Andrea
13:07
created

FiCrudController   A

Complexity

Total Complexity 25

Size/Duplication

Total Lines 328
Duplicated Lines 0 %

Test Coverage

Coverage 85.06%

Importance

Changes 0
Metric Value
wmc 25
eloc 179
dl 0
loc 328
ccs 148
cts 174
cp 0.8506
rs 10
c 0
b 0
f 0

7 Methods

Rating   Name   Duplication   Size   Complexity  
A edit() 0 49 4
A index() 0 71 3
B update() 0 65 7
A new() 0 53 5
A createDeleteForm() 0 5 1
A elencoModifiche() 0 12 1
A delete() 0 30 4
1
<?php
2
namespace Fi\CoreBundle\Controller;
3
4
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
5
use Symfony\Component\HttpFoundation\Request;
6
use Symfony\Component\HttpFoundation\Response;
7
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
8
use Fi\CoreBundle\Utils\Tabella\ParametriTabella;
9
use Symfony\Component\Asset\Packages;
10
11
class FiCrudController extends AbstractController
12
{
13
14
    /**
15
     * Lists all tables entities.
16
     */
17 4
    public function index(Request $request, Packages $assetsmanager)
18
    {
19 4
        $bundle = $this->getBundle();
0 ignored issues
show
Bug introduced by
The method getBundle() does not exist on Fi\CoreBundle\Controller\FiCrudController. It seems like you code against a sub-type of Fi\CoreBundle\Controller\FiCrudController such as Fi\CoreBundle\Controller\FiController. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

19
        /** @scrutinizer ignore-call */ 
20
        $bundle = $this->getBundle();
Loading history...
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...
20 4
        $controller = $this->getController();
0 ignored issues
show
Bug introduced by
The method getController() does not exist on Fi\CoreBundle\Controller\FiCrudController. It seems like you code against a sub-type of Fi\CoreBundle\Controller\FiCrudController such as Fi\CoreBundle\Controller\FiController. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

20
        /** @scrutinizer ignore-call */ 
21
        $controller = $this->getController();
Loading history...
21 4
        $idpassato = $request->get('id');
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...
22
23 4
        if (!$this->getPermessi()->canRead()) {
0 ignored issues
show
Bug introduced by
The method getPermessi() does not exist on Fi\CoreBundle\Controller\FiCrudController. It seems like you code against a sub-type of Fi\CoreBundle\Controller\FiCrudController such as Fi\CoreBundle\Controller\FiController. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

23
        if (!$this->/** @scrutinizer ignore-call */ getPermessi()->canRead()) {
Loading history...
24
            throw new AccessDeniedException("Non si hanno i permessi per visualizzare questo contenuto");
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal Non si hanno i permessi ...izzare 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...
25
        }
26 4
        $template = $bundle . ':' . $controller . ':Crud/' . $this->getThisFunctionName() . '.html.twig';
0 ignored issues
show
Bug introduced by
The method getThisFunctionName() does not exist on Fi\CoreBundle\Controller\FiCrudController. It seems like you code against a sub-type of Fi\CoreBundle\Controller\FiCrudController such as Fi\CoreBundle\Controller\FiController. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

26
        $template = $bundle . ':' . $controller . ':Crud/' . $this->/** @scrutinizer ignore-call */ getThisFunctionName() . '.html.twig';
Loading history...
27 4
        if (!$this->get('templating')->exists($template)) {
28
            $template = $controller . '/Crud/' . $this->getThisFunctionName() . '.html.twig';
29
        }
30
31 4
        $entityclassnotation = $this->getEntityClassNotation();
0 ignored issues
show
Bug introduced by
The method getEntityClassNotation() does not exist on Fi\CoreBundle\Controller\FiCrudController. It seems like you code against a sub-type of Fi\CoreBundle\Controller\FiCrudController such as Fi\CoreBundle\Controller\FiController. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

31
        /** @scrutinizer ignore-call */ 
32
        $entityclassnotation = $this->getEntityClassNotation();
Loading history...
32 4
        $entityclass = $this->getEntityClassName();
0 ignored issues
show
Bug introduced by
The method getEntityClassName() does not exist on Fi\CoreBundle\Controller\FiCrudController. It seems like you code against a sub-type of Fi\CoreBundle\Controller\FiCrudController such as Fi\CoreBundle\Controller\FiController. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

32
        /** @scrutinizer ignore-call */ 
33
        $entityclass = $this->getEntityClassName();
Loading history...
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 9 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...
33
34 4
        $formclass = str_replace("Entity", "Form", $entityclass);
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal Entity 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...
Coding Style Comprehensibility introduced by
The string literal Form 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...
35
36
        $modellocolonne = array(
37
            /*
0 ignored issues
show
Unused Code Comprehensibility introduced by
51% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
38
              $controller . ".nominativo" => array(
39
              "nometabella" => $controller,
40
              "nomecampo" => "nominativo",
41
              "etichetta" => "Nominativo",
42
              "ordine" => 10,
43
              "larghezza" => 200,
44
              "escluso" => false
45
              ),
46
              $controller . ".datanascita" => array(
47
              "nometabella" => $controller,
48
              "nomecampo" => "datanascita",
49
              "etichetta" => "Data di nascita",
50
              "ordine" => 20,
51
              "larghezza" => 100,
52
              "escluso" => false
53
              ),
54
55
             */
56 4
        );
57
58 4
        $colonneordinamento = array($controller . '.id' => "DESC");
0 ignored issues
show
Unused Code introduced by
The assignment to $colonneordinamento is dead and can be removed.
Loading history...
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...
Coding Style Comprehensibility introduced by
The string literal DESC 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...
59 4
        $filtri = array();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 14 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...
60 4
        $prefiltri = array();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 11 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 4
        $entityutils = new \Fi\CoreBundle\Utils\Entity\EntityUtils($this->get("doctrine")->getManager());
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 9 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 doctrine 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...
62 4
        $tablenamefromentity = $entityutils->getTableFromEntity($entityclass);
63 4
        $colonneordinamento = array($tablenamefromentity . '.id' => "DESC");
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...
Coding Style Comprehensibility introduced by
The string literal DESC 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...
64 4
        $parametritabella = array("em" => ParametriTabella::setParameter("default"),
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...
Coding Style Comprehensibility introduced by
The string literal em 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...
Coding Style Comprehensibility introduced by
The string literal default 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...
65 4
            'tablename' => ParametriTabella::setParameter($tablenamefromentity),
66 4
            'nomecontroller' => ParametriTabella::setParameter($controller),
67 4
            'bundle' => ParametriTabella::setParameter($bundle),
68 4
            'entityname' => ParametriTabella::setParameter($entityclassnotation),
69 4
            'entityclass' => ParametriTabella::setParameter($entityclass),
70 4
            'formclass' => ParametriTabella::setParameter($formclass),
71 4
            'modellocolonne' => ParametriTabella::setParameter(json_encode($modellocolonne)),
72 4
            'permessi' => ParametriTabella::setParameter(json_encode($this->getPermessi())),
73 4
            'urltabella' => ParametriTabella::setParameter($assetsmanager->getUrl('/') . $controller . '/' . 'tabella'),
74 4
            'baseurl' => ParametriTabella::setParameter($assetsmanager->getUrl('/')),
75 4
            'idpassato' => ParametriTabella::setParameter($idpassato),
76 4
            'titolotabella' => ParametriTabella::setParameter("Elenco " . $controller),
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal Elenco 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...
77 4
            'paginacorrente' => ParametriTabella::setParameter("1"),
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal 1 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...
78 4
            'paginetotali' => ParametriTabella::setParameter(""),
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal 0 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...
79 4
            'righetotali' => ParametriTabella::setParameter("0"),
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal 0 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...
80 4
            'righeperpagina' => ParametriTabella::setParameter("15"),
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal 15 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...
81 4
            'colonneordinamento' => ParametriTabella::setParameter(json_encode($colonneordinamento)),
82 4
            'filtri' => ParametriTabella::setParameter(json_encode($filtri)),
83 4
            'prefiltri' => ParametriTabella::setParameter(json_encode($prefiltri)),
84 4
            'traduzionefiltri' => ParametriTabella::setParameter(""),
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal 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...
85
        );
86
87 4
        return $this->render($template, array('parametritabella' => $parametritabella,));
88
    }
89
90
        /**
91
         * Displays a form to create a new table entity.
92
         */
93 5
    public function new(Request $request)
94
    {
95
        /* @var $em \Doctrine\ORM\EntityManager */
96 5
        $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 5
        $controller = $this->getController();
98 5
        if (!$this->getPermessi()->canCreate()) {
99
            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...
100
        }
101 5
        $template = $bundle . ':' . $controller . ':Crud/' . $this->getThisFunctionName() . '.html.twig';
102 5
        if (!$this->get('templating')->exists($template)) {
103
            $template = $controller . '/Crud/' . $this->getThisFunctionName() . '.html.twig';
104
        }
105 5
        $entityclass = $this->getEntityClassName();
106 5
        $formclass = str_replace("Entity", "Form", $entityclass);
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...
Coding Style Comprehensibility introduced by
The string literal Entity 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...
Coding Style Comprehensibility introduced by
The string literal Form 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...
107
108 5
        $entity = new $entityclass();
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...
109 5
        $formType = $formclass . 'Type';
110 5
        $form = $this->createForm($formType, $entity, array('attr' => array(
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...
111 5
        'id' => 'formdati' . $controller,
112
        ),
113 5
        'action' => $this->generateUrl($controller . '_new'),
114
        ));
115
116 5
        $form->handleRequest($request);
117
118
        $twigparms = array(
119 5
        'form' => $form->createView(),
120 5
        'nomecontroller' => ParametriTabella::setParameter($controller)
121
        );
122
123 5
        if ($form->isSubmitted()) {
124 5
            if ($form->isValid()) {
125 5
                $entity = $form->getData();
126
127 5
                $entityManager = $this->getDoctrine()->getManager();
128 5
                $entityManager->persist($entity);
129 5
                $entityManager->flush();
130 5
                return new Response(
131 5
                    $this->renderView($template, $twigparms),
132 5
                    200
133
                );
134
            } else {
135
                //Quando non passa la validazione
136
                return new Response(
137
                    $this->renderView($template, $twigparms),
138
                    400
139
                );
140
            }
141
        } else {
142
            //Quando viene richiesta una "nuova" new
143 5
            return new Response(
144 5
                $this->renderView($template, $twigparms),
145 5
                200
146
            );
147
        }
148
    }
149
150
    /**
151
     * Displays a form to edit an existing table entity.
152
     */
153 6
    public function edit(Request $request, $id)
0 ignored issues
show
Unused Code introduced by
The parameter $request is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

153
    public function edit(/** @scrutinizer ignore-unused */ Request $request, $id)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
154
    {
155
        /* @var $em \Doctrine\ORM\EntityManager */
156 6
        $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...
157 6
        $controller = $this->getController();
158
159 6
        if (!$this->getPermessi()->canUpdate()) {
160
            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...
161
        }
162 6
        $template = $bundle . ':' . $controller . ':Crud/' . $this->getThisFunctionName() . '.html.twig';
163 6
        if (!$this->get('templating')->exists($template)) {
164 1
            $template = $controller . '/Crud/' . $this->getThisFunctionName() . '.html.twig';
165
        }
166
167 6
        $entityclass = $this->getEntityClassName();
168 6
        $formclass = str_replace("Entity", "Form", $entityclass);
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...
Coding Style Comprehensibility introduced by
The string literal Entity 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...
Coding Style Comprehensibility introduced by
The string literal Form 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...
169
170 6
        $formType = $formclass . 'Type';
171
172 6
        $elencomodifiche = $this->elencoModifiche($controller, $id);
173
174 6
        $em = $this->getDoctrine()->getManager();
175
176 6
        $entity = $em->getRepository($entityclass)->find($id);
177
178 6
        if (!$entity) {
179
            throw $this->createNotFoundException('Impossibile trovare l\'entità ' . $controller . ' del record con id ' . $id . '.');
180
        }
181
182 6
        $editForm = $this->createForm(
183 6
            $formType,
184 6
            $entity,
185
            array('attr' => array(
186 6
                'id' => 'formdati' . $controller,
187
            ),
188 6
            'action' => $this->generateUrl($controller . '_update', array('id' => $entity->getId())),
189
            )
190
        );
191
192 6
        $deleteForm = $this->createDeleteForm($id);
193
194 6
        return $this->render(
195 6
            $template,
196
            array(
197 6
                'entity' => $entity,
198 6
                'nomecontroller' => ParametriTabella::setParameter($controller),
199 6
                'edit_form' => $editForm->createView(),
200 6
                'delete_form' => $deleteForm->createView(),
201 6
                'elencomodifiche' => $elencomodifiche,
202
                )
203
        );
204
    }
205
206
    /**
207
     * Edits an existing table entity.
208
     */
209 6
    public function update(Request $request, $id)
210
    {
211
        /* @var $em \Doctrine\ORM\EntityManager */
212 6
        $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...
213 6
        $controller = $this->getController();
214 6
        if (!$this->getPermessi()->canUpdate()) {
215
            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...
216
        }
217 6
        $template = $bundle . ':' . $controller . ':Crud/edit.html.twig';
218 6
        if (!$this->get('templating')->exists($template)) {
219 1
            $template = $controller . '/Crud/edit.html.twig';
220
        }
221
222 6
        $entityclass = $this->getEntityClassName();
223 6
        $formclass = str_replace("Entity", "Form", $entityclass);
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...
Coding Style Comprehensibility introduced by
The string literal Entity 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...
Coding Style Comprehensibility introduced by
The string literal Form 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...
224 6
        $formType = $formclass . '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...
225
226 6
        $em = $this->getDoctrine()->getManager();
227
228 6
        $entity = $em->getRepository($entityclass)->find($id);
229
230 6
        if (!$entity) {
231
            throw $this->createNotFoundException('Impossibile trovare l\'entità ' . $controller . ' per il record con id ' . $id);
232
        }
233
234 6
        $editForm = $this->createForm(
235 6
            $formType,
236 6
            $entity,
237
            array('attr' => array(
238 6
                'id' => 'formdati' . $controller,
239
            ),
240 6
            'action' => $this->generateUrl($controller . '_update', array('id' => $entity->getId())),
241
            )
242
        );
243
244 6
        $editForm->submit($request->request->get($editForm->getName()));
245
246 6
        if ($editForm->isValid()) {
247 6
            $originalData = $em->getUnitOfWork()->getOriginalEntityData($entity);
248
249 6
            $em->persist($entity);
250 6
            $em->flush();
251
252 6
            $newData = $em->getUnitOfWork()->getOriginalEntityData($entity);
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...
253 6
            $repoStorico = $em->getRepository("CoreBundle:Storicomodifiche");
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal CoreBundle:Storicomodifiche 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...
254 6
            $changes = $repoStorico->isRecordChanged($controller, $originalData, $newData);
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...
255
256 6
            if ($changes) {
257 2
                $repoStorico->saveHistory($controller, $changes, $id, $this->getUser());
258
            }
259
260 6
            $continua = (int) $request->get('continua');
261 6
            if ($continua === 0) {
262 6
                return new Response('OK');
263
            } else {
264
                return $this->redirect($this->generateUrl($controller . '_edit', array('id' => $id)));
265
            }
266
        }
267
268
        return $this->render(
269
            $template,
270
            array(
271
                'entity' => $entity,
272
                'edit_form' => $editForm->createView(),
273
                'nomecontroller' => ParametriTabella::setParameter($controller),
274
                )
275
        );
276
    }
277
278
    /**
279
     * Deletes a table entity.
280
     */
281 5
    public function delete(Request $request)
282
    {
283
        /* @var $em \Doctrine\ORM\EntityManager */
284 5
        if (!$this->getPermessi()->canDelete()) {
285
            throw new AccessDeniedException("Non si hanno i permessi per eliminare questo contenuto");
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal Non si hanno i permessi ...minare 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...
286
        }
287 5
        $entityclass = $this->getEntityClassName();
288
289
290
        try {
291 5
            $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...
292 5
            $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...
293 5
            $ids = explode(', ', $request->get('id'));
294 5
            $qb->delete($entityclass, 'u')
295 5
                ->andWhere('u.id IN (:ids)')
296 5
                ->setParameter('ids', $ids);
297
298 5
            $query = $qb->getQuery();
299 5
            $query->execute();
300
        } catch (\Doctrine\DBAL\Exception\ForeignKeyConstraintViolationException $e) {
301
            $response = new Response($e->getMessage());
302
            $response->setStatusCode('501');
303
            return $response;
304
        } catch (\Exception $e) {
305
            $response = new Response($e->getMessage());
306
            $response->setStatusCode('200');
307
            return $response;
308
        }
309
310 5
        return new Response('Operazione eseguita con successo');
311
    }
312
313
    /**
314
     * Creates a form to delete a table entity by id.
315
     *
316
     * @param mixed $id The entity id
317
     *
318
     * @return \Symfony\Component\Form\Form The form
319
     */
320 6
    protected function createDeleteForm($id)
321
    {
322 6
        return $this->createFormBuilder(array('id' => $id))
323 6
                ->add('id', get_class(new \Symfony\Component\Form\Extension\Core\Type\HiddenType()))
324 6
                ->getForm();
325
    }
326
327 6
    protected function elencoModifiche($controller, $id)
328
    {
329 6
        $em = $this->getDoctrine()->getManager();
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...
330 6
        $risultato = $em->getRepository('CoreBundle:Storicomodifiche')->findBy(
331
            array(
332 6
                'nometabella' => $controller,
333 6
                'idtabella' => $id,
334
            ),
335 6
            array('giorno' => 'DESC')
336
        );
337
338 6
        return $risultato;
339
    }
340
}
341