Closed
Conversation
aydevworks
reviewed
Jan 30, 2026
Comment on lines
+47
to
+66
| /** @var stdClass course1 */ | ||
| private stdClass $course2; | ||
|
|
||
| /** @var stdClass course1 */ | ||
| private stdClass $course3; | ||
|
|
||
| /** @var stdClass course1 */ | ||
| private stdClass $course4; | ||
|
|
||
| /** @var stdClass course1 */ | ||
| private stdClass $courseshouldbefrozen; | ||
|
|
||
| /** @var stdClass course1 */ | ||
| private stdClass $coursewithoutacademicyear; | ||
|
|
||
| /** @var stdClass course1 */ | ||
| private stdClass $coursewithfutureenddate; | ||
|
|
||
| /** @var stdClass course1 */ | ||
| private stdClass $coursewithoutenddate; |
Contributor
There was a problem hiding this comment.
doc blocks content not matching the properties names.
Comment on lines
97
to
103
| // Put 4 years in associative array. | ||
| $this->years = [ | ||
| 'previous_year' => date('Y', strtotime('-2 years')), | ||
| 'last_year' => date('Y', strtotime('-1 years')), | ||
| 'current_year' => date('Y'), | ||
| 'next_year' => date('Y', strtotime('+1 years')), | ||
| ]; |
Contributor
There was a problem hiding this comment.
The phpunit test error could be fixed by the following code:
// Get the academic year start date config (default is 08-01).
$academicyearstartdate = get_config('block_lifecycle', 'academic_year_start_date') ?: '08-01';
// Determine current academic year based on whether we've passed the start date.
$currentyear = date('Y');
$academicyearstart = strtotime($currentyear . '-' . $academicyearstartdate);
if (time() < $academicyearstart) {
// We haven't reached the academic year start date yet, so current academic year is last year.
$currentacademicyear = $currentyear - 1;
} else {
$currentacademicyear = $currentyear;
}
// Put 4 years in associative array.
$this->years = [
'previous_year' => (string)($currentacademicyear - 2),
'last_year' => (string)($currentacademicyear - 1),
'current_year' => (string)$currentacademicyear,
'next_year' => (string)($currentacademicyear + 1),
];
Contributor
|
Apologies - I didn't see this PR until I pushed mine up which (among other things) makes this change. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Dynamically created properties are deprecated.