Skip to content

Commit

Permalink
MDL-45319 events: trivial changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mdjnelson authored and marinaglancy committed May 7, 2014
1 parent eaea796 commit e687396
Show file tree
Hide file tree
Showing 36 changed files with 44 additions and 55 deletions.
2 changes: 0 additions & 2 deletions lib/classes/event/blog_association_created.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
defined('MOODLE_INTERNAL') || die();

/**
* blog_association_created
*
* Class for event to be triggered when a new blog entry is associated with a context.
*
* @property-read array $other {
Expand Down
2 changes: 1 addition & 1 deletion lib/classes/event/blog_comment_created.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
defined('MOODLE_INTERNAL') || die();

/**
* The blog comment created event.
* The blog comment created event class.
*
* @package core
* @since Moodle 2.7
Expand Down
2 changes: 1 addition & 1 deletion lib/classes/event/blog_comment_deleted.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
defined('MOODLE_INTERNAL') || die();

/**
* The blog comment deleted event.
* The blog comment deleted event class.
*
* @package core
* @since Moodle 2.7
Expand Down
2 changes: 1 addition & 1 deletion lib/classes/event/cohort_created.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public static function get_legacy_eventname() {
/**
* Return legacy event data.
*
* @return stdClass
* @return \stdClass
*/
protected function get_legacy_eventdata() {
return $this->get_record_snapshot('cohort', $this->objectid);
Expand Down
2 changes: 1 addition & 1 deletion lib/classes/event/cohort_deleted.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public static function get_legacy_eventname() {
/**
* Return legacy event data.
*
* @return stdClass
* @return \stdClass
*/
protected function get_legacy_eventdata() {
return $this->get_record_snapshot('cohort', $this->objectid);
Expand Down
2 changes: 1 addition & 1 deletion lib/classes/event/cohort_member_added.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public static function get_legacy_eventname() {
/**
* Return legacy event data.
*
* @return stdClass
* @return \stdClass
*/
protected function get_legacy_eventdata() {
$data = new \stdClass();
Expand Down
2 changes: 1 addition & 1 deletion lib/classes/event/cohort_member_removed.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public static function get_legacy_eventname() {
/**
* Return legacy event data.
*
* @return stdClass
* @return \stdClass
*/
protected function get_legacy_eventdata() {
$data = new \stdClass();
Expand Down
2 changes: 1 addition & 1 deletion lib/classes/event/cohort_updated.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public static function get_legacy_eventname() {
/**
* Return legacy event data.
*
* @return stdClass
* @return \stdClass
*/
protected function get_legacy_eventdata() {
return $this->get_record_snapshot('cohort', $this->objectid);
Expand Down
2 changes: 1 addition & 1 deletion lib/classes/event/course_category_deleted.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public static function get_legacy_eventname() {
/**
* Returns the legacy event data.
*
* @return coursecat the category that was deleted
* @return \coursecat the category that was deleted
*/
protected function get_legacy_eventdata() {
return $this->coursecat;
Expand Down
4 changes: 2 additions & 2 deletions lib/classes/event/course_content_deleted.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* Course content_deleted event class.
* Course content deleted event.
*
* @package core
* @copyright 2013 Mark Nelson <[email protected]>
Expand All @@ -27,7 +27,7 @@
defined('MOODLE_INTERNAL') || die();

/**
* Course content_deleted event class.
* Course content deleted event class.
*
* @property-read array $other {
* Extra information about event.
Expand Down
4 changes: 2 additions & 2 deletions lib/classes/event/course_user_report_viewed.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,12 @@ protected function validate_data() {
}

if (empty($this->relateduserid)) {
throw new \coding_exception('relateduserid needs to be set.');
throw new \coding_exception('The \'relateduserid\' must be set.');
}

// Make sure this class is never used without proper object details.
if (!isset($this->other['mode'])) {
throw new \coding_exception('mode needs to be set in $other.');
throw new \coding_exception('The \'mode\' value must be set in other.');
}
}
}
6 changes: 3 additions & 3 deletions lib/classes/event/email_failed.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@ protected function get_legacy_logdata() {
protected function validate_data() {
parent::validate_data();
if (!isset($this->other['subject'])) {
throw new \coding_exception('The subject needs to be set in $other');
throw new \coding_exception('The \'subject\' value must be set in other.');
}
if (!isset($this->other['message'])) {
throw new \coding_exception('The message needs to be set in $other');
throw new \coding_exception('The \'message\' value must be set in other.');
}
if (!isset($this->other['errorinfo'])) {
throw new \coding_exception('The error info needs to be set in $other');
throw new \coding_exception('The \'errorinfo\' value must be set in other.');
}
}
}
2 changes: 1 addition & 1 deletion lib/classes/event/group_created.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function get_description() {
/**
* Legacy event data if get_legacy_eventname() is not empty.
*
* @return stdClass
* @return \stdClass
*/
protected function get_legacy_eventdata() {
return $this->get_record_snapshot('groups', $this->objectid);
Expand Down
3 changes: 1 addition & 2 deletions lib/classes/event/group_deleted.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function get_description() {
/**
* Legacy event data if get_legacy_eventname() is not empty.
*
* @return stdClass
* @return \stdClass
*/
protected function get_legacy_eventdata() {
return $this->get_record_snapshot('groups', $this->objectid);
Expand Down Expand Up @@ -90,5 +90,4 @@ protected function init() {
$this->data['edulevel'] = self::LEVEL_OTHER;
$this->data['objecttable'] = 'groups';
}

}
2 changes: 1 addition & 1 deletion lib/classes/event/group_updated.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function get_description() {
/**
* Legacy event data if get_legacy_eventname() is not empty.
*
* @return stdClass
* @return \stdClass
*/
protected function get_legacy_eventdata() {
return $this->get_record_snapshot('groups', $this->objectid);
Expand Down
3 changes: 1 addition & 2 deletions lib/classes/event/grouping_created.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function get_description() {
/**
* Legacy event data if get_legacy_eventname() is not empty.
*
* @return stdClass
* @return \stdClass
*/
protected function get_legacy_eventdata() {
return $this->get_record_snapshot('groupings', $this->objectid);
Expand Down Expand Up @@ -90,5 +90,4 @@ protected function init() {
$this->data['edulevel'] = self::LEVEL_OTHER;
$this->data['objecttable'] = 'groupings';
}

}
3 changes: 1 addition & 2 deletions lib/classes/event/grouping_deleted.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function get_description() {
/**
* Legacy event data if get_legacy_eventname() is not empty.
*
* @return stdClass
* @return \stdClass
*/
protected function get_legacy_eventdata() {
return $this->get_record_snapshot('groupings', $this->objectid);
Expand Down Expand Up @@ -97,5 +97,4 @@ protected function init() {
$this->data['edulevel'] = self::LEVEL_OTHER;
$this->data['objecttable'] = 'groupings';
}

}
1 change: 0 additions & 1 deletion lib/classes/event/grouping_updated.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,4 @@ protected function init() {
$this->data['edulevel'] = self::LEVEL_OTHER;
$this->data['objecttable'] = 'groupings';
}

}
12 changes: 6 additions & 6 deletions lib/classes/event/user_deleted.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
defined('MOODLE_INTERNAL') || die();

/**
* Event when user profile is deleted.
* User deleted event class.
*
* @property-read array $other {
* Extra information about event.
Expand Down Expand Up @@ -117,23 +117,23 @@ protected function validate_data() {
parent::validate_data();

if (!isset($this->other['username'])) {
throw new \coding_exception('username must be set in $other.');
throw new \coding_exception('The \'username\' value must be set in other.');
}

if (!isset($this->other['email'])) {
throw new \coding_exception('email must be set in $other.');
throw new \coding_exception('The \'email\' value must be set in other.');
}

if (!isset($this->other['idnumber'])) {
throw new \coding_exception('idnumber must be set in $other.');
throw new \coding_exception('The \'idnumber\' value must be set in other.');
}

if (!isset($this->other['picture'])) {
throw new \coding_exception('picture must be set in $other.');
throw new \coding_exception('The \'picture\' value must be set in other.');
}

if (!isset($this->other['mnethostid'])) {
throw new \coding_exception('mnethostid must be set in $other.');
throw new \coding_exception('The \'mnethostid\' value must be set in other.');
}
}
}
2 changes: 1 addition & 1 deletion lib/classes/event/user_enrolment_created.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ protected function validate_data() {
}

if (!isset($this->other['enrol'])) {
throw new \coding_exception('The \'enrol\' value must be set in $other.');
throw new \coding_exception('The \'enrol\' value must be set in other.');
}
}
}
6 changes: 3 additions & 3 deletions lib/classes/event/user_enrolment_deleted.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,13 @@ protected function get_legacy_logdata() {
protected function validate_data() {
parent::validate_data();
if (!isset($this->other['userenrolment'])) {
throw new \coding_exception('User enrolment must be set in $other.');
throw new \coding_exception('The \'userenrolment\' value must be set in other.');
}
if (!isset($this->other['enrol'])) {
throw new \coding_exception('Enrolment plugin name must be set in $other.');
throw new \coding_exception('The \'enrol\' value must be set in other.');
}
if (!isset($this->relateduserid)) {
throw new \coding_exception('Related user id must be set.');
throw new \coding_exception('The \'relateduserid\' must be set.');
}
}
}
4 changes: 2 additions & 2 deletions lib/classes/event/user_enrolment_updated.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ protected function get_legacy_eventdata() {
protected function validate_data() {
parent::validate_data();
if (!isset($this->other['enrol'])) {
throw new \coding_exception('Enrolment plugin name must be set in $other.');
throw new \coding_exception('The \'enrol\' value must be set in other.');
}
if (!isset($this->relateduserid)) {
throw new \coding_exception('Related user id must be set.');
throw new \coding_exception('The \'relateduserid\' must be set.');
}
}
}
4 changes: 2 additions & 2 deletions lib/classes/event/user_password_updated.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,11 @@ protected function validate_data() {
parent::validate_data();

if (!$this->relateduserid) {
throw new \coding_exception('relateduserid needs to be set.');
throw new \coding_exception('The \'relateduserid\' must be set.');
}

if (!isset($this->other['forgottenreset'])) {
throw new \coding_exception('forgottenreset needs to be set in $other.');
throw new \coding_exception('The \'forgottenreset\' value must be set in other.');
}
}
}
2 changes: 1 addition & 1 deletion lib/classes/event/webservice_login_failed.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ protected function validate_data() {
} else if (!isset($this->other['method'])) {
throw new \coding_exception('The \'method\' value must be set in other.');
} else if (isset($this->other['token'])) {
throw new \coding_exception('The token cannot be set in $other.');
throw new \coding_exception('The \'token\' value must not be set in other.');
}
}
}
3 changes: 2 additions & 1 deletion lib/classes/event/webservice_service_user_added.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,13 @@ protected function init() {
/**
* Custom validation.
*
* @throws \coding_exception
* @return void
*/
protected function validate_data() {
parent::validate_data();
if (!isset($this->relateduserid)) {
throw new \coding_exception('The relateduserid must be set.');
throw new \coding_exception('The \'relateduserid\' must be set.');
}
}

Expand Down
3 changes: 2 additions & 1 deletion lib/classes/event/webservice_service_user_removed.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,13 @@ protected function init() {
/**
* Custom validation.
*
* @throws \coding_exception
* @return void
*/
protected function validate_data() {
parent::validate_data();
if (!isset($this->relateduserid)) {
throw new \coding_exception('The relateduserid must be set.');
throw new \coding_exception('The \'relateduserid\' must be set.');
}
}

Expand Down
1 change: 0 additions & 1 deletion mod/chat/classes/event/message_sent.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,4 @@ protected function validate_data() {
throw new \coding_exception('The \'relateduserid\' must be set.');
}
}

}
1 change: 0 additions & 1 deletion mod/workshop/classes/event/assessable_uploaded.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,5 +135,4 @@ protected function init() {
public function set_legacy_logdata($legacylogdata) {
$this->legacylogdata = $legacylogdata;
}

}
1 change: 0 additions & 1 deletion report/completion/classes/event/report_viewed.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,3 @@ protected function validate_data() {
}
}
}

1 change: 0 additions & 1 deletion report/completion/classes/event/user_report_viewed.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,3 @@ protected function validate_data() {
}
}
}

3 changes: 1 addition & 2 deletions report/log/classes/event/report_viewed.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,8 @@ protected function validate_data() {
throw new \coding_exception('The \'logformat\' value must be set in other.');
}

if (!isset($this->data['relateduserid'])) {
if (!isset($this->relateduserid)) {
throw new \coding_exception('The \'relateduserid\' must be set.');
}
}
}

3 changes: 1 addition & 2 deletions report/log/classes/event/user_report_viewed.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,8 @@ protected function validate_data() {
throw new \coding_exception('The \'mode\' value must be set in other.');
}

if (empty($this->data['relateduserid'])) {
if (empty($this->relateduserid)) {
throw new \coding_exception('The \'relateduserid\' must be set.');
}
}
}

1 change: 0 additions & 1 deletion report/loglive/classes/event/report_viewed.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,3 @@ public function get_url() {
return new \moodle_url('/report/loglive/index.php', array('id' => $this->courseid));
}
}

2 changes: 1 addition & 1 deletion report/outline/classes/event/report_viewed.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ protected function validate_data() {
if (empty($this->other['mode'])) {
throw new \coding_exception('The \'mode\' value must be set in other.');
}
if (empty($this->data['relateduserid'])) {
if (empty($this->relateduserid)) {
throw new \coding_exception('The \'relateduserid\' must be set.');
}
}
Expand Down
2 changes: 1 addition & 1 deletion report/stats/classes/event/report_viewed.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ protected function validate_data() {
throw new \coding_exception('The \'mode\' value must be set in other.');
}

if (!isset($this->data['relateduserid'])) {
if (!isset($this->relateduserid)) {
throw new \coding_exception('The \'relateduserid\' must be set.');
}
}
Expand Down
Loading

0 comments on commit e687396

Please sign in to comment.