SQLQuery::getMappers()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
namespace mindplay\sql\model\query;
4
5
use mindplay\sql\framework\MapperProvider;
6
use mindplay\sql\model\components\Mappers;
7
use mindplay\sql\model\TypeProvider;
8
9
/**
10
 * This class represents a custom SQL Query.
11
 */
12
class SQLQuery extends Query implements MapperProvider
13
{
14
    use Mappers;
15
    
16
    private string $sql;
17
18
    /**
19
     * @param $sql SQL statement (with placeholders)
20
     */
21 1
    public function __construct(TypeProvider $types, string $sql)
22
    {
23 1
        parent::__construct($types);
24
        
25 1
        $this->sql = $sql;
26
    }
27
    
28 1
    public function getSQL(): string
29
    {
30 1
        return $this->sql;
31
    }
32
33
    /**
34
     * @inheritdoc
35
     */
36 1
    public function getMappers(): array
37
    {
38 1
        return $this->mappers;
39
    }
40
}
41