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

Query   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 11
c 1
b 0
f 0
dl 0
loc 42
ccs 13
cts 13
cp 1
rs 10
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getTypes() 0 3 1
A getStatement() 0 3 1
A getParameters() 0 3 1
A __toString() 0 3 1
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