| Total Complexity | 3 |
| Total Lines | 60 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | abstract class Migration extends Core |
||
| 8 | { |
||
| 9 | |||
| 10 | /** |
||
| 11 | * container |
||
| 12 | * |
||
| 13 | * @var Container |
||
| 14 | */ |
||
| 15 | protected $container; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * instanciate |
||
| 19 | * |
||
| 20 | * @param Container $container |
||
| 21 | */ |
||
| 22 | 1 | public function __construct(Container $container) |
|
| 23 | { |
||
| 24 | 1 | parent::__construct($container); |
|
| 25 | } |
||
| 26 | |||
| 27 | /** |
||
| 28 | * run migration for a given repository |
||
| 29 | * |
||
| 30 | * @return Migration |
||
| 31 | */ |
||
| 32 | 1 | public function migrate(): Migration |
|
| 38 | } |
||
| 39 | |||
| 40 | /** |
||
| 41 | * check if migration can run |
||
| 42 | * |
||
| 43 | * @return boolean |
||
| 44 | */ |
||
| 45 | abstract protected function canMigrate(): bool; |
||
| 46 | |||
| 47 | /** |
||
| 48 | * process create table |
||
| 49 | * |
||
| 50 | * @return string |
||
| 51 | */ |
||
| 52 | abstract protected function runCreate(): Migration; |
||
| 53 | |||
| 54 | /** |
||
| 55 | * process insert into table |
||
| 56 | * |
||
| 57 | * @return string |
||
| 58 | */ |
||
| 59 | abstract protected function runInsert(): Migration; |
||
| 60 | |||
| 61 | /** |
||
| 62 | * process alter index table |
||
| 63 | * |
||
| 64 | * @return string |
||
| 65 | */ |
||
| 66 | abstract protected function runIndex(): Migration; |
||
| 67 | } |
||
| 68 |