MDL-59362 core: ensure we use 'new' when throwing exceptions

This commit is contained in:
Mark Nelson
2017-06-26 13:10:31 +08:00
parent cccb1a6d21
commit d971e7dffe
3 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -146,7 +146,7 @@ class core_plugin_manager {
public function get_plugin_types() {
if (func_num_args() > 0) {
if (!func_get_arg(0)) {
throw coding_exception('core_plugin_manager->get_plugin_types() does not support relative paths.');
throw new coding_exception('core_plugin_manager->get_plugin_types() does not support relative paths.');
}
}
if ($this->plugintypes) {
+2 -2
View File
@@ -3651,7 +3651,7 @@ class breadcrumb_navigation_node extends navigation_node {
$this->$key = $value;
}
} else {
throw coding_exception('Not a valid breadcrumb_navigation_node');
throw new coding_exception('Not a valid breadcrumb_navigation_node');
}
}
@@ -3705,7 +3705,7 @@ class flat_navigation_node extends navigation_node {
$this->$key = $value;
}
} else {
throw coding_exception('Not a valid flat_navigation_node');
throw new coding_exception('Not a valid flat_navigation_node');
}
$this->indent = $indent;
}