Failed Conditions
Pull Request — master (#919)
by Asmir
02:58
created

Query::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
nc 1
nop 3
dl 0
loc 5
ccs 4
cts 4
cp 1
crap 1
rs 10
c 1
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\Migrations\Query;
6
7
/**
8
 * The Query wraps the sql query, parameters and types.
9
 */
10
final class Query
11
{
12
    /** @var string */
13
    private $statement;
14
15
    /** @var mixed[] */
16
    private $parameters;
17
18
    /** @var mixed[] */
19
    private $types;
20
21
    /**
22
     * @param mixed[] $parameters
23
     * @param mixed[] $types
24
     */
25 25
    public function __construct(string $statement, array $parameters = [], array $types = [])
26
    {
27 25
        $this->statement  = $statement;
28 25
        $this->parameters = $parameters;
29 25
        $this->types      = $types;
30 25
    }
31
32 2
    public function __toString() : string
33
    {
34 2
        return $this->statement;
35
    }
36
37 11
    public function getStatement() : string
38
    {
39 11
        return $this->statement;
40
    }
41
42
    /** @return mixed[] */
43 10
    public function getParameters() : array
44
    {
45 10
        return $this->parameters;
46
    }
47
48
    /** @return mixed[] */
49 10
    public function getTypes() : array
50
    {
51 10
        return $this->types;
52
    }
53
}
54