Skip to content

Commit

Permalink
Fixing all PHPDoc issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
mchurchward committed Mar 12, 2022
1 parent 9ec8ab4 commit 5aa96f4
Show file tree
Hide file tree
Showing 88 changed files with 1,696 additions and 1,116 deletions.
17 changes: 10 additions & 7 deletions backup/moodle1/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
/**
* Provides support for the conversion of moodle1 backup to the moodle2 format
*
* @package mod
* @subpackage questionnaire
* @package mod_questionnaire
* @copyright 2011 Robin de Vries <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
Expand All @@ -33,7 +32,7 @@ class moodle1_mod_questionnaire_handler extends moodle1_mod_handler {
/**
* Declare the paths in moodle.xml we are able to convert
*
* The method returns list of {@link convert_path} instances. For each path returned,
* The method returns list of convert_path instances. For each path returned,
* at least one of on_xxx_start(), process_xxx() and on_xxx_end() methods must be
* defined. The method process_xxx() is not executed if the associated path element is
* empty (i.e. it contains none elements or sub-paths only).
Expand All @@ -42,7 +41,7 @@ class moodle1_mod_questionnaire_handler extends moodle1_mod_handler {
* actually exist in the file. The last element with the module name was
* appended by the moodle1_converter class.
*
* @return array of {@link convert_path} instances
* @return array of convert_path instances
*/
public function get_paths() {
return array(
Expand All @@ -62,9 +61,11 @@ public function get_paths() {
new convert_path('question_choice', '/MOODLE_BACKUP/COURSE/MODULES/MOD/QUESTIONNAIRE/SURVEY/QUESTION/QUESTION_CHOICE'),
);
}

/**
* This is executed every time we have one /MOODLE_BACKUP/COURSE/MODULES/MOD/QUESTIONNAIRE
* data available
* data available.
* @param array $data
*/
public function process_questionnaire($data) {
// Get the course module id and context id.
Expand All @@ -88,17 +89,18 @@ public function process_questionnaire($data) {
/**
* This is executed when we reach the closing </MOD> tag of our 'questionnaire' path
*/

public function on_questionnaire_end() {
// Close questionnaire.xml.
$this->xmlwriter->end_tag('surveys');
$this->xmlwriter->end_tag('questionnaire');
$this->xmlwriter->end_tag('activity');
$this->close_xml_writer();
}

/**
* This is executed every time we have one /MOODLE_BACKUP/COURSE/MODULES/MOD/QUESTIONNAIRE/SURVEY
* data available
* @param array $data
*/
public function process_survey($data) {
$this->xmlwriter->begin_tag('survey', array('id' => $data['id']));
Expand All @@ -120,6 +122,7 @@ public function on_survey_end() {
/**
* This is executed every time we have one /MOODLE_BACKUP/COURSE/MODULES/MOD/QUESTIONNAIRE/SURVEY/QUESTION
* data available
* @param array $data
*/
public function process_question($data) {

Expand All @@ -144,9 +147,9 @@ public function on_question_end() {
/**
* This is executed every time we have one /MOODLE_BACKUP/COURSE/MODULES/MOD/QUESTIONNAIRE/SURVEY/QUESTION/QUESTION_CHOICE
* data available
* @param array $data
*/
public function process_question_choice($data) {
$this->write_xml('quest_choice', $data, array('/question_choice/id'));
}

}
16 changes: 7 additions & 9 deletions backup/moodle2/backup_questionnaire_activity_task.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,6 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* @package mod_questionnaire
* @copyright 2016 Mike Churchward ([email protected])
* @author Mike Churchward
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

defined('MOODLE_INTERNAL') || die();

// Because it exists (must).
Expand All @@ -29,8 +22,11 @@
require_once($CFG->dirroot . '/mod/questionnaire/backup/moodle2/backup_questionnaire_settingslib.php');

/**
* questionnaire backup task that provides all the settings and steps to perform one
* complete backup of the activity
* Questionnaire backup task that provides all the settings and steps to perform one complete backup of the activity.
* @package mod_questionnaire
* @copyright 2016 Mike Churchward ([email protected])
* @author Mike Churchward
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class backup_questionnaire_activity_task extends backup_activity_task {

Expand All @@ -52,6 +48,8 @@ protected function define_my_steps() {
/**
* Code the transformations to perform in the activity in
* order to get transportable (encoded) links
* @param string $content
* @return array|string|string[]|null
*/
public static function encode_content_links($content) {
global $CFG;
Expand Down
1 change: 1 addition & 0 deletions backup/moodle2/backup_questionnaire_settingslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* The required settingslib file.
* @package mod_questionnaire
* @copyright 2016 Mike Churchward ([email protected])
* @author Mike Churchward
Expand Down
20 changes: 10 additions & 10 deletions backup/moodle2/backup_questionnaire_stepslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,24 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

defined('MOODLE_INTERNAL') || die();

/**
* Define all the backup steps that will be used by the backup_questionnaire_activity_task.
*
* Define the complete choice structure for backup, with file and id annotations.
*
* @package mod_questionnaire
* @copyright 2016 Mike Churchward ([email protected])
* @author Mike Churchward
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

defined('MOODLE_INTERNAL') || die();

/**
* Define all the backup steps that will be used by the backup_questionnaire_activity_task
*/

/**
* Define the complete choice structure for backup, with file and id annotations
*/
class backup_questionnaire_activity_structure_step extends backup_activity_structure_step {

/**
* Defines the backup structure.
* @return backup_nested_element
*/
protected function define_structure() {
global $DB;
// To know if we are including userinfo.
Expand Down
22 changes: 9 additions & 13 deletions backup/moodle2/restore_questionnaire_activity_task.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,17 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* @package mod_questionnaire
* @copyright 2016 Mike Churchward ([email protected])
* @author Mike Churchward
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

defined('MOODLE_INTERNAL') || die();

// Because it exists (must).
require_once($CFG->dirroot . '/mod/questionnaire/backup/moodle2/restore_questionnaire_stepslib.php');

/**
* questionnaire restore task that provides all the settings and steps to perform one
* complete restore of the activity
* Questionnaire restore task that provides all the settings and steps to perform one complete restore of the activity.
* @package mod_questionnaire
* @copyright 2016 Mike Churchward ([email protected])
* @author Mike Churchward
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class restore_questionnaire_activity_task extends restore_activity_task {

Expand Down Expand Up @@ -78,9 +74,9 @@ public static function define_decode_rules() {

/**
* Define the restore log rules that will be applied
* by the {@link restore_logs_processor} when restoring
* by the restore_logs_processor when restoring
* questionnaire logs. It must return one array
* of {@link restore_log_rule} objects
* of restore_log_rule objects
*/
public static function define_restore_log_rules() {
$rules = array();
Expand All @@ -97,9 +93,9 @@ public static function define_restore_log_rules() {

/**
* Define the restore log rules that will be applied
* by the {@link restore_logs_processor} when restoring
* by the restore_logs_processor when restoring
* course logs. It must return one array
* of {@link restore_log_rule} objects
* of restore_log_rule objects
*
* Note this rules are applied when restoring course logs
* by the restore final task, but are defined here at
Expand Down
Loading

0 comments on commit 5aa96f4

Please sign in to comment.