Skip to content

Commit

Permalink
(update) add phpdoc comments
Browse files Browse the repository at this point in the history
  • Loading branch information
vadymdev committed Jun 4, 2019
1 parent a684bc8 commit a41ad28
Show file tree
Hide file tree
Showing 10 changed files with 137 additions and 69 deletions.
22 changes: 13 additions & 9 deletions classes/duplicate.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
/**
* External course API
*
* @package core_course
* @package local_sharewith
* @category external
* @copyright 2018 Devlion <info@devlion.co>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
Expand All @@ -30,7 +30,7 @@
/**
* Course external functions
*
* @package core_course
* @package local_sharewith
* @category external
* @copyright 2011 Jerome Mouneyrac
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
Expand All @@ -39,7 +39,7 @@
class duplicate extends external_api {

/**
* @return
* Construct
*/
public function __construct() {

Expand Down Expand Up @@ -245,14 +245,16 @@ public static function duplicate_activity($sourceactivityid, $courseid, $section
return $res;
}


/**
* Duplicates activity
*
* @param int $sourceactivityid source
* @param int $courseid target
* @param int $sectionid target
* @param int $masteractivityid target
* @return cm_info|null cminfo object if we sucessfully duplicated the mod and found the new cm.
* @param int $sourceactivityid
* @param int $courseid
* @param int $sectionid
* @param int $newactivityid
* @param bool $availabilitydisable
* @return obj cm_info
*/
public static function duplicate_activity_source($sourceactivityid, $courseid, $sectionid, &$newactivityid,
$availabilitydisable = false) {
Expand Down Expand Up @@ -455,7 +457,9 @@ public static function duplicate_activity_from_availability($activityid, $course
}

/**
* @return
* Send notification
* @param obj $item
* @param obj $newactivity
*/
public static function send_notification($item, $newactivity) {
global $DB;
Expand Down
20 changes: 10 additions & 10 deletions classes/event/activity_copy.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,18 @@
defined('MOODLE_INTERNAL') || die();

/**
* @class
* Activity copy
* @package local_sharewith
* @copyright 2018 Devlion <info@devlion.co>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class activity_copy extends \core\event\base {

/**
* Create instance of event.
*
* @param \stdClass $book
* @param \context_module $context
* @param \stdClass $chapter
* @return chapter_viewed
* @since Moodle 2.7
*
* Create instance of event
* @param int $id
* @param obj $eventdata
* @return obj
*/
public static function create_event($id, $eventdata) {

Expand Down Expand Up @@ -108,7 +107,8 @@ protected function init() {
}

/**
* @return
* Get mapping
* @return array
*/
public static function get_objectid_mapping() {
return array();
Expand Down
21 changes: 11 additions & 10 deletions classes/event/course_copy.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,20 @@
namespace local_sharewith\event;
defined('MOODLE_INTERNAL') || die();

/**
* @class
*/
/**
* Course copy
* @package local_sharewith
* @copyright 2018 Devlion <info@devlion.co>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class course_copy extends \core\event\base {

/**
* Create instance of event.
*
* @since Moodle 2.7
*
* @param \stdClass $book
* @param \context_module $context
* @param \stdClass $chapter
* @return chapter_viewed
* @param id $id
* @param obj $eventdata
* @return obj
*/
public static function create_event($id, $eventdata) {

Expand Down Expand Up @@ -105,7 +105,8 @@ protected function init() {
}

/**
* @return
* Get mapping
* @return array
*/
public static function get_objectid_mapping() {
return array();
Expand Down
17 changes: 9 additions & 8 deletions classes/event/section_copy.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,19 @@
defined('MOODLE_INTERNAL') || die();

/**
* @class
* Section copy
* @package local_sharewith
* @copyright 2018 Devlion <info@devlion.co>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class section_copy extends \core\event\base {

/**
* Create instance of event.
*
* @since Moodle 2.7
*
* @param \stdClass $book
* @param \context_module $context
* @param \stdClass $chapter
* @return chapter_viewed
* @param int $id
* @param obj $eventdata
* @return obj
*/
public static function create_event($id, $eventdata) {

Expand Down Expand Up @@ -106,7 +106,8 @@ protected function init() {
}

/**
* @return
* Get mapping
* @return array
*/
public static function get_objectid_mapping() {
return array();
Expand Down
12 changes: 8 additions & 4 deletions classes/task/adhoc_shedule_sharewith.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,12 @@ public function run_cron_sharewith() {
}

/**
* Copy
* Copy activity
*
* @return int
* @param int $sourceactivityid
* @param int $courseid
* @param int $sectionid
* @return obj $newactivity
*/
public function copy_activity($sourceactivityid, $courseid, $sectionid) {
global $DB;
Expand All @@ -217,8 +220,9 @@ public function copy_activity($sourceactivityid, $courseid, $sectionid) {
}

/**
*
* @return
* Create shortname
* @param string $shortname
* @return int
*/
public function create_relevant_shortname($shortname) {
global $DB;
Expand Down
1 change: 1 addition & 0 deletions db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
defined('MOODLE_INTERNAL') || die();

/**
* Process DB upgrade
* @param int $oldversion the version we are upgrading from
* @return bool result
*/
Expand Down
45 changes: 37 additions & 8 deletions externallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,15 @@ public static function add_sharewith_task_returns() {
}

/**
* @return
* Add share task
* @param int $sourcecourseid
* @param string $type
* @param int $categoryid
* @param int $courseid
* @param int $sectionid
* @param int $sourcesectionid
* @param int $sourceactivityid
* @return array
*/
public static function add_sharewith_task($sourcecourseid, $type, $categoryid, $courseid, $sectionid, $sourcesectionid,
$sourceactivityid) {
Expand Down Expand Up @@ -143,7 +151,12 @@ public static function add_saveactivity_task_returns() {
}

/**
* @return
* Add task for saving new activity
* @param int $courseid
* @param int $sectionid
* @param int $shareid
* @param string $type
* @return string
*/
public static function add_saveactivity_task($courseid, $sectionid, $shareid, $type) {
global $USER, $sharingtypes;
Expand Down Expand Up @@ -226,7 +239,8 @@ public static function get_categories_returns() {
}

/**
* @return
* Get categories
* @return array
*/
public static function get_categories() {
$result = array();
Expand Down Expand Up @@ -268,7 +282,8 @@ public static function get_courses_returns() {
}

/**
* @return
* Get courses
* @return array
*/
public static function get_courses() {
$result = array();
Expand Down Expand Up @@ -312,7 +327,9 @@ public static function get_sections_returns() {
}

/**
* @return
* Get sections
* @param int $courseid
* @return array
*/
public static function get_sections($courseid) {
$result = array();
Expand Down Expand Up @@ -352,7 +369,10 @@ public static function get_teachers_returns() {
}

/**
* @return
* Get teachers list
* @param int $activityid
* @param int $courseid
* @return array
*/
public static function get_teachers($activityid, $courseid) {

Expand Down Expand Up @@ -391,7 +411,11 @@ public static function autocomplete_teachers_returns() {
}

/**
* @return
* Get teachers list
* @param int $activityid
* @param int $courseid
* @param string $searchstring
* @return array
*/
public static function autocomplete_teachers($activityid, $courseid, $searchstring) {

Expand Down Expand Up @@ -432,7 +456,12 @@ public static function submit_teachers_returns() {
}

/**
* @return
* Submit activity to teachers
* @param int $activityid
* @param int $courseid
* @param int $teachersid
* @param string $message
* @return array
*/
public static function submit_teachers($activityid, $courseid, $teachersid, $message) {

Expand Down
3 changes: 3 additions & 0 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ function local_sharewith_render_navbar_output() {

/**
* Hook function to extend the course settings navigation. Call all context functions
* @param obj $parentnode
* @param obj $course
* @param obj $context
*/
function local_sharewith_extend_navigation_course($parentnode, $course, $context) {
global $USER, $COURSE;
Expand Down
Loading

0 comments on commit a41ad28

Please sign in to comment.