Passed
Push — main ( 3f5d4e...df4575 )
by James Ekow Abaka
01:53
created

Query::init()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 7
rs 10
1
<?php
2
namespace yentu\database;
3
4
class Query extends DatabaseItem
5
{
6
    private $results;
7
    private $query;
8
    private $bindData;
9
    
10
    public function __construct($query, $bindData = array()) 
11
    {
12
        $this->query = $query;
13
        $this->bindData = $bindData;
14
    }
15
    
16
    #[\Override]
17
    public function init()
18
    {
19
        $this->results = $this->getDriver()->executeQuery(
0 ignored issues
show
Bug introduced by
The method executeQuery() does not exist on yentu\ChangeLogger. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

19
        $this->results = $this->getDriver()->/** @scrutinizer ignore-call */ executeQuery(
Loading history...
20
            array(
21
                'query' => $this->query, 
22
                'bind' => $this->bindData
23
            )
24
        );
25
    }
26
    
27
    #[\Override]
28
    protected function buildDescription() 
29
    {
30
        return array();
31
    }
32
    
33
    public function reverse($query, $bindData = array())
34
    {
35
        $this->getDriver()->reverseQuery(array(
0 ignored issues
show
Bug introduced by
The method reverseQuery() does not exist on yentu\ChangeLogger. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

35
        $this->getDriver()->/** @scrutinizer ignore-call */ reverseQuery(array(
Loading history...
36
            'query' => $query,
37
            'bind_data' => $bindData
38
        ));
39
        return $this;
40
    }
41
}
42