-
Notifications
You must be signed in to change notification settings - Fork 486
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
base: master
Are you sure you want to change the base?
Conversation
…sion hierarchy for course expiration - refs BT#22057
…ctionality - refs BT#22057
@@ -0,0 +1,185 @@ | |||
<?php | |||
|
|||
declare(strict_types=1); |
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.
Add a single space around assignment operators
use Symfony\Component\Console\Output\OutputInterface; | ||
use Symfony\Component\Console\Input\InputOption; | ||
|
||
class ReinscriptionCheckCommand extends Command |
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 class doc comment
private SessionRepository $sessionRepository; | ||
private EntityManagerInterface $entityManager; | ||
|
||
public function __construct( |
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 function doc comment
@@ -0,0 +1,205 @@ | |||
<?php | |||
|
|||
declare(strict_types=1); |
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.
Add a single space around assignment operators
use Symfony\Component\Mime\Email; | ||
use Symfony\Contracts\Translation\TranslatorInterface; | ||
|
||
class SessionRepetitionCommand extends Command |
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 class doc comment
@@ -654,6 +641,11 @@ public static function getSessionsForAdmin( | |||
) | |||
)"; | |||
break; | |||
case 'replication': |
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.
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"; |
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 "tbl_session" is not in valid camel caps format
private MailerInterface $mailer; | ||
private TranslatorInterface $translator; | ||
|
||
public function __construct( |
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 function doc comment
$newEndDate = (clone $newStartDate)->add($duration); | ||
|
||
if ($debug) { | ||
$output->writeln(sprintf('Duplicating session %d. New start date: %s, New end date: %s', |
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.
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)] |
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.
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; |
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.
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)] |
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.
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; |
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.
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])] |
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.
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; |
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.
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)] |
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.
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; |
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.
Line indented incorrectly; expected 8 spaces, found 4
@@ -446,7 +458,7 @@ | |||
|
|||
public function getShowDescription(): bool | |||
{ | |||
return $this->showDescription; | |||
return $this->showDescription ?? false; |
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.
Line indented incorrectly; expected at least 12 spaces, found 8
@@ -1474,6 +1486,54 @@ | |||
)); | |||
} | |||
|
|||
public function getParentId(): ?int |
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.
Line indented incorrectly; expected 8 spaces, found 4
@@ -1474,6 +1486,54 @@ | |||
)); | |||
} | |||
|
|||
public function getParentId(): ?int |
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 function doc comment
…lidation - refs BT#22057
return null; | ||
} | ||
|
||
} |
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.
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; |
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.
Line indented incorrectly; expected at least 12 spaces, found 8
return $this->parentId; | ||
} | ||
|
||
public function setParentId(?int $parentId): self |
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.
Line indented incorrectly; expected 8 spaces, found 4
return $this->parentId; | ||
} | ||
|
||
public function setParentId(?int $parentId): self |
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 function doc comment
|
||
public function setParentId(?int $parentId): self | ||
{ | ||
$this->parentId = $parentId; |
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.
Line indented incorrectly; expected at least 12 spaces, found 8
@@ -0,0 +1 @@ | |||
<?php phpinfo(); ?> |
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.
A closing tag is not permitted at the end of a PHP file
@@ -0,0 +1 @@ | |||
<?php phpinfo(); ?> |
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.
A closing tag is not permitted at the end of a PHP file
return $this; | ||
} | ||
|
||
public function getDaysToReinscription(): ?int |
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.
Line indented incorrectly; expected 8 spaces, found 4
return $this; | ||
} | ||
|
||
public function getDaysToReinscription(): ?int |
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 function doc comment
|
||
public function getDaysToReinscription(): ?int | ||
{ | ||
return $this->daysToReinscription; |
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.
Line indented incorrectly; expected at least 12 spaces, found 8
Code Climate has analyzed commit 7b66599 and detected 83 issues on this pull request. Here's the issue category breakdown:
View more on Code Climate. |
No description provided.