1 | <?php |
||
21 | class UsersMigrationController extends Controller |
||
22 | { |
||
23 | /** |
||
24 | * Show users migration. |
||
25 | * |
||
26 | * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View |
||
27 | */ |
||
28 | public function index() |
||
34 | |||
35 | /** |
||
36 | * Get total number of users in source migration database. |
||
37 | */ |
||
38 | public function totalNumberOfUsers() |
||
43 | |||
44 | /** |
||
45 | * Get total number of migrated users in source migration database. |
||
46 | * |
||
47 | * @return array |
||
48 | */ |
||
49 | public function totalNumberOfMigratedUsers() |
||
56 | |||
57 | /** |
||
58 | * Get total number of users in source migration database. |
||
59 | */ |
||
60 | public function totalNumberOfUsersOnDestination() |
||
65 | |||
66 | /** |
||
67 | * @return array |
||
68 | */ |
||
69 | public function totalNumberOfMigratedUsersOnDestination() |
||
74 | |||
75 | /** |
||
76 | * Check connection. |
||
77 | * |
||
78 | * @return array |
||
79 | */ |
||
80 | public function checkConnection(Request $request) |
||
89 | |||
90 | /** |
||
91 | * Migrate multiple users. |
||
92 | * |
||
93 | */ |
||
94 | public function migrate(UsersMigrationRequest $request, MigrationBatch $batchService) |
||
107 | |||
108 | /** |
||
109 | * Clear user migrations job queue. |
||
110 | * |
||
111 | */ |
||
112 | protected function clearUserMigrationsJobsQueue() { |
||
115 | |||
116 | /** |
||
117 | * Stop migration batch request. |
||
118 | */ |
||
119 | public function stopMigration(StopMigrationBatchRequest $request) |
||
127 | |||
128 | /** |
||
129 | * Resume migration. |
||
130 | */ |
||
131 | public function resumeMigration() |
||
136 | |||
137 | /** |
||
138 | * Resume migration batch |
||
139 | */ |
||
140 | protected function resumeMigrationBatch() |
||
144 | |||
145 | /** |
||
146 | * Get users migration history. |
||
147 | * |
||
148 | * @return array |
||
149 | */ |
||
150 | public function history() |
||
155 | |||
156 | /** |
||
157 | * Get users migration batch history. |
||
158 | * |
||
159 | * @return array |
||
160 | */ |
||
161 | public function batchHistory() |
||
166 | |||
167 | /** |
||
168 | * Get users to migrate by request. |
||
169 | * |
||
170 | * @param $request |
||
171 | * @return \Illuminate\Database\Eloquent\Collection|void|static[] |
||
172 | */ |
||
173 | protected function usersToMigrateByRequest($request) |
||
180 | |||
181 | /** |
||
182 | * Users to migrate by user id list. |
||
183 | * |
||
184 | * @param $users |
||
185 | */ |
||
186 | protected function usersToMigrate($users, $request) |
||
190 | |||
191 | /** |
||
192 | * Switch default connection. |
||
193 | * |
||
194 | * @param $connection |
||
195 | * @param $env |
||
196 | */ |
||
197 | protected function switchConnection($env,$connection) |
||
201 | |||
202 | /** |
||
203 | * Dump current connection. |
||
204 | */ |
||
205 | protected function dumpCurrentConnection() |
||
209 | |||
210 | /** |
||
211 | * Users to migrate by filter. |
||
212 | * |
||
213 | * @param $filter |
||
214 | */ |
||
215 | protected function usersToMigrateByFilter($filter, $request) |
||
219 | |||
220 | /** |
||
221 | * Get all valid users. |
||
222 | * |
||
223 | * @param $request |
||
224 | * @return \Illuminate\Database\Eloquent\Collection|static[] |
||
225 | */ |
||
226 | protected function allUsers($request) |
||
230 | |||
231 | /** |
||
232 | * Get all pending users to migrate. |
||
233 | * |
||
234 | * @param $request |
||
235 | * @return \Illuminate\Database\Eloquent\Collection|static[] |
||
236 | */ |
||
237 | protected function pendingUsersToMigrate($request) |
||
244 | |||
245 | } |
||
246 |
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.