Passed
Push — master ( ce89ba...4bc45e )
by Andrea
11:12
created

Griglia   A

Complexity

Total Complexity 10

Size/Duplication

Total Lines 225
Duplicated Lines 0 %

Test Coverage

Coverage 98.35%

Importance

Changes 0
Metric Value
wmc 10
dl 0
loc 225
ccs 119
cts 121
cp 0.9835
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
B testataPerGriglia() 0 34 1
D datiPerGriglia() 0 137 9
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
18
class Griglia extends Controller
19
{
20
21
    /**
22
     * Questa funzione è compatibile con jqGrid e risponde con un formato JSON
23
     * contenente i dati di testata per la griglia.
24
     *
25
     * @param array  $paricevuti
26
     * <pre>object $paricevuti[request]      oggetto che contiene il POST passato alla griglia</pre>
27
     * <pre>string $paricevuti[nometabella]  Nome della tabella</pre>
28
     * <pre>array  $paricevuti[dettaglij]    array contenente tutte le tabelle per le quali richiedere
29
     *                                         la join a partire da $paricevuti[nometabella]
30
     *                                         il vettore è composto da
31
     *                                         array("nomecampodadecodificare"=>array(
32
     *                                         "descrizione"=>"nometabella.campodecodifica",
33
     *                                         "lunghezza"=>"40")
34
     *                                         )</pre>
35
     * <pre>array  $paricevuti[colonne_link] array contenente eventuali colonne che debbano essere
36
     *                                         rappresentate da un link. Non è da confondere con i
37
     *                                         parametri_link di datiPerGriglia, perché QUESTO array
38
     *                                         si può passare alla testata se si vuole avere una
39
     *                                         colonna link che prenda in automatico
40
     *                                         parametro id = al valore dell'id della tabella
41
     *                                         principale su cui si sta facendo la griglia</pre>
42
     * <pre>string $paricevuti[output]       : "index" se la testata serve per la griglia dell'index, "stampa" se la testata serve per la stampa</pre>
43
     *
44
     * @return array contentente i dati di testata per la griglia
45
     */
46 13
    public static function testataPerGriglia($paricevuti = array())
47
    {
48 13
        $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...
49 13
        $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...
50 13
        $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...
51 13
        $doctrineficore = GrigliaParametriUtils::getDoctrineFiCoreByEm($paricevuti, $doctrine);
52
53 13
        $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...
54 13
        $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...
55 13
        $modellocolonne = array();
56 13
        $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...
57
58 13
        GrigliaColonneUtils::getColonne($nomicolonne, $modellocolonne, $indice, $paricevuti);
59
60
        /* Controlla se alcune colonne devono essere dei link */
61 13
        GrigliaExtraFunzioniUtils::getColonneLink($paricevuti, $modellocolonne);
62
63
        /* Controlla se ci sono dei campi extra da inserire in griglia
64
          (i campi extra non sono utilizzabili come filtri nella filtertoolbar della griglia) */
65 13
        GrigliaCampiExtraUtils::getCampiExtraTestataPerGriglia($paricevuti, $indice, $nomicolonne, $modellocolonne);
66
67 13
        GrigliaUtils::getOpzioniTabella($doctrineficore, $nometabella, $testata);
68
69 13
        GrigliaUtils::getPermessiTabella($paricevuti, $testata);
70
71 13
        $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...
72 13
        $testata['modellocolonne'] = GrigliaUtils::getModelloColonne($modellocolonne);
73
74 13
        $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...
75 13
        $testata['nomebundle'] = $nomebundle;
76 13
        $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...
77
78 13
        $response = new GridTestata($testata);
79 13
        return $response->getResponse();
80
    }
81
82
    /**
83
     * Questa funzione è compatibile con jqGrid e risponde con un formato JSON contenente
84
     * i dati di risposta sulla base dei parametri passati.
85
     *
86
     * @param array  $parametri
87
     * <pre>object $parametri["request"]        oggetto che contiene il POST passato alla griglia</pre>
88
     * <pre>string $parametri["nometabella"]   Nome della tabella</pre>
89
     * <pre>array  $parametri["tabellej"]       array contenente tutte le tabelle per le quali richiedere
90
     *                                           la join a partire da $paricevuti[nometabella]</pre>
91
     * <pre>array  $parametri["escludere"]      array contenente tutti i campi che non devono essere restituiti</pre>
92
     * <pre>bool   $parametri["nospan"]         se true non imposta limit e offset</pre>
93
     * <pre>array  $parametri["parametri_link"] array contenente le colonne che devono essere rappresentate
94
     *                                           come dei link e relativi parametri per comporre l'href.
95
     *                                           Da non confondere con colonne_link che si passa a
96
     *                                           testataPerGriglia, perchè QUESTO array genera un
97
     *                                           tag <href> interno alla colonna per il quale si
98
     *                                           possono specificare le parti che lo compongono</pre>
99
     * <pre>array  $parametri["decodifiche"]    = array contenente eventuali decodifiche dei valori di
100
     *                                           una colonna che non può essere tradotta con una join
101
     *                                           ad una tabella</pre>
102
     * <pre>string $parametri["output"]         : "index" se i dati servono per la griglia dell'index, "stampa" se i dati servono per la stampa</pre>
103
     *
104
     * @return array in formato JSON con i dati richiesti
105
     */
106 2
    public static function datiPerGriglia($parametri = array())
107
    {
108 2
        $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...
109 2
        $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...
110 2
        $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...
111 2
        $nometabella = $parametri['nometabella'];
112
        /* qui */
113 2
        $tabellej = GrigliaDatiUtils::getTabellejNormalizzate($parametri);
114
115 2
        $precondizioni = GrigliaDatiUtils::getDatiPrecondizioni($parametri);
116
117 2
        $precondizioniAvanzate = GrigliaDatiUtils::getDatiPrecondizioniAvanzate($parametri);
118
119 2
        $campiextra = GrigliaDatiUtils::getDatiCampiExtra($parametri);
120
        /* inserisco i filtri passati in un vettore */
121
122 2
        $filtri = json_decode($request->get('filters'), true);
123
        /* inserisco i parametri che sono passati nella $request all'interno di
124
          apposite variabili in che pagina siamo */
125
        /* direzione dell'ordinamento */
126 2
        $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...
127 2
        $page = $request->get('page'); // get the requested page
128
        /* quante righe restituire (in caso di nospan = false) */
129 2
        $limit = $request->get('rows'); // get how many rows we want to have into the grid
130
        /* su quale campo fare l'ordinamento */
131 2
        $sidx = $request->get('sidx'); // get index row - i.e. user click to sort
132 2
        GrigliaDatiUtils::getDatiOrdinamento($sidx, $nometabella);
133
        /* inizia la query */
134 2
        $entityName = $bundle . ':' . $nometabella;
135 2
        $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...
136 2
        $q->select($nometabella)
137 2
                ->from($entityName, $nometabella);
138
139
        /* scorre le tabelle collegate e crea la leftjoin usando come alias il nome stesso della tabella */
140 2
        if (isset($tabellej)) {
141 1
            GrigliaDatiUtils::setTabelleJoin($q, array('tabellej' => $tabellej, 'nometabella' => $nometabella));
142 1
        }
143
144
        /* dal filtro prende il tipo di operatore (AND o OR sono i due fin qui gestiti) */
145 2
        $tipof = $filtri['groupOp'];
146
        /* prende un vettore con tutte le ricerche */
147 2
        $regole = $filtri['rules'];
148
149 2
        GrigliaUtils::init();
150
151 2
        $primo = true;
152
        /* se ci sono delle precondizioni le imposta qui */
153 2
        foreach ($precondizioni as $campoprecondizione => $valoreprecondizione) {
154 1
            if (strpos($campoprecondizione, ".") === false) {
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...
155 1
                $nometabellaprecondizione = $nometabella;
156 1
                $nomecampoprecondizione = $campoprecondizione;
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...
157 1
            } else {
158
                $nometabellaprecondizione = substr($campoprecondizione, 0, strrpos($campoprecondizione, '.'));
159
                $nomecampoprecondizione = substr($campoprecondizione, strrpos($campoprecondizione, '.') + 1);
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...
160
            }
161 1
            $precondizioniAvanzate[] = array('nometabella' => $nometabellaprecondizione,
162 1
                'nomecampo' => $nomecampoprecondizione,
163 1
                'operatore' => '=',
164 1
                'valorecampo' => $valoreprecondizione);
165 2
        }
166
        /* se ci sono delle precondizioni avanzate le imposta qui */
167 2
        if ($precondizioniAvanzate) {
168 2
            GrigliaDatiPrecondizioniUtils::setPrecondizioniAvanzate(
169 2
                $q,
170 2
                $primo,
171 2
                array('precondizioniAvanzate' => $precondizioniAvanzate,
172 2
                'doctrine' => $doctrine,
173 2
                'nometabella' => $nometabella,
174 2
                'entityName' => $entityName,
175 2
                'bundle' => $bundle)
176 2
            );
177 2
        }
178
        /* scorro ogni singola regola */
179 2
        if (isset($regole)) {
180 2
            foreach ($regole as $key => $regola) {
181 2
                $regole[$key]["typof"] = $tipof;
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal typof 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...
182 2
                $regola = $regola;
0 ignored issues
show
Unused Code introduced by
The assignment to $regola is dead and can be removed.
Loading history...
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...
183 2
            }
184 2
            GrigliaRegoleUtils::setRegole(
185 2
                $q,
186 2
                $primo,
187
                array(
188 2
                'regole' => $regole,
189 2
                'doctrine' => $doctrine,
190 2
                'nometabella' => $nometabella,
191 2
                'entityName' => $entityName,
192
                'bundle' => $bundle
193 2
                    )
194 2
            );
195 2
        }
196 2
        $quanti = 0;
197 2
        GrigliaDatiMultiUtils::prepareQuery($parametri, $q, $sidx, $sord, $page, $limit, $quanti);
198
199 2
        $total_pages = GrigliaDatiMultiUtils::getTotalPages($quanti, $limit);
200
201
        /* imposta in $vettorerisposta la risposta strutturata per essere compresa da jqgrid */
202 2
        $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...
203 2
        $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...
204 2
        $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...
205 2
        $vettorerisposta['records'] = $quanti;
206 2
        $vettorerisposta['filtri'] = $filtri;
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...
207 2
        $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...
208
209 2
        $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...
210 2
        $escludereutente = GrigliaParametriUtils::getDatiEscludereDaTabella($parametri);
211 2
        $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...
212 2
        $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...
213
214 2
        $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...
215 2
        $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...
216 2
        $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...
217 2
        $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...
218 2
        $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...
219
220
        /* Si scorrono tutti i records della query */
221 2
        foreach ($q as $singolo) {
222
            /* Si scorrono tutti i campi del record */
223 2
            $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...
224 2
            $indicecolonna = 0;
225 2
            foreach ($singolo as $nomecampo => $singolocampo) {
226 2
                GrigliaDatiMultiUtils::buildDatiGriglia(
227 2
                    $parametri,
228 2
                    $vettoreriga,
229 2
                    $singolo,
230 2
                    $nomecampo,
231 2
                    $indice,
232 2
                    $indicecolonna,
233
                    $singolocampo
234 2
                );
235 2
            }
236
237 2
            GrigliaCampiExtraUtils::getCampiExtraDatiPerGriglia($campiextra, $vettoreriga, $doctrine, $entityName, $singolo);
238
239 2
            GrigliaDatiMultiUtils::buildRowGriglia($singolo, $vettoreriga, $vettorerisposta);
240 2
        }
241 2
        $response = new GridDati($vettorerisposta);
242 2
        return $response->getResponse();
243
    }
244
}
245