Commit dde244c0 authored by Frederic Massart's avatar Frederic Massart
Browse files

MDL-39954 event: Fixed namespace issue with \coding_exception

parent 0528361c
......@@ -55,12 +55,12 @@ abstract class assessable_submitted extends \core\event\base {
/**
* Custom validation.
*
* @throws coding_exception on error.
* @throws \coding_exception on error.
* @return void
*/
protected function validate_data() {
if (!$this->context->contextlevel === CONTEXT_MODULE) {
throw new coding_exception('Content level must be CONTEXT_MODULE.');
throw new \coding_exception('Content level must be CONTEXT_MODULE.');
}
}
......
......@@ -55,16 +55,16 @@ abstract class assessable_uploaded extends \core\event\base {
/**
* Validation that should be shared among child classes.
*
* @throws coding_exception when validation fails.
* @throws \coding_exception when validation fails.
* @return void
*/
protected function validate_data() {
if (!$this->context->contextlevel === CONTEXT_MODULE) {
throw new coding_exception('Content level must be CONTEXT_MODULE.');
throw new \coding_exception('Content level must be CONTEXT_MODULE.');
} else if (!isset($this->other['pathnamehashes']) || !is_array($this->other['pathnamehashes'])) {
throw new coding_exception('pathnamehashes must be set in $other and must be an array.');
throw new \coding_exception('pathnamehashes must be set in $other and must be an array.');
} else if (!isset($this->other['content']) || !is_string($this->other['content'])) {
throw new coding_exception('content must be set in $other and must be a string.');
throw new \coding_exception('content must be set in $other and must be a string.');
}
}
......
......@@ -126,13 +126,13 @@ class assessable_submitted extends \core\event\assessable_submitted {
/**
* Custom validation.
*
* @throws coding_exception
* @throws \coding_exception
* @return void
*/
protected function validate_data() {
parent::validate_data();
if (!isset($this->other['submission_editable'])) {
throw new coding_exception('Other must contain the key submission_editable.');
throw new \coding_exception('Other must contain the key submission_editable.');
}
}
}
......@@ -104,13 +104,13 @@ class assessable_uploaded extends \core\event\assessable_uploaded {
/**
* Custom validation
*
* @throws coding_exception
* @throws \coding_exception
* @return void
*/
protected function validate_data() {
parent::validate_data();
if (!isset($this->other['triggeredfrom'])) {
throw new coding_exception('triggeredfrom must be set in $other');
throw new \coding_exception('triggeredfrom must be set in $other');
}
}
}
......@@ -109,13 +109,13 @@ class assessable_submitted extends \core\event\assessable_submitted {
/**
* Custom validation
*
* @throws coding_exception
* @throws \coding_exception
* @return void
*/
protected function validate_data() {
parent::validate_data();
if (!isset($this->other['submission_editable'])) {
throw new coding_exception('Other must contain the key submission_editable.');
throw new \coding_exception('Other must contain the key submission_editable.');
}
}
}
......@@ -104,15 +104,15 @@ class assessable_uploaded extends \core\event\assessable_uploaded {
/**
* Custom validation.
*
* @throws coding_exception
* @throws \coding_exception
* @return void
*/
protected function validate_data() {
parent::validate_data();
if (!isset($this->other['discussionid'])) {
throw new coding_exception('discussionid must be set in $other.');
throw new \coding_exception('discussionid must be set in $other.');
} else if (!isset($this->other['triggeredfrom'])) {
throw new coding_exception('triggeredfrom must be set in $other');
throw new \coding_exception('triggeredfrom must be set in $other');
}
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment