Skip to content

Commit b7eb01d

Browse files
committed
Fix phpdocs and codechecker issues
1 parent 574911c commit b7eb01d

File tree

2 files changed

+31
-6
lines changed

2 files changed

+31
-6
lines changed

classes/output/featured_courses.php

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,12 @@
1717
/**
1818
* Thumblinks Action block renderable.
1919
*
20-
* @package block_thumblinks_action
20+
* @package block_featured_courses
2121
* @copyright 2020 - CALL Learning - Laurent David <laurent@call-learning>
2222
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
2323
*/
2424

2525
namespace block_featured_courses\output;
26-
global $CFG;
27-
2826
defined('MOODLE_INTERNAL') || die();
2927

3028
use context_course;
@@ -35,6 +33,13 @@
3533
use renderer_base;
3634
use templatable;
3735

36+
/**
37+
* Class mini_course_summary_exporter
38+
*
39+
* @package block_featured_courses
40+
* @copyright 2020 - CALL Learning - Laurent David <laurent@call-learning>
41+
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
42+
*/
3843
class mini_course_summary_exporter extends course_summary_exporter {
3944

4045
/**
@@ -67,16 +72,29 @@ public static function define_other_properties() {
6772
*
6873
* @param mixed $data - Either an stdClass or an array of values.
6974
* @param array $related - An optional list of pre-loaded objects related to this object.
75+
* @throws \coding_exception
7076
*/
7177
public function __construct($data, $related = array()) {
7278
\core\external\exporter::__construct($data, $related);
7379
}
7480

81+
/**
82+
* Define related data
83+
*
84+
* @return string[]
85+
*/
7586
protected static function define_related() {
7687
// We cache the context so it does not need to be retrieved from the course.
7788
return array('context' => '\\context');
7889
}
7990

91+
/**
92+
* Get additional values related to the course
93+
*
94+
* @param renderer_base $output
95+
* @return array
96+
* @throws \moodle_exception
97+
*/
8098
protected function get_other_values(renderer_base $output) {
8199
global $CFG;
82100
$courseimage = self::get_course_image($this->data);
@@ -103,7 +121,7 @@ protected function get_other_values(renderer_base $output) {
103121
/**
104122
* Class containing data for featured_courses block.
105123
*
106-
* @package block_mcms
124+
* @package block_featured_courses
107125
* @copyright 2020 - CALL Learning - Laurent David <laurent@call-learning>
108126
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
109127
*/
@@ -118,7 +136,7 @@ class featured_courses implements renderable, templatable {
118136
* featured_courses constructor.
119137
* Retrieve matchin courses
120138
*
121-
* @param $coursesid
139+
* @param int $coursesid
122140
* @throws \coding_exception
123141
* @throws \dml_exception
124142
*/
@@ -128,6 +146,13 @@ public function __construct($coursesid) {
128146
$this->courses = $DB->get_records_select('course', 'id ' . $sql, $params);
129147
}
130148

149+
/**
150+
* Export featured course data
151+
*
152+
* @param renderer_base $renderer
153+
* @return array
154+
* @throws \coding_exception
155+
*/
131156
public function export_for_template(renderer_base $renderer) {
132157
$formattedcourses = array_map(function($course) use ($renderer) {
133158
context_helper::preload_from_record($course);

edit_form.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
/**
2626
* Class block_featured_courses_edit_form
2727
*
28-
* @package block_vetagro_news
28+
* @package block_featured_courses
2929
* @copyright 2020 - CALL Learning - Laurent David <laurent@call-learning>
3030
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
3131
*/

0 commit comments

Comments
 (0)