1 | <?php |
||
7 | abstract class Migration implements MigrationInterface |
||
8 | { |
||
9 | /** @var string */ |
||
10 | protected $connection = 'default'; |
||
11 | |||
12 | /** @var \Wandu\Database\Manager */ |
||
13 | protected $manager; |
||
14 | |||
15 | /** |
||
16 | * @param \Wandu\Database\Manager $manager |
||
17 | */ |
||
18 | public function __construct(Manager $manager) |
||
22 | |||
23 | /** |
||
24 | * {@inheritdoc} |
||
25 | */ |
||
26 | public function up() |
||
30 | |||
31 | /** |
||
32 | * {@inheritdoc} |
||
33 | */ |
||
34 | public function down() |
||
38 | |||
39 | /** |
||
40 | * @param \Wandu\Database\Contracts\ConnectionInterface $connection |
||
41 | */ |
||
42 | abstract public function migrate(ConnectionInterface $connection); |
||
43 | |||
44 | /** |
||
45 | * @param \Wandu\Database\Contracts\ConnectionInterface $connection |
||
46 | */ |
||
47 | abstract public function rollback(ConnectionInterface $connection); |
||
48 | } |
||
49 |
Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code: