From 5cad8d353d643e54d46caef12440529bbf00b8ad Mon Sep 17 00:00:00 2001 From: Ankit Agarwal Date: Wed, 14 May 2014 14:24:25 +0800 Subject: [PATCH] MDL-45543 availability: Use correct namespace for global classes --- availability/classes/condition.php | 2 +- availability/classes/frontend.php | 6 ++--- availability/classes/info.php | 26 +++++++++---------- availability/classes/info_module.php | 6 ++--- availability/classes/info_section.php | 2 +- availability/classes/tree.php | 16 ++++++------ availability/classes/tree_node.php | 6 ++--- .../completion/classes/condition.php | 6 ++--- .../condition/date/classes/condition.php | 4 +-- .../condition/date/classes/frontend.php | 2 +- .../condition/grade/classes/condition.php | 4 +-- .../condition/group/classes/condition.php | 4 +-- .../condition/grouping/classes/condition.php | 4 +-- .../condition/profile/classes/condition.php | 4 +-- 14 files changed, 46 insertions(+), 46 deletions(-) diff --git a/availability/classes/condition.php b/availability/classes/condition.php index 5685b5ab82e..e10b0bd61af 100644 --- a/availability/classes/condition.php +++ b/availability/classes/condition.php @@ -180,7 +180,7 @@ abstract class condition extends tree_node { * * Default implementation returns false. * - * @param stdClass $course Moodle course object + * @param \stdClass $course Moodle course object * @param int $cmid ID of activity whose completion value is considered * @return boolean True if the availability of something else may rely on it */ diff --git a/availability/classes/frontend.php b/availability/classes/frontend.php index ea7b0127197..fba731c94eb 100644 --- a/availability/classes/frontend.php +++ b/availability/classes/frontend.php @@ -46,7 +46,7 @@ abstract class frontend { * * Default returns true. * - * @param stdClass $course Course object + * @param \stdClass $course Course object * @param \cm_info $cm Course-module currently being edited (null if none) * @param \section_info $section Section currently being edited (null if none) */ @@ -73,7 +73,7 @@ abstract class frontend { * * Default returns no parameters. * - * @param stdClass $course Course object + * @param \stdClass $course Course object * @param \cm_info $cm Course-module currently being edited (null if none) * @param \section_info $section Section currently being edited (null if none) * @return array Array of parameters for the JavaScript function @@ -95,7 +95,7 @@ abstract class frontend { /** * Includes JavaScript for the main system and all plugins. * - * @param stdClass $course Course object + * @param \stdClass $course Course object * @param \cm_info $cm Course-module currently being edited (null if none) * @param \section_info $section Section currently being edited (null if none) */ diff --git a/availability/classes/info.php b/availability/classes/info.php index a335d38c942..884151bc227 100644 --- a/availability/classes/info.php +++ b/availability/classes/info.php @@ -34,7 +34,7 @@ defined('MOODLE_INTERNAL') || die(); * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ abstract class info { - /** @var stdClass Course */ + /** @var \stdClass Course */ protected $course; /** @var \course_modinfo Modinfo (available only during some functions) */ @@ -52,10 +52,10 @@ abstract class info { /** * Constructs with item details. * - * @param stdClass $course Course object + * @param \stdClass $course Course object * @param int $visible Value of visible flag (eye icon) * @param string $availability Availability definition (JSON format) or null - * @throws coding_exception If data is not valid JSON format + * @throws \coding_exception If data is not valid JSON format */ public function __construct($course, $visible, $availability) { // Set basic values. @@ -67,7 +67,7 @@ abstract class info { /** * Obtains the course associated with this availability information. * - * @return stdClass Moodle course object + * @return \stdClass Moodle course object */ public function get_course() { return $this->course; @@ -128,7 +128,7 @@ abstract class info { * @param string $availability Availability string in JSON format * @param boolean $lax If true, throw exceptions only for invalid structure * @return tree Availability tree - * @throws coding_exception If data is not valid JSON format + * @throws \coding_exception If data is not valid JSON format */ protected function decode_availability($availability, $lax) { // Decode JSON data. @@ -306,7 +306,7 @@ abstract class info { * * @param string $restoreid Restore identifier * @param int $courseid Target course id - * @param base_logger $logger Logger for any warnings + * @param \base_logger $logger Logger for any warnings */ public function update_after_restore($restoreid, $courseid, \base_logger $logger) { $tree = $this->get_availability_tree(); @@ -342,7 +342,7 @@ abstract class info { * function does that for the conditional availability data for all * modules and sections on the course. * - * @param int|stdClass $courseorid Course id or object + * @param int|\stdClass $courseorid Course id or object * @param string $table Table name e.g. 'course_modules' * @param int $oldid Previous ID * @param int $newid New ID @@ -407,7 +407,7 @@ abstract class info { * groupmembersonly field for modules. This is off by default because * we are not yet moving the groupmembersonly option into this new API. * - * @param stdClass $rec Object possibly containing legacy fields + * @param \stdClass $rec Object possibly containing legacy fields * @param bool $section True if this is a section * @param bool $modgroupmembersonly True if groupmembersonly is converted for mods * @return string|null New availability value or null if none @@ -468,7 +468,7 @@ abstract class info { * that it has an AND tree with one or more conditions. * * @param string|null $availability Current availability conditions - * @param stdClass $rec Object containing information from old table + * @param \stdClass $rec Object containing information from old table * @param bool $show True if 'show' option should be enabled * @return string New availability conditions */ @@ -501,7 +501,7 @@ abstract class info { * that it has an AND tree with one or more conditions. * * @param string|null $availability Current availability conditions - * @param stdClass $rec Object containing information from old table + * @param \stdClass $rec Object containing information from old table * @param bool $show True if 'show' option should be enabled * @return string New availability conditions */ @@ -598,8 +598,8 @@ abstract class info { * object. * * @param string $info Info string - * @param int|stdClass $courseorid - * @return Correctly formatted info string + * @param int|\stdClass $courseorid + * @return string Correctly formatted info string */ public static function format_info($info, $courseorid) { // Don't waste time if there are no special tags. @@ -624,7 +624,7 @@ abstract class info { * JS (using the non-JS version instead, which causes a page reload) if a * completion tickbox value may affect a conditional activity. * - * @param stdClass $course Moodle course object + * @param \stdClass $course Moodle course object * @param int $cmid Course-module id * @return bool True if this is used in a condition, false otherwise */ diff --git a/availability/classes/info_module.php b/availability/classes/info_module.php index 139812c8ea8..af4ae5f3ee7 100644 --- a/availability/classes/info_module.php +++ b/availability/classes/info_module.php @@ -63,7 +63,7 @@ class info_module extends info { /** * Gets the course-module object. Intended for use by conditions. * - * @return cm_info Course module + * @return \cm_info Course module */ public function get_course_module() { return $this->cm; @@ -130,11 +130,11 @@ class info_module extends info { * disabled, and you supply a $cm object with necessary fields, and you * don't check course access. * - * @param int|stdClass|cm_info $cmorid Object or id representing activity + * @param int|\stdClass|\cm_info $cmorid Object or id representing activity * @param int $userid User id (0 = current user) * @param bool $checkcourse If true, checks whether the user has course access * @return bool True if the activity is visible to the specified user - * @throws moodle_exception If the cmid doesn't exist + * @throws \moodle_exception If the cmid doesn't exist */ public static function is_user_visible($cmorid, $userid = 0, $checkcourse = true) { global $USER, $DB, $CFG; diff --git a/availability/classes/info_section.php b/availability/classes/info_section.php index 777c46a1c76..4f98522c879 100644 --- a/availability/classes/info_section.php +++ b/availability/classes/info_section.php @@ -65,7 +65,7 @@ class info_section extends info { /** * Gets the section object. Intended for use by conditions. * - * @return section_info Section + * @return \section_info Section */ public function get_section() { return $this->section; diff --git a/availability/classes/tree.php b/availability/classes/tree.php index 964af4ff96b..f73ba2d2e85 100644 --- a/availability/classes/tree.php +++ b/availability/classes/tree.php @@ -128,11 +128,11 @@ class tree extends tree_node { * coding_exception (if $lax is false). * * @see decode_availability - * @param stdClass $structure Structure (decoded from JSON) + * @param \stdClass $structure Structure (decoded from JSON) * @param boolean $lax If true, throw exceptions only for invalid structure * @param boolean $root If true, this is the root tree * @return tree Availability tree - * @throws coding_exception If data is not valid structure + * @throws \coding_exception If data is not valid structure */ public function __construct($structure, $lax = false, $root = true) { $this->root = $root; @@ -389,12 +389,12 @@ class tree extends tree_node { * for display to staff. * * @param info $info Information about location of condition tree - * @throws coding_exception If you call on a non-root tree + * @throws \coding_exception If you call on a non-root tree * @return string HTML data (empty string if none) */ public function get_full_information(info $info) { if (!$this->root) { - throw new coding_exception('Only supported on root item'); + throw new \coding_exception('Only supported on root item'); } return $this->get_full_information_recursive(false, $info, null, true); } @@ -406,12 +406,12 @@ class tree extends tree_node { * * @param info $info Information about location of condition tree * @param result $result Result object - * @throws coding_exception If you call on a non-root tree + * @throws \coding_exception If you call on a non-root tree * @return string HTML data (empty string if none) */ public function get_result_information(info $info, result $result) { if (!$this->root) { - throw new coding_exception('Only supported on root item'); + throw new \coding_exception('Only supported on root item'); } return $this->get_full_information_recursive(false, $info, $result, true); } @@ -530,7 +530,7 @@ class tree extends tree_node { $negative = true; break; default: - throw new coding_exception('Unknown operator'); + throw new \coding_exception('Unknown operator'); } switch($this->op) { case self::OP_AND: @@ -542,7 +542,7 @@ class tree extends tree_node { $andoperator = false; break; default: - throw new coding_exception('Unknown operator'); + throw new \coding_exception('Unknown operator'); } // Select NOT (or not) for children. It flips if this is a 'not' group. diff --git a/availability/classes/tree_node.php b/availability/classes/tree_node.php index 2e61c7f5458..22dc48dbffd 100644 --- a/availability/classes/tree_node.php +++ b/availability/classes/tree_node.php @@ -78,7 +78,7 @@ abstract class tree_node { /** * Saves tree data back to a structure object. * - * @return stdClass Structure object (ready to be made into JSON format) + * @return \stdClass Structure object (ready to be made into JSON format) */ public abstract function save(); @@ -152,11 +152,11 @@ abstract class tree_node { * @param \core_availability\info $info Item we're checking * @param capability_checker $checker * @return array Filtered version of input array - * @throws coding_exception If called on a condition that doesn't apply to user lists + * @throws \coding_exception If called on a condition that doesn't apply to user lists */ public function filter_user_list(array $users, $not, \core_availability\info $info, capability_checker $checker) { - throw new coding_exception('Not implemented (do not call unless '. + throw new \coding_exception('Not implemented (do not call unless '. 'is_applied_to_user_lists is true)'); } } diff --git a/availability/condition/completion/classes/condition.php b/availability/condition/completion/classes/condition.php index d44ff2fd08a..82d99da8bcf 100644 --- a/availability/condition/completion/classes/condition.php +++ b/availability/condition/completion/classes/condition.php @@ -48,8 +48,8 @@ class condition extends \core_availability\condition { /** * Constructor. * - * @param stdClass $structure Data structure from JSON decode - * @throws coding_exception If invalid data structure. + * @param \stdClass $structure Data structure from JSON decode + * @throws \coding_exception If invalid data structure. */ public function __construct($structure) { // Get cmid. @@ -212,7 +212,7 @@ class condition extends \core_availability\condition { * Used in course/lib.php because we need to disable the completion JS if * a completion value affects a conditional activity. * - * @param stdClass $course Moodle course object + * @param \stdClass $course Moodle course object * @param int $cmid Course-module id * @return bool True if this is used in a condition, false otherwise */ diff --git a/availability/condition/date/classes/condition.php b/availability/condition/date/classes/condition.php index c1b3bbad6f4..36191f94798 100644 --- a/availability/condition/date/classes/condition.php +++ b/availability/condition/date/classes/condition.php @@ -52,8 +52,8 @@ class condition extends \core_availability\condition { /** * Constructor. * - * @param stdClass $structure Data structure from JSON decode - * @throws coding_exception If invalid data structure. + * @param \stdClass $structure Data structure from JSON decode + * @throws \coding_exception If invalid data structure. */ public function __construct($structure) { // Get direction. diff --git a/availability/condition/date/classes/frontend.php b/availability/condition/date/classes/frontend.php index e1cba19fca6..3af417202e6 100644 --- a/availability/condition/date/classes/frontend.php +++ b/availability/condition/date/classes/frontend.php @@ -74,7 +74,7 @@ class frontend extends \core_availability\frontend { * Given a timestamp, obtains corresponding field values. * * @param int $time Timestamp - * @return stdClass Object with fields for year, month, day, hour, minute + * @return \stdClass Object with fields for year, month, day, hour, minute */ public static function get_fields_from_time($time) { $calendartype = \core_calendar\type_factory::get_calendar_instance(); diff --git a/availability/condition/grade/classes/condition.php b/availability/condition/grade/classes/condition.php index 887fdbc191e..9ae63911b9b 100644 --- a/availability/condition/grade/classes/condition.php +++ b/availability/condition/grade/classes/condition.php @@ -46,8 +46,8 @@ class condition extends \core_availability\condition { /** * Constructor. * - * @param stdClass $structure Data structure from JSON decode - * @throws coding_exception If invalid data structure. + * @param \stdClass $structure Data structure from JSON decode + * @throws \coding_exception If invalid data structure. */ public function __construct($structure) { // Get grade item id. diff --git a/availability/condition/group/classes/condition.php b/availability/condition/group/classes/condition.php index f228b4d3a26..96b5435c347 100644 --- a/availability/condition/group/classes/condition.php +++ b/availability/condition/group/classes/condition.php @@ -43,8 +43,8 @@ class condition extends \core_availability\condition { /** * Constructor. * - * @param stdClass $structure Data structure from JSON decode - * @throws coding_exception If invalid data structure. + * @param \stdClass $structure Data structure from JSON decode + * @throws \coding_exception If invalid data structure. */ public function __construct($structure) { // Get group id. diff --git a/availability/condition/grouping/classes/condition.php b/availability/condition/grouping/classes/condition.php index 60206702e68..2df2fe15467 100644 --- a/availability/condition/grouping/classes/condition.php +++ b/availability/condition/grouping/classes/condition.php @@ -46,8 +46,8 @@ class condition extends \core_availability\condition { /** * Constructor. * - * @param stdClass $structure Data structure from JSON decode - * @throws coding_exception If invalid data structure. + * @param \stdClass $structure Data structure from JSON decode + * @throws \coding_exception If invalid data structure. */ public function __construct($structure) { // Get grouping id. diff --git a/availability/condition/profile/classes/condition.php b/availability/condition/profile/classes/condition.php index 4d22e4e507c..36ba43ccc8b 100644 --- a/availability/condition/profile/classes/condition.php +++ b/availability/condition/profile/classes/condition.php @@ -73,8 +73,8 @@ class condition extends \core_availability\condition { /** * Constructor. * - * @param stdClass $structure Data structure from JSON decode - * @throws coding_exception If invalid data structure. + * @param \stdClass $structure Data structure from JSON decode + * @throws \coding_exception If invalid data structure. */ public function __construct($structure) { // Get operator.