Passed
Push — master ( d9abc4...b424d1 )
by Andrea
17:14
created

Griglia::testataPerGriglia()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 34
Code Lines 20

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 21
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 20
nc 1
nop 1
dl 0
loc 34
ccs 21
cts 21
cp 1
crap 1
rs 8.8571
c 0
b 0
f 0
1
<?php
2
3
namespace Fi\CoreBundle\Controller;
4
5
use Fi\CoreBundle\Utils\GridDati;
6
use Fi\CoreBundle\Utils\GridTestata;
7
use Fi\CoreBundle\Utils\GrigliaParametriUtils;
8
use Fi\CoreBundle\Utils\GrigliaUtils;
9
use Fi\CoreBundle\Utils\GrigliaRegoleUtils;
10
use Fi\CoreBundle\Utils\GrigliaCampiExtraUtils;
11
use Fi\CoreBundle\Utils\GrigliaColonneUtils;
12
use Fi\CoreBundle\Utils\GrigliaDatiUtils;
13
use Fi\CoreBundle\Utils\GrigliaDatiPrecondizioniUtils;
14
use Fi\CoreBundle\Utils\GrigliaExtraFunzioniUtils;
15
use Fi\CoreBundle\Utils\GrigliaDatiMultiUtils;
16
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
17
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
18
19
class Griglia extends Controller
20
{
21
22
    /**
23
     * Questa funzione è compatibile con jqGrid e risponde con un formato JSON
24
     * contenente i dati di testata per la griglia.
25
     *
26
     * @param array  $paricevuti
27
     * <pre>object $paricevuti[request]      oggetto che contiene il POST passato alla griglia</pre>
28
     * <pre>string $paricevuti[nometabella]  Nome della tabella</pre>
29
     * <pre>array  $paricevuti[dettaglij]    array contenente tutte le tabelle per le quali richiedere
30
     *                                         la join a partire da $paricevuti[nometabella]
31
     *                                         il vettore è composto da
32
     *                                         array("nomecampodadecodificare"=>array(
33
     *                                         "descrizione"=>"nometabella.campodecodifica",
34
     *                                         "lunghezza"=>"40")
35
     *                                         )</pre>
36
     * <pre>array  $paricevuti[colonne_link] array contenente eventuali colonne che debbano essere
37
     *                                         rappresentate da un link. Non è da confondere con i
38
     *                                         parametri_link di datiPerGriglia, perché QUESTO array
39
     *                                         si può passare alla testata se si vuole avere una
40
     *                                         colonna link che prenda in automatico
41
     *                                         parametro id = al valore dell'id della tabella
42
     *                                         principale su cui si sta facendo la griglia</pre>
43
     * <pre>string $paricevuti[output]       : "index" se la testata serve per la griglia dell'index, "stampa" se la testata serve per la stampa</pre>
44
     *
45
     * @return array contentente i dati di testata per la griglia
46
     */
47 19
    public static function testataPerGriglia($paricevuti = array())
48
    {
49 19
        $nometabella = $paricevuti['nometabella'];
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...
50 19
        $nomebundle = $paricevuti['nomebundle'];
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...
51 19
        $doctrine = GrigliaParametriUtils::getDoctrineByEm($paricevuti);
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 7 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

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

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

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

will produce no issues.

Loading history...
52 19
        $doctrineficore = GrigliaParametriUtils::getDoctrineFiCoreByEm($paricevuti, $doctrine);
53
54 19
        $testata = array();
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...
55 19
        $nomicolonne = 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...
56 19
        $modellocolonne = array();
57 19
        $indice = 0;
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...
58
59 19
        GrigliaColonneUtils::getColonne($nomicolonne, $modellocolonne, $indice, $paricevuti);
60
61
        /* Controlla se alcune colonne devono essere dei link */
62 19
        GrigliaExtraFunzioniUtils::getColonneLink($paricevuti, $modellocolonne);
63
64
        /* Controlla se ci sono dei campi extra da inserire in griglia
65
          (i campi extra non sono utilizzabili come filtri nella filtertoolbar della griglia) */
66 19
        GrigliaCampiExtraUtils::getCampiExtraTestataPerGriglia($paricevuti, $indice, $nomicolonne, $modellocolonne);
67
68 19
        GrigliaUtils::getOpzioniTabella($doctrineficore, $nometabella, $testata);
69
70 19
        GrigliaUtils::getPermessiTabella($paricevuti, $testata);
71
72 19
        $testata['nomicolonne'] = GrigliaUtils::getNomiColonne($nomicolonne);
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...
73 19
        $testata['modellocolonne'] = GrigliaUtils::getModelloColonne($modellocolonne);
74
75 19
        $testata['tabella'] = $nometabella;
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 19
        $testata['nomebundle'] = $nomebundle;
77 19
        $testata['output'] = GrigliaParametriUtils::getOuputType($paricevuti);
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...
78
79 19
        $response = new GridTestata($testata);
80 19
        return $response->getResponse();
81
    }
82
83
    /**
84
     * Questa funzione è compatibile con jqGrid e risponde con un formato JSON contenente
85
     * i dati di risposta sulla base dei parametri passati.
86
     *
87
     * @param array  $parametri
88
     * <pre>object $parametri["request"]        oggetto che contiene il POST passato alla griglia</pre>
89
     * <pre>string $parametri["nometabella"]   Nome della tabella</pre>
90
     * <pre>array  $parametri["tabellej"]       array contenente tutte le tabelle per le quali richiedere
91
     *                                           la join a partire da $paricevuti[nometabella]</pre>
92
     * <pre>array  $parametri["escludere"]      array contenente tutti i campi che non devono essere restituiti</pre>
93
     * <pre>bool   $parametri["nospan"]         se true non imposta limit e offset</pre>
94
     * <pre>array  $parametri["parametri_link"] array contenente le colonne che devono essere rappresentate
95
     *                                           come dei link e relativi parametri per comporre l'href.
96
     *                                           Da non confondere con colonne_link che si passa a
97
     *                                           testataPerGriglia, perchè QUESTO array genera un
98
     *                                           tag <href> interno alla colonna per il quale si
99
     *                                           possono specificare le parti che lo compongono</pre>
100
     * <pre>array  $parametri["decodifiche"]    = array contenente eventuali decodifiche dei valori di
101
     *                                           una colonna che non può essere tradotta con una join
102
     *                                           ad una tabella</pre>
103
     * <pre>string $parametri["output"]         : "index" se i dati servono per la griglia dell'index, "stampa" se i dati servono per la stampa</pre>
104
     *
105
     * @return array in formato JSON con i dati richiesti
106
     */
107 5
    public static function datiPerGriglia($parametri = array())
108
    {
109 5
        $request = $parametri['request'];
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...
110 5
        $container = $parametri['container'];
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...
111 5
        $doctrine = GrigliaParametriUtils::getDoctrineByEm($parametri);
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...
112 5
        $bundle = $parametri['nomebundle'];
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 6 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

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

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

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

will produce no issues.

Loading history...
113 5
        $nometabella = $parametri['nometabella'];
114
115 5
        $gestionepermessi = $container->get('ficorebundle.gestionepermessi');
116 5
        $canRead = ($gestionepermessi->leggere(array('modulo' => $nometabella)) ? 1 : 0);
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 10 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...
117 5
        if (!$canRead) {
118
            throw new AccessDeniedException("Non si hanno i permessi per visualizzare questo contenuto, controllare i permessi dell'utente");
119
        }
120
121 5
        $tabellej = GrigliaDatiUtils::getTabellejNormalizzate($parametri);
122
123 5
        $campiextra = GrigliaDatiUtils::getDatiCampiExtra($parametri);
124
        /* inserisco i filtri passati in un vettore */
125
126
        /* inserisco i parametri che sono passati nella $request all'interno di
127
          apposite variabili in che pagina siamo */
128
        /* direzione dell'ordinamento */
129 5
        $sord = $request->get('sord'); // get the direction if(!$sidx) $sidx =1;
0 ignored issues
show
Unused Code Comprehensibility introduced by
45% 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...
130 5
        $page = $request->get('page'); // get the requested page
131
        /* quante righe restituire (in caso di nospan = false) */
132 5
        $limit = $request->get('rows'); // get how many rows we want to have into the grid
133
        /* su quale campo fare l'ordinamento */
134 5
        $sidx = $request->get('sidx'); // get index row - i.e. user click to sort
135 5
        GrigliaDatiUtils::getDatiOrdinamento($sidx, $nometabella);
136
        /* inizia la query */
137 5
        $entityName = $bundle . ':' . $nometabella;
138 5
        $q = $doctrine->createQueryBuilder();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 10 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...
139 5
        $q->select($nometabella)
140 5
                ->from($entityName, $nometabella);
141
142
        /* scorre le tabelle collegate e crea la leftjoin usando come alias il nome stesso della tabella */
143 5
        if (isset($tabellej)) {
144 3
            GrigliaDatiUtils::setTabelleJoin($q, array('tabellej' => $tabellej, 'nometabella' => $nometabella));
145 3
        }
146
147 5
        GrigliaUtils::init();
148
149
        /* se ci sono delle precondizioni le imposta qui */
150 5
        GrigliaDatiPrecondizioniUtils::setPrecondizioni($q, $parametri);
151
        
152
        /* scorro ogni singola regola */
153 5
        $quanti = 0;
154 5
        GrigliaDatiMultiUtils::prepareQuery($parametri, $q, $sidx, $sord, $page, $limit, $quanti);
155
156 5
        $total_pages = GrigliaDatiMultiUtils::getTotalPages($quanti, $limit);
157
158
        /* imposta in $vettorerisposta la risposta strutturata per essere compresa da jqgrid */
159 5
        $vettorerisposta = array();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 12 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...
160 5
        $vettorerisposta['page'] = $page;
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...
161 5
        $vettorerisposta['total'] = $total_pages;
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...
162 5
        $vettorerisposta['records'] = $quanti;
163 5
        $vettorerisposta['filtri'] = json_decode($request->get('filters'), true);
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...
164 5
        $indice = 0;
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 21 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...
165
166 5
        $escludere = GrigliaParametriUtils::getDatiEscludere($parametri);
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 7 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

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

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

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

will produce no issues.

Loading history...
167 5
        $escludereutente = GrigliaParametriUtils::getDatiEscludereDaTabella($parametri);
168 5
        $ordinecolonne = GrigliaDatiUtils::getDatiOrdineColonne($parametri);
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...
169 5
        $decodifiche = GrigliaDatiUtils::getDatiDecodifiche($parametri);
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...
170
171 5
        $parametri["escludere"] = $escludere;
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal escludere 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 introduced by
Equals sign not aligned with surrounding assignments; expected 7 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

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

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

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

will produce no issues.

Loading history...
172 5
        $parametri["escludereutente"] = $escludereutente;
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal escludereutente 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...
173 5
        $parametri["ordinecolonne"] = $ordinecolonne;
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal ordinecolonne 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 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...
174 5
        $parametri["decodifiche"] = $decodifiche;
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal decodifiche 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 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...
175 5
        $parametri["tabellej"] = $tabellej;
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal tabellej 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 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...
176
177
        /* Si scorrono tutti i records della query */
178 5
        foreach ($q as $singolo) {
179
            /* Si scorrono tutti i campi del record */
180 5
            $vettoreriga = array();
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...
181 5
            $indicecolonna = 0;
182 5
            foreach ($singolo as $nomecampo => $singolocampo) {
183 5
                GrigliaDatiMultiUtils::buildDatiGriglia(
184 5
                    $parametri,
185 5
                    $vettoreriga,
186 5
                    $singolo,
187 5
                    $nomecampo,
188 5
                    $indice,
189 5
                    $indicecolonna,
190
                    $singolocampo
191 5
                );
192 5
            }
193
194 5
            GrigliaCampiExtraUtils::getCampiExtraDatiPerGriglia($campiextra, $vettoreriga, $doctrine, $entityName, $singolo);
195
196 5
            GrigliaDatiMultiUtils::buildRowGriglia($singolo, $vettoreriga, $vettorerisposta);
197 5
        }
198 5
        $response = new GridDati($vettorerisposta);
199 5
        return $response->getResponse();
200
    }
201
}
202