From 4d27bc7929a649daeefae64290cd54da898eed2f Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Fri, 17 Sep 2010 19:05:23 +0000 Subject: [PATCH] fixed phpdocs and using property_exists() which is required by PHP 5.3 --- grade/edit/tree/category.php | 4 ++-- grade/edit/tree/grade.php | 2 +- grade/edit/tree/item.php | 4 ++-- grade/edit/tree/outcomeitem.php | 4 ++-- grade/lib.php | 6 +++--- grade/report/user/lib.php | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/grade/edit/tree/category.php b/grade/edit/tree/category.php index 4513e12e814..e3cbdd1ff14 100644 --- a/grade/edit/tree/category.php +++ b/grade/edit/tree/category.php @@ -155,7 +155,7 @@ if ($mform->is_cancelled()) { $convert = array('grademax', 'grademin', 'gradepass', 'multfactor', 'plusfactor', 'aggregationcoef'); foreach ($convert as $param) { - if (array_key_exists($param, $itemdata)) { + if (property_exists($param, $itemdata)) { $itemdata->$param = unformat_float($itemdata->$param); } } @@ -184,7 +184,7 @@ if ($mform->is_cancelled()) { } // Handle null decimals value - must be done before update! - if (!array_key_exists('decimals', $itemdata) or $itemdata->decimals < 0) { + if (!property_exists('decimals', $itemdata) or $itemdata->decimals < 0) { $grade_item->decimals = null; } diff --git a/grade/edit/tree/grade.php b/grade/edit/tree/grade.php index 3ea0ac15f7a..71ec86f49b5 100644 --- a/grade/edit/tree/grade.php +++ b/grade/edit/tree/grade.php @@ -186,7 +186,7 @@ if ($mform->is_cancelled()) { } // the overriding of feedback is tricky - we have to care about external items only - if (!array_key_exists('feedback', $data) or $data->feedback == $data->oldfeedback) { + if (!property_exists('feedback', $data) or $data->feedback == $data->oldfeedback) { $data->feedback = $old_grade_grade->feedback; $data->feedbackformat = $old_grade_grade->feedbackformat; } diff --git a/grade/edit/tree/item.php b/grade/edit/tree/item.php index fc92793015b..deffd46f029 100644 --- a/grade/edit/tree/item.php +++ b/grade/edit/tree/item.php @@ -125,7 +125,7 @@ if ($mform->is_cancelled()) { $convert = array('grademax', 'grademin', 'gradepass', 'multfactor', 'plusfactor', 'aggregationcoef'); foreach ($convert as $param) { - if (array_key_exists($param, $data)) { + if (property_exists($param, $data)) { $data->$param = unformat_float($data->$param); } } @@ -135,7 +135,7 @@ if ($mform->is_cancelled()) { $grade_item->outcomeid = null; // Handle null decimals value - if (!array_key_exists('decimals', $data) or $data->decimals < 0) { + if (!property_exists('decimals', $data) or $data->decimals < 0) { $grade_item->decimals = null; } diff --git a/grade/edit/tree/outcomeitem.php b/grade/edit/tree/outcomeitem.php index e39fed5d3b9..aff2c934298 100644 --- a/grade/edit/tree/outcomeitem.php +++ b/grade/edit/tree/outcomeitem.php @@ -107,7 +107,7 @@ if ($data = $mform->get_data()) { $data->aggregationcoef = 0; } - if (array_key_exists('calculation', $data)) { + if (property_exists('calculation', $data)) { $data->calculation = grade_item::normalize_formula($data->calculation, $course->id); } @@ -123,7 +123,7 @@ if ($data = $mform->get_data()) { $convert = array('gradepass', 'aggregationcoef'); foreach ($convert as $param) { - if (array_key_exists($param, $data)) { + if (property_exists($param, $data)) { $data->$param = unformat_float($data->$param); } } diff --git a/grade/lib.php b/grade/lib.php index e58dbe1ac4f..65ce1c60efd 100644 --- a/grade/lib.php +++ b/grade/lib.php @@ -689,7 +689,7 @@ class grade_plugin_return { } else { foreach ($params as $key=>$value) { - if (array_key_exists($key, $this)) { + if (property_exists($key, $this)) { $this->$key = $value; } } @@ -1988,7 +1988,7 @@ class grade_tree extends grade_structure { /** * Local shortcut function for creating an edit/delete button for a grade_* object. - * @param strong $type 'edit' or 'delete' + * @param string $type 'edit' or 'delete' * @param int $courseid The Course ID * @param grade_* $object The grade_* object * @return string html @@ -2332,7 +2332,7 @@ abstract class grade_helper { /** * Get information on letters * @param int $courseid - * @return grade_plugin_info + * @return array */ public static function get_info_letters($courseid) { if (self::$letterinfo !== null) { diff --git a/grade/report/user/lib.php b/grade/report/user/lib.php index 7b6c12c572d..67f4fdc9f1f 100644 --- a/grade/report/user/lib.php +++ b/grade/report/user/lib.php @@ -106,7 +106,7 @@ class grade_report_user extends grade_report { $this->switch = grade_get_setting($this->courseid, 'aggregationposition', $CFG->grade_aggregationposition); // Grab the grade_tree for this course - $this->gtree = new grade_tree($this->courseid, false, $this->switch, false, !$CFG->enableoutcomes); + $this->gtree = new grade_tree($this->courseid, false, $this->switch, null, !$CFG->enableoutcomes); // Determine the number of rows and indentation $this->maxdepth = 1;