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: Add session replication, reinscription logic, and child session hierarchy for course expiration - refs BT#22057 #5831

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

christianbeeznest
Copy link
Contributor

No description provided.

@@ -0,0 +1,185 @@
<?php

declare(strict_types=1);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a single space around assignment operators

use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Input\InputOption;

class ReinscriptionCheckCommand extends Command
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing class doc comment

private SessionRepository $sessionRepository;
private EntityManagerInterface $entityManager;

public function __construct(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing function doc comment

@@ -0,0 +1,205 @@
<?php

declare(strict_types=1);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a single space around assignment operators

use Symfony\Component\Mime\Email;
use Symfony\Contracts\Translation\TranslatorInterface;

class SessionRepetitionCommand extends Command
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing class doc comment

@@ -654,6 +641,11 @@ public static function getSessionsForAdmin(
)
)";
break;
case 'replication':
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CASE statements must be defined using a colon

{
$sessions = [];
$tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
$sql = "SELECT id, title FROM $tbl_session WHERE parent_id IS NULL ORDER BY title";
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variable "tbl_session" is not in valid camel caps format

private MailerInterface $mailer;
private TranslatorInterface $translator;

public function __construct(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing function doc comment

$newEndDate = (clone $newStartDate)->add($duration);

if ($debug) {
$output->writeln(sprintf('Duplicating session %d. New start date: %s, New end date: %s',
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opening parenthesis of a multi-line function call must be the last content on the line

@@ -380,6 +380,18 @@ class Session implements ResourceWithAccessUrlInterface, Stringable
#[Groups(['user_subscriptions:sessions', 'session:read', 'session:item:read'])]
private int $accessVisibility = 0;

#[ORM\Column(name: 'parent_id', type: 'integer', nullable: true)]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead.

@@ -380,6 +380,18 @@ class Session implements ResourceWithAccessUrlInterface, Stringable
#[Groups(['user_subscriptions:sessions', 'session:read', 'session:item:read'])]
private int $accessVisibility = 0;

#[ORM\Column(name: 'parent_id', type: 'integer', nullable: true)]
protected ?int $parentId = null;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line indented incorrectly; expected 8 spaces, found 4

#[ORM\Column(name: 'parent_id', type: 'integer', nullable: true)]
protected ?int $parentId = null;

#[ORM\Column(name: 'days_to_reinscription', type: 'integer', nullable: true)]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead.

protected ?int $parentId = null;

#[ORM\Column(name: 'days_to_reinscription', type: 'integer', nullable: true)]
protected ?int $daysToReinscription = null;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line indented incorrectly; expected 8 spaces, found 4

#[ORM\Column(name: 'days_to_reinscription', type: 'integer', nullable: true)]
protected ?int $daysToReinscription = null;

#[ORM\Column(name: 'last_repetition', type: 'boolean', nullable: false, options: ['default' => false])]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead.

protected ?int $daysToReinscription = null;

#[ORM\Column(name: 'last_repetition', type: 'boolean', nullable: false, options: ['default' => false])]
protected bool $lastRepetition = false;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line indented incorrectly; expected 8 spaces, found 4

#[ORM\Column(name: 'last_repetition', type: 'boolean', nullable: false, options: ['default' => false])]
protected bool $lastRepetition = false;

#[ORM\Column(name: 'days_to_new_repetition', type: 'integer', nullable: true)]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead.

protected bool $lastRepetition = false;

#[ORM\Column(name: 'days_to_new_repetition', type: 'integer', nullable: true)]
protected ?int $daysToNewRepetition = null;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line indented incorrectly; expected 8 spaces, found 4

@@ -446,7 +458,7 @@

public function getShowDescription(): bool
{
return $this->showDescription;
return $this->showDescription ?? false;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line indented incorrectly; expected at least 12 spaces, found 8

@@ -1474,6 +1486,54 @@
));
}

public function getParentId(): ?int
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line indented incorrectly; expected 8 spaces, found 4

@@ -1474,6 +1486,54 @@
));
}

public function getParentId(): ?int
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing function doc comment

return null;
}

}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The closing brace for the class must go on the next line after the body

@@ -1474,6 +1486,54 @@ public function getClosedOrHiddenCourses(): Collection
));
}

public function getParentId(): ?int
{
return $this->parentId;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line indented incorrectly; expected at least 12 spaces, found 8

return $this->parentId;
}

public function setParentId(?int $parentId): self
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line indented incorrectly; expected 8 spaces, found 4

return $this->parentId;
}

public function setParentId(?int $parentId): self
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing function doc comment


public function setParentId(?int $parentId): self
{
$this->parentId = $parentId;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line indented incorrectly; expected at least 12 spaces, found 8

@@ -0,0 +1 @@
<?php phpinfo(); ?>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A closing tag is not permitted at the end of a PHP file

@@ -0,0 +1 @@
<?php phpinfo(); ?>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A closing tag is not permitted at the end of a PHP file

return $this;
}

public function getDaysToReinscription(): ?int
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line indented incorrectly; expected 8 spaces, found 4

return $this;
}

public function getDaysToReinscription(): ?int
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing function doc comment


public function getDaysToReinscription(): ?int
{
return $this->daysToReinscription;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line indented incorrectly; expected at least 12 spaces, found 8

Copy link

codeclimate bot commented Dec 4, 2024

Code Climate has analyzed commit 7b66599 and detected 83 issues on this pull request.

Here's the issue category breakdown:

Category Count
Style 62
Clarity 17
Bug Risk 4

View more on Code Climate.

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