-
Notifications
You must be signed in to change notification settings - Fork 481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Internal: Improve migration process from install page #5771
Internal: Improve migration process from install page #5771
Conversation
->execute() | ||
->fetchOne(); | ||
|
||
$progress_percentage = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variable "progress_percentage" is not in valid camel caps format
|
||
$progress_percentage = 0; | ||
if ($totalMigrations > 0) { | ||
$progress_percentage = ($executedMigrations / $totalMigrations) * 100; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variable "progress_percentage" is not in valid camel caps format
$progress_percentage = ($executedMigrations / $totalMigrations) * 100; | ||
} | ||
|
||
$current_migration = $connection->createQueryBuilder() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variable "current_migration" is not in valid camel caps format
->fetchOne(); | ||
|
||
return [ | ||
'progress_percentage' => ceil($progress_percentage), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variable "progress_percentage" is not in valid camel caps format
|
||
return [ | ||
'progress_percentage' => ceil($progress_percentage), | ||
'current_migration' => $current_migration, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variable "current_migration" is not in valid camel caps format
* | ||
* @return EntityManager The initialized EntityManager | ||
*/ | ||
function initializeEntityManager(): EntityManager |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider putting global function "initializeEntityManager" in a static class
* | ||
* @return bool True if the version table is valid, false otherwise | ||
*/ | ||
function isVersionTableValid($connection): bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider putting global function "isVersionTableValid" in a static class
* | ||
* @return string The last executed migration version | ||
*/ | ||
function getLastExecutedMigration(Connection $connection): string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider putting global function "getLastExecutedMigration" in a static class
->orderBy('executed_at', 'DESC') | ||
->setMaxResults(1); | ||
$result = $query->execute()->fetchAssociative(); | ||
return $result['version'] ?? ''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing blank line before return statement
* | ||
* @return array The result status of the migration | ||
*/ | ||
function executeMigration(): array |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider putting global function "executeMigration" in a static class
Code Climate has analyzed commit d722954 and detected 57 issues on this pull request. Here's the issue category breakdown:
View more on Code Climate. |
No description provided.