Test Failed
Push — master ( 68289f...b25dc9 )
by huang
03:32
created

Migration::dateSet()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 2
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * @author    jan huang <[email protected]>
4
 * @copyright 2016
5
 *
6
 * @link      https://www.github.com/janhuang
7
 * @link      http://www.fast-d.cn/
8
 */
9
10
namespace FastD\Model;
11
12
13
use Phinx\Db\Table;
14
use Phinx\Migration\AbstractMigration;
15
16
/**
17
 * Class Migration
18
 * @package FastD\Model
19
 */
20
abstract class Migration extends AbstractMigration
21
{
22
    /**
23
     *
24
     */
25
    public function change()
26
    {
27
        $table = $this->setUp();
28
        if (!$table->exists()) {
29
            $table->create();
30
        }
31
        $this->dataSet($table);
32
    }
33
34
    /**
35
     * @return Table
36
     */
37
    abstract public function setUp();
38
39
    /**
40
     * @param Table $table
41
     * @return mixed
42
     */
43
    abstract public function dataSet(Table $table);
44
}