MDL-57791 analytics: Add missing 'new' to throw
Also other code refinements. Credit to Mark Nelson.
This commit is contained in:
@@ -208,7 +208,7 @@ abstract class calculable {
|
||||
$match = false;
|
||||
|
||||
if (count($range) != 2) {
|
||||
throw \coding_exception('classify_value() $ranges array param should contain 2 items, the predicate ' .
|
||||
throw new \coding_exception('classify_value() $ranges array param should contain 2 items, the predicate ' .
|
||||
'e.g. greater (gt), lower or equal (le)... and the value.');
|
||||
}
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ class manager {
|
||||
*
|
||||
* @param bool $enabled
|
||||
* @param bool $trained
|
||||
* @param \context $predictioncontext
|
||||
* @param \context|false $predictioncontext
|
||||
* @return \core_analytics\model[]
|
||||
*/
|
||||
public static function get_all_models($enabled = false, $trained = false, $predictioncontext = false) {
|
||||
@@ -163,7 +163,7 @@ class manager {
|
||||
/**
|
||||
* Return all system predictions processors.
|
||||
*
|
||||
* @return \core_analytics\predictor
|
||||
* @return \core_analytics\predictor[]
|
||||
*/
|
||||
public static function get_all_prediction_processors() {
|
||||
|
||||
|
||||
@@ -145,7 +145,6 @@ class model {
|
||||
if (!$target) {
|
||||
return false;
|
||||
}
|
||||
$analyser = $this->get_target();
|
||||
|
||||
$classname = $target->get_analyser_class();
|
||||
if (!class_exists($classname)) {
|
||||
@@ -296,7 +295,7 @@ class model {
|
||||
|
||||
$classname = $target->get_analyser_class();
|
||||
if (!class_exists($classname)) {
|
||||
throw \coding_exception($classname . ' class does not exists');
|
||||
throw new \coding_exception($classname . ' class does not exists');
|
||||
}
|
||||
|
||||
// Returns a \core_analytics\local\analyser\base class.
|
||||
|
||||
Reference in New Issue
Block a user