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

Query   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 4
dl 0
loc 17
ccs 0
cts 10
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A execute() 0 4 1
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
}