Conditions | 7 |
Paths | 11 |
Total Lines | 32 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 20.0204 |
Changes | 0 |
1 | <?php |
||
15 | public function run(Registry $registry): Registry |
||
16 | { |
||
17 | foreach ($registry as $entity) { |
||
18 | if (!$registry->hasTable($entity)) { |
||
19 | continue; |
||
20 | 16 | } |
|
21 | |||
22 | 16 | $schema = $registry->getTableSchema($entity); |
|
23 | 16 | if ($schema->exists()) { |
|
24 | $state = $schema->getState(); |
||
25 | |||
26 | // clean up all indexes and columns |
||
27 | 16 | foreach ($state->getForeignKeys() as $fk) { |
|
28 | 16 | $state->forgerForeignKey($fk); |
|
|
|||
29 | } |
||
30 | |||
31 | // clean up all indexes and columns |
||
32 | foreach ($state->getColumns() as $column) { |
||
33 | $state->forgetColumn($column); |
||
34 | } |
||
35 | |||
36 | foreach ($state->getIndexes() as $index) { |
||
37 | $state->forgetIndex($index); |
||
38 | } |
||
39 | |||
40 | $state->setPrimaryKeys([]); |
||
41 | |||
42 | $schema->setState($state); |
||
43 | } |
||
44 | } |
||
45 | |||
46 | return $registry; |
||
47 | } |
||
49 |
This function has been deprecated. The supplier of the function has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.