1 | <?php |
||
11 | class Migrator |
||
12 | { |
||
13 | /** @var \Wandu\Database\Contracts\Migrator\MigrateAdapterInterface */ |
||
14 | protected $adapter; |
||
15 | |||
16 | /** @var \Wandu\Database\Migrator\Configuration */ |
||
17 | protected $config; |
||
18 | |||
19 | /** @var \Wandu\DI\ContainerInterface */ |
||
20 | protected $container; |
||
21 | |||
22 | /** |
||
23 | * @param \Wandu\Database\Contracts\Migrator\MigrateAdapterInterface $adapter |
||
24 | * @param \Wandu\Database\Migrator\Configuration $config |
||
25 | * @param \Wandu\DI\ContainerInterface $container |
||
26 | */ |
||
27 | public function __construct(MigrateAdapterInterface $adapter, Configuration $config, ContainerInterface $container) |
||
33 | |||
34 | /** |
||
35 | * @return array|\Wandu\Database\Migrator\MigrationContainer[] |
||
36 | */ |
||
37 | public function migrations() |
||
45 | |||
46 | /** |
||
47 | * @param string $migrationId |
||
48 | * @return \Wandu\Database\Migrator\MigrationContainer |
||
49 | */ |
||
50 | public function migration($migrationId) |
||
59 | |||
60 | /** |
||
61 | * @param string $migrationId |
||
62 | */ |
||
63 | public function up($migrationId) |
||
75 | |||
76 | /** |
||
77 | * @param string $migrationId |
||
78 | */ |
||
79 | public function down($migrationId) |
||
91 | |||
92 | /** |
||
93 | * @return array|\Wandu\Database\Migrator\MigrationContainer[] |
||
94 | */ |
||
95 | public function migrate() |
||
107 | |||
108 | /** |
||
109 | * @return array |
||
110 | */ |
||
111 | protected function getAllMigrationFiles() |
||
126 | } |
||
127 |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)
or! empty(...)
instead.