MDL-32094 some more E_STRICT fixes

This commit is contained in:
Petr Skoda
2012-03-18 20:40:20 +01:00
parent 990e4b0ee9
commit e2bb3c9275
17 changed files with 21 additions and 25 deletions
@@ -54,18 +54,11 @@ class XMLDBAction {
var $sesskey_protected; // Actions must be protected by sesskey mechanism
/**
* Constructor
*/
function XMLDBAction() {
$this->init();
}
/**
* Constructor to keep PHP5 happy
*/
function __construct() {
$this->XMLDBAction();
$this->init();
}
/**
+1 -1
View File
@@ -215,7 +215,7 @@ class auth_plugin_cas extends auth_plugin_ldap {
* @param object object with submitted configuration settings (without system magic quotes)
* @param array $err array of error messages
*/
function validate_form(&$form, &$err) {
function validate_form($form, &$err) {
$certificate_path = trim($form->certificate_path);
if ($form->certificate_check && empty($certificate_path)) {
$err['certificate_path'] = get_string('auth_cas_certificate_path_empty', 'auth_cas');
+2 -2
View File
@@ -355,7 +355,7 @@ class grade_edit_tree {
* @param string type "extra" or "weight": the type of the column hosting the weight input
* @return string HTML
*/
function get_weight_input($item, $type) {
static function get_weight_input($item, $type) {
global $OUTPUT;
if (!is_object($item) || get_class($item) !== 'grade_item') {
@@ -387,7 +387,7 @@ class grade_edit_tree {
//Trims trailing zeros
//Used on the 'categories and items' page for grade items settings like aggregation co-efficient
//Grader report has its own decimal place settings so they are handled elsewhere
function format_number($number) {
static function format_number($number) {
$formatted = rtrim(format_float($number, 4),'0');
if (substr($formatted, -1)=='.') { //if last char is the decimal point
$formatted .= '0';
+1 -1
View File
@@ -1207,7 +1207,7 @@ class grade_report_grader extends grade_report {
foreach ($this->gtree->items as $itemid=>$unused) {
// emulate grade element
$item =& $this->gtree->get_item($itemid);
$item = $this->gtree->get_item($itemid);
$eid = $this->gtree->get_item_eid($item);
$element = $this->gtree->locate_element($eid);
+1 -1
View File
@@ -366,7 +366,7 @@ class auth_plugin_base {
* @param object object with submitted configuration settings (without system magic quotes)
* @param array $err array of error messages
*/
function validate_form(&$form, &$err) {
function validate_form($form, &$err) {
//override if needed
}
+1 -1
View File
@@ -356,7 +356,7 @@ function cron_run() {
require_once($CFG->dirroot . '/blog/lib.php');
mtrace("Fetching external blog entries...", '');
$sql = "timefetched < ? OR timefetched = 0";
$externalblogs = $DB->get_records_select('blog_external', $sql, array(mktime() - $CFG->externalblogcrontime));
$externalblogs = $DB->get_records_select('blog_external', $sql, array(time() - $CFG->externalblogcrontime));
foreach ($externalblogs as $eb) {
blog_sync_external_entries($eb);
+1 -1
View File
@@ -108,7 +108,7 @@ class MoodleQuickForm_date_selector extends MoodleQuickForm_group
$this->_elements[] = @MoodleQuickForm::createElement('select', 'year', get_string('year', 'form'), $years, $this->getAttributes(), true);
// If optional we add a checkbox which the user can use to turn if on
if($this->_options['optional']) {
$this->_elements[] =& MoodleQuickForm::createElement('checkbox', 'enabled', null, get_string('enable'), $this->getAttributes(), true);
$this->_elements[] =@MoodleQuickForm::createElement('checkbox', 'enabled', null, get_string('enable'), $this->getAttributes(), true);
}
foreach ($this->_elements as $element){
if (method_exists($element, 'setHiddenLabel')){
+2 -1
View File
@@ -1011,7 +1011,8 @@ class grade_category extends grade_object {
'children'=>$course_category->get_children($include_category_items));
$course_category->sortorder = $course_category->get_sortorder();
return grade_category::_fetch_course_tree_recursion($category_array, $course_category->get_sortorder());
$sortorder = $course_category->get_sortorder();
return grade_category::_fetch_course_tree_recursion($category_array, $sortorder);
}
/**
+2 -1
View File
@@ -73,7 +73,7 @@ class question_category_list extends moodle_list {
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class question_category_list_item extends list_item {
public function set_icon_html($first, $last, &$lastitem){
public function set_icon_html($first, $last, $lastitem){
global $CFG;
$category = $this->item;
$url = new moodle_url('/question/category.php', ($this->parentlist->pageurl->params() + array('edit'=>$category->id)));
@@ -155,6 +155,7 @@ class question_category_object {
$this->tab = str_repeat('&nbsp;', $this->tabsize);
$this->str = new stdClass();
$this->str->course = get_string('course');
$this->str->category = get_string('category', 'question');
$this->str->categoryinfo = get_string('categoryinfo', 'question');
+1 -1
View File
@@ -58,7 +58,7 @@ class qformat_aiken extends qformat_default {
return true;
}
public function readquestions($lines) {
public function readquestions($lines, $context) {
$questions = array();
$question = $this->defaultquestion();
$endchar = chr(13);
+1 -1
View File
@@ -41,7 +41,7 @@ class qformat_blackboard extends qformat_default {
return true;
}
function readquestions ($lines) {
function readquestions ($lines, $context) {
/// Parses an array of lines into an array of questions,
/// where each item is a question object as defined by
/// readquestion().
+1 -1
View File
@@ -243,7 +243,7 @@ class qformat_blackboard_six extends qformat_default {
function readquestions ($lines) {
protected function readquestions ($lines, $context) {
/// Parses an array of lines into an array of questions,
/// where each item is a question object as defined by
/// readquestion().
+1 -1
View File
@@ -149,7 +149,7 @@ class qformat_examview extends qformat_default {
return str_replace('&#x2019;', "'", $text);
}
function readquestions($lines) {
protected function readquestions($lines, $context) {
/// Parses an array of lines into an array of questions,
/// where each item is a question object as defined by
/// readquestion().
+1 -1
View File
@@ -46,7 +46,7 @@ class qformat_learnwise extends qformat_default {
return true;
}
function readquestions($lines) {
protected function readquestions($lines, $context) {
$questions = array();
$currentquestion = array();
+1 -1
View File
@@ -40,7 +40,7 @@ class qformat_multianswer extends qformat_default {
return true;
}
protected function readquestions($lines) {
protected function readquestions($lines, $context) {
// For this class the method has been simplified as
// there can never be more than one question for a
// multianswer import
+1 -1
View File
@@ -172,7 +172,7 @@ class qformat_webct extends qformat_default {
return true;
}
function readquestions ($lines) {
protected function readquestions($lines, $context) {
$webctnumberregex =
'[+-]?([0-9]+(\\.[0-9]*)?|\\.[0-9]+)((e|E|\\*10\\*\\*)([+-]?[0-9]+|\\([+-]?[0-9]+\\)))?';
+2 -1
View File
@@ -886,9 +886,10 @@ class qformat_xml extends qformat_default {
* this *could* burn memory - but it won't happen that much
* so fingers crossed!
* @param array of lines from the input file.
* @param stdClass $context
* @return array (of objects) question objects.
*/
protected function readquestions($lines) {
protected function readquestions($lines, $context) {
// We just need it as one big string
$text = implode($lines, ' ');
unset($lines);