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

Begin   A

Complexity

Total Complexity 9

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 47
rs 10
wmc 9

9 Methods

Rating   Name   Duplication   Size   Complexity  
A schema() 0 3 1
A getName() 0 3 1
A table() 0 3 1
A __construct() 0 3 1
A view() 0 3 1
A query() 0 3 1
A init() 0 3 1
A buildDescription() 0 3 1
A end() 0 2 1
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