Total Complexity | 4 |
Total Lines | 29 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
6 | class RenameRelatedlistWidgetClass extends Migration |
||
7 | { |
||
8 | /** |
||
9 | * Run the migrations. |
||
10 | * |
||
11 | * @return void |
||
12 | */ |
||
13 | public function up() |
||
14 | { |
||
15 | $widgets = Widget::where('class', 'Uccello\Core\Widgets\Relatedlist')->get(); |
||
16 | |||
17 | foreach ($widgets as $widget) { |
||
18 | $widget->class = 'Uccello\Core\Widgets\RelatedlistWidget'; |
||
|
|||
19 | $widget->save(); |
||
20 | } |
||
21 | } |
||
22 | |||
23 | /** |
||
24 | * Reverse the migrations. |
||
25 | * |
||
26 | * @return void |
||
27 | */ |
||
28 | public function down() |
||
35 | } |
||
36 | } |
||
38 |
Checks if undeclared accessed properties appear in database migrations and if the creating migration is correct.