Skip to content

Conversation

christianbeeznest
Copy link
Contributor

No description provided.

->execute()
->fetchOne();

$progress_percentage = 0;

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;

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

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

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,

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

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

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

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

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

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

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