Passed
Push — master ( f8236f...94190f )
by Andrea
17:49
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
dl 0
loc 34
ccs 21
cts 21
cp 1
rs 8.8571
c 0
b 0
f 0
cc 1
eloc 20
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Fi\CoreBundle\DependencyInjection;
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\GrigliaCampiExtraUtils;
10
use Fi\CoreBundle\Utils\GrigliaColonneUtils;
11
use Fi\CoreBundle\Utils\GrigliaDatiUtils;
12
use Fi\CoreBundle\Utils\GrigliaDatiPrecondizioniUtils;
13
use Fi\CoreBundle\Utils\GrigliaExtraFunzioniUtils;
14
use Fi\CoreBundle\Utils\GrigliaDatiMultiUtils;
15
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
16
17
class Griglia
18
{
19
20
    /**
21
     * Questa funzione è compatibile con jqGrid e risponde con un formato JSON
22
     * contenente i dati di testata per la griglia.
23
     *
24
     * @param array  $paricevuti
25
     * <pre>object $paricevuti[request]      oggetto che contiene il POST passato alla griglia</pre>
26
     * <pre>string $paricevuti[nometabella]  Nome della tabella</pre>
27
     * <pre>array  $paricevuti[dettaglij]    array contenente tutte le tabelle per le quali richiedere
28
     *                                         la join a partire da $paricevuti[nometabella]
29
     *                                         il vettore è composto da
30
     *                                         array("nomecampodadecodificare"=>array(
31
     *                                         "descrizione"=>"nometabella.campodecodifica",
32
     *                                         "lunghezza"=>"40")
33
     *                                         )</pre>
34
     * <pre>array  $paricevuti[colonne_link] array contenente eventuali colonne che debbano essere
35
     *                                         rappresentate da un link. Non è da confondere con i
36
     *                                         parametri_link di datiPerGriglia, perché QUESTO array
37
     *                                         si può passare alla testata se si vuole avere una
38
     *                                         colonna link che prenda in automatico
39
     *                                         parametro id = al valore dell'id della tabella
40
     *                                         principale su cui si sta facendo la griglia</pre>
41
     * <pre>string $paricevuti[output]       : "index" se la testata serve per la griglia dell'index, "stampa" se la testata serve per la stampa</pre>
42
     *
43
     * @return array contentente i dati di testata per la griglia
44
     */
45 19
    public function testataPerGriglia($paricevuti = [])
46
    {
47 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...
48 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...
49 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...
50 19
        $doctrineficore = GrigliaParametriUtils::getDoctrineFiCoreByEm($paricevuti, $doctrine);
51
52 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...
53 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...
54 19
        $modellocolonne = array();
55 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...
56
57 19
        GrigliaColonneUtils::getColonne($nomicolonne, $modellocolonne, $indice, $paricevuti);
58
59
        /* Controlla se alcune colonne devono essere dei link */
60 19
        GrigliaExtraFunzioniUtils::getColonneLink($paricevuti, $modellocolonne);
61
62
        /* Controlla se ci sono dei campi extra da inserire in griglia
63
          (i campi extra non sono utilizzabili come filtri nella filtertoolbar della griglia) */
64 19
        GrigliaCampiExtraUtils::getCampiExtraTestataPerGriglia($paricevuti, $indice, $nomicolonne, $modellocolonne);
65
66 19
        GrigliaUtils::getOpzioniTabella($doctrineficore, $nometabella, $testata);
67
68 19
        GrigliaUtils::getPermessiTabella($paricevuti, $testata);
69
70 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...
71 19
        $testata['modellocolonne'] = GrigliaUtils::getModelloColonne($modellocolonne);
72
73 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...
74 19
        $testata['nomebundle'] = $nomebundle;
75 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...
76
77 19
        $response = new GridTestata($testata);
78 19
        return $response->getResponse();
79
    }
80
81
    /**
82
     * Questa funzione è compatibile con jqGrid e risponde con un formato JSON contenente
83
     * i dati di risposta sulla base dei parametri passati.
84
     *
85
     * @param array  $parametri
86
     * <pre>object $parametri["request"]        oggetto che contiene il POST passato alla griglia</pre>
87
     * <pre>string $parametri["nometabella"]   Nome della tabella</pre>
88
     * <pre>array  $parametri["tabellej"]       array contenente tutte le tabelle per le quali richiedere
89
     *                                           la join a partire da $paricevuti[nometabella]</pre>
90
     * <pre>array  $parametri["escludere"]      array contenente tutti i campi che non devono essere restituiti</pre>
91
     * <pre>bool   $parametri["nospan"]         se true non imposta limit e offset</pre>
92
     * <pre>array  $parametri["parametri_link"] array contenente le colonne che devono essere rappresentate
93
     *                                           come dei link e relativi parametri per comporre l'href.
94
     *                                           Da non confondere con colonne_link che si passa a
95
     *                                           testataPerGriglia, perchè QUESTO array genera un
96
     *                                           tag <href> interno alla colonna per il quale si
97
     *                                           possono specificare le parti che lo compongono</pre>
98
     * <pre>array  $parametri["decodifiche"]    = array contenente eventuali decodifiche dei valori di
99
     *                                           una colonna che non può essere tradotta con una join
100
     *                                           ad una tabella</pre>
101
     * <pre>string $parametri["output"]         : "index" se i dati servono per la griglia dell'index, "stampa" se i dati servono per la stampa</pre>
102
     *
103
     * @return array in formato JSON con i dati richiesti
104
     */
105 5
    public function datiPerGriglia($parametri = [])
106
    {
107 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...
108 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...
109 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...
110 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...
111 5
        $nometabella = $parametri['nometabella'];
112
113 5
        $gestionepermessi = $container->get('ficorebundle.gestionepermessi');
114 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...
115 5
        if (!$canRead) {
116
            throw new AccessDeniedException("Non si hanno i permessi per visualizzare questo contenuto, controllare i permessi dell'utente");
117
        }
118
119 5
        $tabellej = GrigliaDatiUtils::getTabellejNormalizzate($parametri);
120
121 5
        $campiextra = GrigliaDatiUtils::getDatiCampiExtra($parametri);
122
        /* inserisco i filtri passati in un vettore */
123
124
        /* inserisco i parametri che sono passati nella $request all'interno di
125
          apposite variabili in che pagina siamo */
126
        /* direzione dell'ordinamento */
127 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...
128 5
        $page = $request->get('page'); // get the requested page
129
        /* quante righe restituire (in caso di nospan = false) */
130 5
        $limit = $request->get('rows'); // get how many rows we want to have into the grid
131
        /* su quale campo fare l'ordinamento */
132 5
        $sidx = $request->get('sidx'); // get index row - i.e. user click to sort
133 5
        GrigliaDatiUtils::getDatiOrdinamento($sidx, $nometabella);
134
        /* inizia la query */
135 5
        $entityName = $bundle . ':' . $nometabella;
136 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...
137 5
        $q->select($nometabella)
138 5
                ->from($entityName, $nometabella);
139
140
        /* scorre le tabelle collegate e crea la leftjoin usando come alias il nome stesso della tabella */
141 5
        if (isset($tabellej)) {
142 3
            GrigliaDatiUtils::setTabelleJoin($q, array('tabellej' => $tabellej, 'nometabella' => $nometabella));
143 3
        }
144
145 5
        GrigliaUtils::init();
146
147
        /* se ci sono delle precondizioni le imposta qui */
148 5
        GrigliaDatiPrecondizioniUtils::setPrecondizioni($q, $parametri);
149
        
150
        /* scorro ogni singola regola */
151 5
        $quanti = 0;
152 5
        GrigliaDatiMultiUtils::prepareQuery($parametri, $q, $sidx, $sord, $page, $limit, $quanti);
153
154 5
        $total_pages = GrigliaDatiMultiUtils::getTotalPages($quanti, $limit);
155
156
        /* imposta in $vettorerisposta la risposta strutturata per essere compresa da jqgrid */
157 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...
158 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...
159 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...
160 5
        $vettorerisposta['records'] = $quanti;
161 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...
162 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...
163
164 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...
165 5
        $escludereutente = GrigliaParametriUtils::getDatiEscludereDaTabella($parametri);
166 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...
167 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...
168
169 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...
170 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...
171 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...
172 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...
173 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...
174
175
        /* Si scorrono tutti i records della query */
176 5
        foreach ($q as $singolo) {
177
            /* Si scorrono tutti i campi del record */
178 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...
179 5
            $indicecolonna = 0;
180 5
            foreach ($singolo as $nomecampo => $singolocampo) {
181 5
                GrigliaDatiMultiUtils::buildDatiGriglia(
182 5
                    $parametri,
183 5
                    $vettoreriga,
184 5
                    $singolo,
185 5
                    $nomecampo,
186 5
                    $indice,
187 5
                    $indicecolonna,
188
                    $singolocampo
189 5
                );
190 5
            }
191
192 5
            GrigliaCampiExtraUtils::getCampiExtraDatiPerGriglia($campiextra, $vettoreriga, $doctrine, $entityName, $singolo);
193
194 5
            GrigliaDatiMultiUtils::buildRowGriglia($singolo, $vettoreriga, $vettorerisposta);
195 5
        }
196 5
        $response = new GridDati($vettorerisposta);
197 5
        return $response->getResponse();
198
    }
199
}
200