Completed
Pull Request — master (#1)
by
unknown
08:32
created

Query::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 0
cts 6
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 2
crap 2
1
<?php
2
namespace Dazzle\PgSQL\Statement;
3
4
use Dazzle\PgSQL\Connection\ConnectorInterface;
5
use Dazzle\Promise\Deferred;
6
7
class Query extends Deferred implements Statement
8
{
9
    use StatementAwareTrait;
10
    use StatementHandlerTrait;
11
12
    public function __construct($sql, array $params = [])
13
    {
14
        parent::__construct();
15
        $this->sql = $sql;
16
        $this->params = $params;
17
    }
18
19
    public function execute(ConnectorInterface $connector)
20
    {
21
        return \pg_send_query_params($connector->getStream(), $this->getSQL(), $this->getParams());
22
    }
23
}