Passed
Push — master ( ea64e0...b9bf1e )
by Andrea
11:15
created

Griglia::datiPerGriglia()   D

Complexity

Conditions 9
Paths 50

Size

Total Lines 134
Code Lines 86

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 93
CRAP Score 9

Importance

Changes 0
Metric Value
dl 0
loc 134
ccs 93
cts 94
cp 0.9894
rs 4.8196
c 0
b 0
f 0
cc 9
eloc 86
nc 50
nop 1
crap 9

How to fix   Long Method   

Long Method

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

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

Commonly applied refactorings include:

1
<?php
2
3
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\Finder\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 16
    public static function testataPerGriglia($paricevuti = array())
48
    {
49 16
        $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 16
        $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 16
        $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 16
        $doctrineficore = GrigliaParametriUtils::getDoctrineFiCoreByEm($paricevuti, $doctrine);
53
54 16
        $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 16
        $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 16
        $modellocolonne = array();
57 16
        $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 16
        GrigliaColonneUtils::getColonne($nomicolonne, $modellocolonne, $indice, $paricevuti);
60
61
        /* Controlla se alcune colonne devono essere dei link */
62 16
        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 16
        GrigliaCampiExtraUtils::getCampiExtraTestataPerGriglia($paricevuti, $indice, $nomicolonne, $modellocolonne);
67
68 16
        GrigliaUtils::getOpzioniTabella($doctrineficore, $nometabella, $testata);
69
70 16
        GrigliaUtils::getPermessiTabella($paricevuti, $testata);
71
72 16
        $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 16
        $testata['modellocolonne'] = GrigliaUtils::getModelloColonne($modellocolonne);
74
75 16
        $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 16
        $testata['nomebundle'] = $nomebundle;
77 16
        $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 16
        $response = new GridTestata($testata);
80 16
        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
        $precondizioni = GrigliaDatiUtils::getDatiPrecondizioni($parametri);
124
125 5
        $precondizioniAvanzate = GrigliaDatiUtils::getDatiPrecondizioniAvanzate($parametri);
126
127 5
        $campiextra = GrigliaDatiUtils::getDatiCampiExtra($parametri);
128
        /* inserisco i filtri passati in un vettore */
129
130 5
        $filtri = json_decode($request->get('filters'), true);
131
        /* inserisco i parametri che sono passati nella $request all'interno di
132
          apposite variabili in che pagina siamo */
133
        /* direzione dell'ordinamento */
134 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...
135 5
        $page = $request->get('page'); // get the requested page
136
        /* quante righe restituire (in caso di nospan = false) */
137 5
        $limit = $request->get('rows'); // get how many rows we want to have into the grid
138
        /* su quale campo fare l'ordinamento */
139 5
        $sidx = $request->get('sidx'); // get index row - i.e. user click to sort
140 5
        GrigliaDatiUtils::getDatiOrdinamento($sidx, $nometabella);
141
        /* inizia la query */
142 5
        $entityName = $bundle . ':' . $nometabella;
143 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...
144 5
        $q->select($nometabella)
145 5
                ->from($entityName, $nometabella);
146
147
        /* scorre le tabelle collegate e crea la leftjoin usando come alias il nome stesso della tabella */
148 5
        if (isset($tabellej)) {
149 3
            GrigliaDatiUtils::setTabelleJoin($q, array('tabellej' => $tabellej, 'nometabella' => $nometabella));
150 3
        }
151
152
        /* dal filtro prende il tipo di operatore (AND o OR sono i due fin qui gestiti) */
153 5
        $tipof = $filtri['groupOp'];
154
        /* prende un vettore con tutte le ricerche */
155 5
        $regole = $filtri['rules'];
156
157 5
        GrigliaUtils::init();
158
159 5
        $primo = true;
160
161
        /* se ci sono delle precondizioni le imposta qui */
162 5
        GrigliaDatiPrecondizioniUtils::precondizioniToPrecondizioniAvanzate($precondizioni, $precondizioniAvanzate, $nometabella);
163
164
        /* se ci sono delle precondizioni avanzate le imposta qui */
165 5
        if ($precondizioniAvanzate) {
166 4
            GrigliaDatiPrecondizioniUtils::setPrecondizioniAvanzate(
167 4
                $q,
168 4
                $primo,
169 4
                array('precondizioniAvanzate' => $precondizioniAvanzate,
170 4
                'doctrine' => $doctrine,
171 4
                'nometabella' => $nometabella,
172 4
                'entityName' => $entityName,
173 4
                'bundle' => $bundle)
174 4
            );
175 4
        }
176
        /* scorro ogni singola regola */
177 5
        if (isset($regole)) {
178 5
            foreach ($regole as $key => $regola) {
179 4
                $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...
180 4
                $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...
181 5
            }
182 5
            GrigliaRegoleUtils::setRegole(
183 5
                $q,
184 5
                $primo,
185
                array(
186 5
                'regole' => $regole,
187 5
                'doctrine' => $doctrine,
188 5
                'nometabella' => $nometabella,
189 5
                'entityName' => $entityName,
190
                'bundle' => $bundle
191 5
                    )
192 5
            );
193 5
        }
194 5
        $quanti = 0;
195 5
        GrigliaDatiMultiUtils::prepareQuery($parametri, $q, $sidx, $sord, $page, $limit, $quanti);
196
197 5
        $total_pages = GrigliaDatiMultiUtils::getTotalPages($quanti, $limit);
198
199
        /* imposta in $vettorerisposta la risposta strutturata per essere compresa da jqgrid */
200 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...
201 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...
202 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...
203 5
        $vettorerisposta['records'] = $quanti;
204 5
        $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...
205 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...
206
207 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...
208 5
        $escludereutente = GrigliaParametriUtils::getDatiEscludereDaTabella($parametri);
209 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...
210 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...
211
212 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...
213 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...
214 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...
215 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...
216 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...
217
218
        /* Si scorrono tutti i records della query */
219 5
        foreach ($q as $singolo) {
220
            /* Si scorrono tutti i campi del record */
221 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...
222 5
            $indicecolonna = 0;
223 5
            foreach ($singolo as $nomecampo => $singolocampo) {
224 5
                GrigliaDatiMultiUtils::buildDatiGriglia(
225 5
                    $parametri,
226 5
                    $vettoreriga,
227 5
                    $singolo,
228 5
                    $nomecampo,
229 5
                    $indice,
230 5
                    $indicecolonna,
231
                    $singolocampo
232 5
                );
233 5
            }
234
235 5
            GrigliaCampiExtraUtils::getCampiExtraDatiPerGriglia($campiextra, $vettoreriga, $doctrine, $entityName, $singolo);
236
237 5
            GrigliaDatiMultiUtils::buildRowGriglia($singolo, $vettoreriga, $vettorerisposta);
238 5
        }
239 5
        $response = new GridDati($vettorerisposta);
240 5
        return $response->getResponse();
241
    }
242
}
243