Passed
Pull Request — master (#7184)
by
unknown
15:43
created

Between   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 35
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __toString() 0 3 1
A __construct() 0 6 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
    /** @var string */
14
    private $operator;
15
16
    /** @var int|string */
17
    private $key;
18
19
    /** @var int|string */
20
    private $min;
21
22
    /** @var int|string */
23
    private $max;
24
25
    /**
26
     * @param string     $operator
27
     * @param int|string $key
28
     * @param int|string $min
29
     * @param int|string $max
30
     */
31 2
    public function __construct($operator, $key, $min, $max)
32
    {
33 2
        $this->operator = $operator;
34 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...
35 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...
36 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...
37 2
    }
38
39 2
    public function __toString() : string
40
    {
41 2
        return $this->key. ' ' . $this->operator . ' ' . $this->min . ' AND ' .  $this->max;
0 ignored issues
show
Coding Style introduced by
Concat operator must be surrounded by a single space
Loading history...
42
    }
43
}
44