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