Skip to content
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

Merged

Conversation

christianbeeznest
Copy link
Contributor

No description provided.

->execute()
->fetchOne();

$progress_percentage = 0;
Copy link

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;
Copy link

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()
Copy link

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),
Copy link

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,
Copy link

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
Copy link

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
Copy link

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
Copy link

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'] ?? '';
Copy link

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
Copy link

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

Copy link

codeclimate bot commented Sep 3, 2024

Code Climate has analyzed commit d722954 and detected 57 issues on this pull request.

Here's the issue category breakdown:

Category Count
Style 21
Clarity 11
Bug Risk 25

View more on Code Climate.

@christianbeeznest christianbeeznest merged commit e6188e7 into chamilo:master Sep 5, 2024
2 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant