Cancelled
Push — develop ( b29d56...9d84c2 )
by Andrea
15:15 queued 14s
created

operatorToString()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 16
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 13
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 13
nc 1
nop 1
dl 0
loc 16
ccs 13
cts 13
cp 1
crap 1
rs 9.8333
c 0
b 0
f 0
1
<?php
2
3
namespace Cdf\BiCoreBundle\Utils\Tabella;
4
5
//use Doctrine\ORM\QueryBuilder;
6
use Doctrine\Common\Collections\Expr\Comparison;
7
use Doctrine\ORM\Query\Expr;
8
9
class BaseParametriQueryTabellaDecoder
10
{
11
12
    protected $fieldname;
13
    protected $fieldoperator;
14
    protected $fieldvalue;
15
    protected $fieldqueryparameter;
16
    protected $criteria;
17
    protected $parameters;
18
19 3
    public function __construct($fieldname, $fieldoperator, $fieldvalue, $fieldqueryparameter, $fieldinfo)
20
    {
21 3
        $this->fieldname = $fieldname;
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...
22 3
        $this->fieldoperator = $fieldoperator;
23 3
        if (is_string($fieldvalue)) {
24 2
            $this->fieldvalue = urldecode($fieldvalue);
25
        } else {
26 3
            $this->fieldvalue = $fieldvalue;
27
        }
28 3
        $this->fieldqueryparameter = $fieldqueryparameter;
29 3
        $this->fieldinfo = $fieldinfo;
0 ignored issues
show
Bug Best Practice introduced by
The property fieldinfo does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 11 spaces but found 1 space

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

To visualize

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

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

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

will produce no issues.

Loading history...
30 3
        $this->parameters = array();
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...
31 3
        $this->buildQuery();
0 ignored issues
show
introduced by
The method buildQuery() does not exist on Cdf\BiCoreBundle\Utils\T...etriQueryTabellaDecoder. Maybe you want to declare this class abstract? ( Ignorable by Annotation )

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

31
        $this->/** @scrutinizer ignore-call */ 
32
               buildQuery();
Loading history...
32 3
    }
33
34 3
    public function getQueryCriteria()
35
    {
36 3
        return $this->criteria;
37
    }
38
39 3
    public function getQueryParameters()
40
    {
41 3
        return $this->parameters;
42
    }
43
44 2
    public function getDescrizioneFiltro()
45
    {
46 2
        $descrizionevalore = '';
47
48
        switch (true) {
49 2
            case $this->getDescrizioneFiltroIsNull($descrizionevalore):
50 1
                break;
51 2
            case $this->getDescrizioneFiltroDecodifiche($descrizionevalore):
52
                break;
53 2
            case $this->getDescrizioneFiltroBoolean($descrizionevalore):
54 1
                break;
55 1
            case $this->getDescrizioneFiltroDate($descrizionevalore):
56 1
                break;
57 1
            case $this->getDescrizioneFiltroArray($descrizionevalore):
58 1
                break;
59 1
            case $this->getDescrizioneFiltroString($descrizionevalore):
60 1
                break;
61
            default:
62 1
                $this->getDescrizioneFiltroAltro($descrizionevalore);
63 1
                break;
64
        }
65 2
        $nomecampo = substr($this->fieldname, stripos($this->fieldname, '.') + 1);
66 2
        $filtro = $nomecampo . " " . $this->operatorToString($this->fieldoperator) . " " . $descrizionevalore;
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 4 spaces but found 1 space

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

To visualize

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

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

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

will produce no issues.

Loading history...
Coding Style Comprehensibility introduced by
The string literal 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...
67
68 2
        return $filtro;
69
    }
70
71 1
    protected function getDescrizioneFiltroAltro(&$descrizionevalore)
72
    {
73 1
        if ($descrizionevalore == "") {
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...
74 1
            $descrizionevalore = "'" . $this->fieldvalue . "'";
75
        }
76 1
    }
77
78 1
    protected function getDescrizioneFiltroDate(&$descrizionevalore)
79
    {
80 1
        $trovato = false;
81 1
        if ($this->fieldinfo["tipocampo"] == 'date') {
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal tipocampo 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...
82 1
            if (is_a($this->fieldvalue, "\DateTime")) {
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal \DateTime 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...
83 1
                $descrizionevalore = $this->fieldvalue->format("d/m/Y");
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal d/m/Y 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...
84
            } else {
85 1
                $descrizionevalore = \DateTime::createFromFormat("Y-m-d", $this->fieldvalue)->format("d/m/Y");
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal Y-m-d does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
Coding Style Comprehensibility introduced by
The string literal d/m/Y 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...
86
            }
87 1
            $trovato = true;
88
        }
89 1
        if ($this->fieldinfo["tipocampo"] == 'datetime') {
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal tipocampo 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...
90 1
            if (is_a($this->fieldvalue, "\DateTime")) {
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal \DateTime 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...
91 1
                $descrizionevalore = $this->fieldvalue->format("d/m/Y H:i:s");
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal d/m/Y H:i:s 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...
92
            } else {
93
                $descrizionevalore = \DateTime::createFromFormat("Y-m-d", $this->fieldvalue)->format("d/m/Y");
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal Y-m-d does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
Coding Style Comprehensibility introduced by
The string literal d/m/Y 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...
94
            }
95 1
            $trovato = true;
96
        }
97 1
        return $trovato;
98
    }
99
100 1
    protected function getDescrizioneFiltroString(&$descrizionevalore)
101
    {
102 1
        $trovato = false;
103 1
        if (is_string($this->fieldvalue)) {
104 1
            $descrizionevalore = $descrizionevalore = "'" . $this->fieldvalue . "'";
105 1
            $trovato = true;
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 11 spaces but found 1 space

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

To visualize

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

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

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

will produce no issues.

Loading history...
106
        }
107 1
        return $trovato;
108
    }
109
110 2
    protected function getDescrizioneFiltroDecodifiche(&$descrizionevalore)
111
    {
112 2
        $trovato = false;
113 2
        if (isset($this->fieldinfo["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...
114
            $decodifiche = $this->fieldinfo["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...
115
            if ($decodifiche) {
116
                if (is_array($this->fieldvalue)) {
117
                    foreach ($this->fieldvalue as $value) {
118
                        $descrizionevalore = $descrizionevalore . "'" . $decodifiche[$value] . "', ";
119
                    }
120
                } else {
121
                    if (isset($decodifiche[$this->fieldvalue])) {
122
                        $descrizionevalore = $descrizionevalore = "'" . $decodifiche[$this->fieldvalue] . "'";
123
                    } else {
124
                        $descrizionevalore = $descrizionevalore = "'" . $this->fieldvalue . "'";
125
                    }
126
                }
127
                $trovato = true;
128
            }
129
        }
130 2
        return $trovato;
131
    }
132
133 2
    protected function getDescrizioneFiltroIsNull(&$descrizionevalore)
134
    {
135 2
        $trovato = false;
136 2
        if (is_null($this->fieldvalue)) {
137 1
            $descrizionevalore = "(vuoto)";
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal (vuoto) 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...
138 1
            $trovato = true;
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 11 spaces but found 1 space

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

To visualize

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

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

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

will produce no issues.

Loading history...
139
        }
140 2
        return $trovato;
141
    }
142
143 2
    protected function getDescrizioneFiltroBoolean(&$descrizionevalore)
144
    {
145 2
        $trovato = false;
146 2
        if (is_bool($this->fieldvalue)) {
147 1
            $descrizionevalore = $this->fieldvalue ? "SI" : "NO";
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal SI does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
Coding Style Comprehensibility introduced by
The string literal NO 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...
148 1
            $trovato = true;
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 11 spaces but found 1 space

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

To visualize

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

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

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

will produce no issues.

Loading history...
149
        }
150 2
        return $trovato;
151
    }
152
153 1
    protected function getDescrizioneFiltroArray(&$descrizionevalore)
154
    {
155 1
        $trovato = false;
156 1
        if (is_array($this->fieldvalue)) {
157 1
            foreach ($this->fieldvalue as $value) {
158 1
                if (is_numeric($value)) {
159 1
                    $descrizionevalore = $descrizionevalore . ", " . $value;
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...
160
                } else {
161
                    $descrizionevalore = $descrizionevalore . "'" . $value . "', ";
162
                }
163 1
                $trovato = true;
164
            }
165 1
            $descrizionevalore = substr($descrizionevalore, 0, -2);
166
        }
167 1
        return $trovato;
168
    }
169
170 2
    protected function operatorToString($operator)
171
    {
172
        $decoder = array(
173 2
            Comparison::LT=>'minore di',
174 2
            Comparison::LTE=>'minore o uguale di',
175 2
            Comparison::GT=>'maggiore di',
176 2
            Comparison::GTE=>'maggiore o uguale di',
177 2
            Comparison::CONTAINS=>'contiene',
178 2
            Comparison::STARTS_WITH=>'inizia con',
179 2
            Comparison::ENDS_WITH=>'finisce con',
180 2
            Comparison::IN=>'compreso tra',
181 2
            Comparison::NIN=>'non compreso tra',
182 2
            Comparison::EQ=>'uguale a',
183 2
            Comparison::NEQ=>'diverso da',
184
            );
185 2
        return $decoder[$operator];
186
    }
187
}
188