Test Setup Failed
Push — master ( 7d63a7...ae062b )
by Php Easy Api
04:30
created

WizardAlterGroup   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 54
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 54
rs 10
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A addColumn() 0 3 1
A change() 0 3 1
A dropWizardAlterInstance() 0 5 1
A dropColumn() 0 3 1
A getWizardAlterInstance() 0 5 1
1
<?php
2
3
namespace Migratio\GrammarStructure\Mysql\Wizard;
4
5
use Migratio\Contract\NameContract;
6
use Migratio\Contract\WizardAlterContract;
7
use Migratio\Contract\WizardAlterGroupContract;
8
9
class WizardAlterGroup extends Wizard implements WizardAlterGroupContract
10
{
11
    /**
12
     * add column
13
     * 
14
     * @return WizardAlterContract
15
     */
16
    public function addColumn()
17
    {
18
        return $this->getWizardAlterInstance(__FUNCTION__);
19
    }
20
21
    /**
22
     * drop column
23
     * 
24
     * @return NameContract
25
     */
26
    public function dropColumn()
27
    {
28
        return $this->dropWizardAlterInstance(__FUNCTION__);
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->dropWizard...rInstance(__FUNCTION__) returns the type Migratio\GrammarStructur...Wizard\WizardAlterGroup which is incompatible with the documented return type Migratio\Contract\NameContract.
Loading history...
29
    }
30
31
    /**
32
     * change column
33
     * 
34
     * @return WizardAlterContract
35
     */
36
    public function change()
37
    {
38
        return $this->getWizardAlterInstance(__FUNCTION__);
39
    }
40
41
    /**
42
     * get wizard alter instance
43
     * 
44
     * @param $group
45
     * @return WizardAlter
46
     */
47
    private function getWizardAlterInstance($group)
48
    {
49
        $this->setAlterType('group',$group);
50
51
        return new WizardAlter($this);
52
    }
53
54
    /**
55
     * @param $group
56
     * @return $this
57
     */
58
    private function dropWizardAlterInstance($group)
59
    {
60
        $this->setAlterType('group',$group);
61
62
        return $this;
63
    }
64
}
65
66