From 6bcc44f5845df2c2ceb48e799045681a0064847e Mon Sep 17 00:00:00 2001 From: PMKuipers Date: Sun, 27 Aug 2023 23:29:46 +0200 Subject: [PATCH] PHPDoc documentation --- classes/badgeinfo.php | 2 +- classes/courseinfo.php | 8 ++++---- classes/period.php | 2 +- classes/studyitem.php | 6 +++--- classes/studyline.php | 2 +- classes/studyplan.php | 4 ++-- classes/studyplanpage.php | 10 +++++----- classes/studyplanservice.php | 18 +++++++++--------- 8 files changed, 26 insertions(+), 26 deletions(-) diff --git a/classes/badgeinfo.php b/classes/badgeinfo.php index f5b35f2..5c1834d 100644 --- a/classes/badgeinfo.php +++ b/classes/badgeinfo.php @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . /** - * Handle badge information + * Handle badge information * @package local_treestudyplan * @copyright 2023 P.M. Kuipers * @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later diff --git a/classes/courseinfo.php b/classes/courseinfo.php index fea7c67..cb97584 100644 --- a/classes/courseinfo.php +++ b/classes/courseinfo.php @@ -145,7 +145,7 @@ class courseinfo { } /** - * Construct courseinfo based on course id and + * Construct courseinfo based on course id and * @param int $id Course id * @param studyitem|null $studyitem Studyitem linking this course (if applicable) */ @@ -178,7 +178,7 @@ class courseinfo { return $DB->get_field(self::TABLE, "id", ['shortname' => $shortname]); } - /** + /** * Determine course timing [future, present or past] based on a course date * @param stdClass $course Course database record * @return string 'future', 'present' or 'past' @@ -196,7 +196,7 @@ class courseinfo { } } - /** + /** * Determine course timing for this course [future, present or past] * @return string 'future', 'present' or 'past' */ @@ -248,7 +248,7 @@ class courseinfo { ], 'referenced course information', $value); } - /** + /** * Webservice model for basic info * @return array Webservice data model */ diff --git a/classes/period.php b/classes/period.php index e32fdd3..f3b573f 100644 --- a/classes/period.php +++ b/classes/period.php @@ -49,7 +49,7 @@ class period { /** * Find record in database and return management object * @param int $id Id of database record - * @return self + * @return self */ public static function find_by_id($id): self { if (!array_key_exists($id, self::$cache)) { diff --git a/classes/studyitem.php b/classes/studyitem.php index 136958f..f8dd99a 100644 --- a/classes/studyitem.php +++ b/classes/studyitem.php @@ -72,7 +72,7 @@ class studyitem { /** * Find record in database and return management object * @param int $id Id of database record - * @return self + * @return self */ public static function find_by_id($id): self { if (!array_key_exists($id, self::$studyitemcache)) { @@ -320,8 +320,8 @@ class studyitem { global $DB; foreach ($resequence as $sq) { - // Only change line_id if new line is within the same studyplan page - if ( studyitem::find_by_id($sq['id'])->studyline()->page()->id() == + // Only change line_id if new line is within the same studyplan page. + if ( self::find_by_id($sq['id'])->studyline()->page()->id() == studyline::find_by_id($sq['line_id'])->page()->id() ) { $DB->update_record(self::TABLE, [ 'id' => $sq['id'], diff --git a/classes/studyline.php b/classes/studyline.php index de1de40..2616b20 100644 --- a/classes/studyline.php +++ b/classes/studyline.php @@ -79,7 +79,7 @@ class studyline { /** * Find record in database and return management object * @param int $id Id of database record - * @return self + * @return self */ public static function find_by_id($id): self { if (!array_key_exists($id, self::$studylinecache)) { diff --git a/classes/studyplan.php b/classes/studyplan.php index 3ec054f..e334f80 100644 --- a/classes/studyplan.php +++ b/classes/studyplan.php @@ -53,7 +53,7 @@ class studyplan { /** * Find record in database and return management object * @param int $id Id of database record - * @return self + * @return self */ public static function find_by_id($id): self { if (!array_key_exists($id, self::$studyplancache)) { @@ -145,7 +145,7 @@ class studyplan { ], 'Basic studyplan info', $value); } - /** + /** * Webservice model for basic info * @return array Webservice data model */ diff --git a/classes/studyplanpage.php b/classes/studyplanpage.php index 3be1d30..29156a8 100644 --- a/classes/studyplanpage.php +++ b/classes/studyplanpage.php @@ -29,7 +29,7 @@ require_once($CFG->libdir.'/externallib.php'); */ class studyplanpage { - /** + /** * Database table this class models for * @var string */ const TABLE = "local_treestudyplan_page"; @@ -42,7 +42,7 @@ class studyplanpage { * Holds database record * @var stdClass */ - private $r; // Holds database record. + private $r; /** @var int */ private $id; /** @var studyplan*/ @@ -59,7 +59,7 @@ class studyplanpage { /** * Find record in database and return management object * @param int $id Id of database record - * @return self + * @return self */ public static function find_by_id($id): self { if (!array_key_exists($id, self::$cache)) { @@ -157,7 +157,7 @@ class studyplanpage { ], 'Studyplan page basic info', $value); } - /** + /** * Webservice model for basic info * @return array Webservice data model */ @@ -613,7 +613,7 @@ class studyplanpage { /** * Find a studyline in this page by its shortname - * @param string $shortname + * @param string $shortname * @return studyline|null */ protected function find_studyline_by_shortname($shortname) { diff --git a/classes/studyplanservice.php b/classes/studyplanservice.php index 193cd61..f377ba0 100644 --- a/classes/studyplanservice.php +++ b/classes/studyplanservice.php @@ -474,7 +474,7 @@ class studyplanservice extends \external_api { * Delete a study line * @param mixed $id Id of the studyline * @return array Success/fail model - * + * */ public static function delete_studyline($id) { $o = studyline::find_by_id($id); @@ -604,7 +604,7 @@ class studyplanservice extends \external_api { /** * Add a new study item * @param int $lineid - * @param string $type + * @param string $type * @param array $details * @param int $slot * @param int $layer @@ -912,7 +912,7 @@ class studyplanservice extends \external_api { * @param bool $include Include grade or not * @param bool $required Mark grade as required or not * @return array Success/Fail model - * + * */ public static function include_grade($gradeid, $itemid, $include, $required = false) { global $USER; @@ -1001,7 +1001,7 @@ class studyplanservice extends \external_api { * @param int $scaleid Id of scale to use * @return array */ - public static function force_studyplan_scale($studyplanid, $scaleid) { + public static function force_studyplan_scale($studyplanid, $scaleid) { global $DB; $dbman = $DB->get_manager(); @@ -1262,9 +1262,9 @@ class studyplanservice extends \external_api { return studyplan::export_structure(); } - + /** - * Export studyplan + * Export studyplan * @param mixed $studyplanid Id of studyplan to export * @param string $format Export format [csv, json (default)] * @return array @@ -1347,7 +1347,7 @@ class studyplanservice extends \external_api { /** * Import studyplan from file - * @param string $content Content of file + * @param string $content Content of file * @param string $format Format of file * @param int $contextid ID of context to import to * @return array Success/fail model @@ -1389,7 +1389,7 @@ class studyplanservice extends \external_api { /** * Import studylines into existing studtplan * @param int $studyplanid ID of studyplan to import to - * @param string $content Content of file + * @param string $content Content of file * @param string $format Format of file * @return array Success/fail model */ @@ -1436,7 +1436,7 @@ class studyplanservice extends \external_api { /** * Submit hacked course activity edit form to edit just name and description - * @deprecated will remove hacked edit form in the future + * @deprecated will remove hacked edit form in the future * @param mixed $cmid * @param mixed $formdata * @return array Success/fail structure