Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-31006 some more PHP54 notices

PHP54 compatibility - PhpStorm IDE is the best tool for this kind of work!!
  • Loading branch information...
commit 9159aeb465605041416e75ab94b72c032925dba2 1 parent bda9b60
@skodak skodak authored stronk7 committed
View
1  backup/restorelib.php
@@ -461,6 +461,7 @@ function restore_create_events($restore,$xml_file) {
}
//Now build the EVENT record structure
+ $eve = new stdClass();
$eve->name = backup_todb($info['EVENT']['#']['NAME']['0']['#']);
$eve->description = backup_todb($info['EVENT']['#']['DESCRIPTION']['0']['#']);
$eve->format = backup_todb($info['EVENT']['#']['FORMAT']['0']['#']);
View
2  backup/util/helper/restore_decode_rule.class.php
@@ -151,7 +151,7 @@ protected function validate_params($linkname, $urltemplate, $mappings) {
$countma = count($mappings);
// Check mappings number matches placeholders
if ($countph != $countma) {
- $msg = new stdclass();
+ $a = new stdClass();
$a->placeholders = $countph;
$a->mappings = $countma;
throw new restore_decode_rule_exception('decode_rule_mappings_incorrect_count', $a);
View
1  course/lib.php
@@ -147,6 +147,7 @@ function build_mnet_logs_array($hostid, $course, $user=0, $date=0, $order="l.tim
$groupid = 0;
$joins = array();
+ $where = '';
$qry = "SELECT l.*, u.firstname, u.lastname, u.picture
FROM {mnet_log} l
View
9 enrol/imsenterprise/lib.php
@@ -564,6 +564,8 @@ function process_membership_tag($tagcontents){
// In order to reduce the number of db queries required, group name/id associations are cached in this array:
$groupids = array();
+ $ship = new stdClass();
+
if(preg_match('{<sourcedid>.*?<id>(.+?)</id>.*?</sourcedid>}is', $tagcontents, $matches)){
$ship->coursecode = ($truncatecoursecodes > 0)
? substr(trim($matches[1]), 0, intval($truncatecoursecodes))
@@ -575,8 +577,8 @@ function process_membership_tag($tagcontents){
$courseobj->id = $ship->courseid;
foreach($membermatches as $mmatch){
- unset($member);
- unset($memberstoreobj);
+ $member = new stdClass();
+ $memberstoreobj = new stdClass();
if(preg_match('{<sourcedid>.*?<id>(.+?)</id>.*?</sourcedid>}is', $mmatch[1], $matches)){
$member->idnumber = trim($matches[1]);
}
@@ -596,6 +598,7 @@ function process_membership_tag($tagcontents){
//echo "<p>process_membership_tag: unenrolling member due to recstatus of 3</p>";
}
+ $timeframe = new stdClass();
$timeframe->begin = 0;
$timeframe->end = 0;
if(preg_match('{<role\b.*?<timeframe>(.+?)</timeframe>.*?</role>}is', $mmatch[1], $matches)){
@@ -654,6 +657,7 @@ function process_membership_tag($tagcontents){
$groupids[$member->groupname] = $groupid; // Store ID in cache
} else {
// Attempt to create the group
+ $group = new stdClass();
$group->name = $member->groupname;
$group->courseid = $ship->courseid;
$group->timecreated = time();
@@ -726,6 +730,7 @@ function log_line($string){
* Process the INNER contents of a <timeframe> tag, to return beginning/ending dates.
*/
function decode_timeframe($string){ // Pass me the INNER CONTENTS of a <timeframe> tag - beginning and/or ending is returned, in unix time, zero indicating not specified
+ $ret = new stdClass();
$ret->begin = $ret->end = 0;
// Explanatory note: The matching will ONLY match if the attribute restrict="1"
// because otherwise the time markers should be ignored (participation should be
View
1  lib/simpletest/fixtures/gradetest.php
@@ -291,6 +291,7 @@ function load_course_modules() {
global $DB;
$course_module = new stdClass();
$course_module->course = $this->courseid;
+ $quiz = new stdClass();
$quiz->module = 1;
$quiz->instance = 2;
$course_module->id = $DB->insert_record('course_modules', $course_module);
View
4 message/lib.php
@@ -946,7 +946,7 @@ function message_add_contact($contactid, $blocked=0) {
} else {
/// new contact record
- unset($contact);
+ $contact = new stdClass();
$contact->userid = $USER->id;
$contact->contactid = $contactid;
$contact->blocked = $blocked;
@@ -1646,7 +1646,7 @@ function message_search($searchterms, $fromme=true, $tome=true, $courseid='none'
/// The keys may be duplicated in $m_read and $m_unread so we can't
/// do a simple concatenation
- $message = array();
+ $messages = array();
foreach ($m_read as $m) {
$messages[] = $m;
}
View
1  mod/lesson/format.php
@@ -158,6 +158,7 @@ function lesson_save_question_options($question, $lesson) {
case LESSON_PAGE_TRUEFALSE:
// the truth
+ $answer = new stdClass();
$answer->lessonid = $question->lessonid;
$answer->pageid = $question->id;
$answer->timecreated = $timenow;
View
4 mod/lesson/lib.php
@@ -171,9 +171,9 @@ function lesson_user_outline($course, $user, $mod, $lesson) {
//if grade was last modified by the user themselves use date graded. Otherwise use date submitted
//TODO: move this copied & pasted code somewhere in the grades API. See MDL-26704
if ($grade->usermodified == $user->id || empty($grade->datesubmitted)) {
- $result->time = $grade->dategraded;
+ $return->time = $grade->dategraded;
} else {
- $result->time = $grade->datesubmitted;
+ $return->time = $grade->datesubmitted;
}
}
return $return;
View
2  mod/lesson/pagetypes/essay.php
@@ -166,6 +166,7 @@ public function stats(array &$pagestats, $tries) {
$essaystats->total++;
$pagestats[$temp->pageid] = $essaystats;
} else {
+ $essaystats = new stdClass();
$essaystats->totalscore = $essayinfo->score;
$essaystats->total = 1;
$pagestats[$temp->pageid] = $essaystats;
@@ -207,6 +208,7 @@ public function report_answers($answerpage, $answerdata, $useranswer, $pagestats
$answerdata->score = get_string("havenotgradedyet", "lesson");
}
} else {
+ $essayinfo = new stdClass();
$essayinfo->answer = get_string("didnotanswerquestion", "lesson");
}
View
1  mod/quiz/lib.php
@@ -1431,6 +1431,7 @@ function quiz_num_attempt_summary($quiz, $cm, $returnzero = false, $currentgroup
$numattempts = $DB->count_records('quiz_attempts', array('quiz'=> $quiz->id, 'preview'=>0));
if ($numattempts || $returnzero) {
if (groups_get_activity_groupmode($cm)) {
+ $a = new stdClass();
$a->total = $numattempts;
if ($currentgroup) {
$a->group = $DB->count_records_sql('SELECT COUNT(DISTINCT qa.id) FROM ' .
View
1  mod/survey/lib.php
@@ -511,6 +511,7 @@ function survey_get_template_name($templateid) {
*/
function survey_shorten_name ($name, $numwords) {
$words = explode(" ", $name);
+ $output = '';
for ($i=0; $i < $numwords; $i++) {
$output .= $words[$i]." ";
}
View
1  question/behaviour/deferredcbm/renderer.php
@@ -88,6 +88,7 @@ public function feedback(question_attempt $qa, question_display_options $options
}
if ($options->marks >= question_display_options::MARK_AND_MAX) {
+ $a = new stdClass();
$a->rawmark = format_float($qa->get_last_behaviour_var('_rawfraction') *
$qa->get_max_mark(), $options->markdp);
$a->mark = $qa->format_mark($options->markdp);
View
2  question/engine/questionusage.php
@@ -354,7 +354,7 @@ public function render_question($slot, $options, $number = null) {
* @return string HTML fragment.
*/
public function render_question_head_html($slot) {
- $options->context = $this->context;
+ //$options->context = $this->context;
return $this->get_question_attempt($slot)->render_head_html();
}
View
2  question/format/blackboard_six/format.php
@@ -507,7 +507,7 @@ function process_responses($bb_responses, &$responses) {
//Added this line to instantiate $response.
// Without instantiating the $response variable, the same object
// gets added to the array
- $response = null;
+ $response = new stdClass();
if (isset($bb_response['@']['title'])) {
$response->title = $bb_response['@']['title'];
}
View
2  question/type/randomsamatch/questiontype.php
@@ -62,10 +62,12 @@ public function get_question_options($question) {
public function save_question_options($question) {
global $DB;
+ $options = new stdClass();
$options->question = $question->id;
$options->choose = $question->choose;
if (2 > $question->choose) {
+ $result = new stdClass();
$result->error = "At least two shortanswer questions need to be chosen!";
return $result;
}
View
3  webservice/simpletest/testwebservice.php
@@ -845,8 +845,9 @@ function moodle_user_update_users($client) {
// custom fields
if(!empty($user1->customfields)) {
+ $customuser1 = new stdClass();
+ $customuser1->id = $user1->id;
foreach($user1->customfields as $customfield) {
- $customuser1->id = $user1->id;
$customuser1->{"profile_field_".$customfield['type']} = $customfield['value'];
}
profile_save_data((object) $customuser1);
Please sign in to comment.
Something went wrong with that request. Please try again.