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

Begin::init()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace yentu\database;
4
5
use yentu\database\ItemType;
6
7
/**
8
 * Allows the
9
 */
10
class Begin extends DatabaseItem
11
{
12
    private Schema $defaultSchema;
13
14
    public function __construct(Schema $defaultSchema)
15
    {
16
        $this->defaultSchema = $defaultSchema;
17
    }
18
19
    public function table($name)
20
    {
21
        return $this->factory->create(ItemType::Table, $name, $this);
22
    }
23
24
    public function schema($name)
25
    {
26
        return $this->create('schema', $name, $this);
0 ignored issues
show
Bug introduced by
The method create() does not exist on yentu\database\Begin. 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

26
        return $this->/** @scrutinizer ignore-call */ create('schema', $name, $this);
Loading history...
27
    }
28
29
    public function view($name)
30
    {
31
        return $this->create('view', $name, $this);
32
    }
33
34
    public function getName()
35
    {
36
        return $this->defaultSchema->getName();
37
    }
38
39
    #[\Override]
40
    protected function buildDescription()
41
    {
42
    }
43
44
    public function end()
45
    {
46
        //DatabaseItem::purge();
47
    }
48
49
    public function query($query, $bindData = array())
50
    {
51
        return $this->create('query', $query, $bindData);
52
    }
53
54
    #[\Override]
55
    public function init()
56
    {
57
        
58
    }
59
}
60