Completed
Pull Request — master (#7184)
by
unknown
18:39
created

Between::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 4
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
ccs 5
cts 5
cp 1
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\ORM\Query\Expr;
6
7
final class Between
8
{
9
    public const NOT_BETWEEN = 'NOT BETWEEN';
10
11
    public const BETWEEN = 'BETWEEN';
12
13
    /**
0 ignored issues
show
introduced by
Found multi-line comment for property \Doctrine\ORM\Query\Expr\Between::$operator with single line content, use one-line comment instead.
Loading history...
14
     * @var string
15
     */
16
    private $operator;
17
18
    /**
0 ignored issues
show
introduced by
Found multi-line comment for property \Doctrine\ORM\Query\Expr\Between::$key with single line content, use one-line comment instead.
Loading history...
19
     * @var int|string
20
     */
21
    private $key;
22
23
    /**
0 ignored issues
show
introduced by
Found multi-line comment for property \Doctrine\ORM\Query\Expr\Between::$min with single line content, use one-line comment instead.
Loading history...
24
     * @var int|string
25
     */
26
    private $min;
27
28
    /**
0 ignored issues
show
introduced by
Found multi-line comment for property \Doctrine\ORM\Query\Expr\Between::$max with single line content, use one-line comment instead.
Loading history...
29
     * @var int|string
30
     */
31
    private $max;
32
33
    /**
34
     * @param string     $operator
0 ignored issues
show
introduced by
Method \Doctrine\ORM\Query\Expr\Between::__construct() has useless @param annotation for parameter $operator.
Loading history...
35
     * @param int|string $key
36
     * @param int|string $min
37
     * @param int|string $max
38
     */
39 2
    public function __construct(string $operator, $key, $min, $max)
40
    {
41 2
        $this->operator = $operator;
42 2
        $this->key = $key;
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...
43 2
        $this->min = $min;
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...
44 2
        $this->max = $max;
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...
45 2
    }
46
47 2
    public function __toString() : string
48
    {
49 2
        return sprintf('%s %s %s AND %s', $this->key, $this->operator, $this->min, $this->max);
0 ignored issues
show
introduced by
Function sprintf() should not be referenced via a fallback global name, but via a use statement.
Loading history...
50
    }
51
}
52