Fixed invalid syntax for PHP 5.6.x

This commit is contained in:
Mark Nelson 2019-02-04 14:57:23 +08:00
parent cab793fb1d
commit 10630a6967
6 changed files with 6 additions and 6 deletions

View file

@ -389,7 +389,7 @@ class element_helper {
* @param int $elementid The element id * @param int $elementid The element id
* @return \context The context * @return \context The context
*/ */
public static function get_context(int $elementid) : \context { public static function get_context($elementid) {
global $DB; global $DB;
$sql = "SELECT ct.contextid $sql = "SELECT ct.contextid

View file

@ -63,7 +63,7 @@ class element extends \mod_customcert\element {
* *
* @return string * @return string
*/ */
protected function get_category_name() : string { protected function get_category_name() {
global $DB, $SITE; global $DB, $SITE;
$courseid = \mod_customcert\element_helper::get_courseid($this->get_id()); $courseid = \mod_customcert\element_helper::get_courseid($this->get_id());

View file

@ -63,7 +63,7 @@ class element extends \mod_customcert\element {
* *
* @return string * @return string
*/ */
protected function get_course_name() : string { protected function get_course_name() {
$courseid = \mod_customcert\element_helper::get_courseid($this->get_id()); $courseid = \mod_customcert\element_helper::get_courseid($this->get_id());
$course = get_course($courseid); $course = get_course($courseid);
$context = \mod_customcert\element_helper::get_context($this->get_id()); $context = \mod_customcert\element_helper::get_context($this->get_id());

View file

@ -114,7 +114,7 @@ class element extends \mod_customcert\element {
* *
* @return string * @return string
*/ */
protected function get_grade_item_name() : string { protected function get_grade_item_name() {
global $DB; global $DB;
// Get the course module information. // Get the course module information.

View file

@ -100,7 +100,7 @@ class element extends \mod_customcert\element {
* *
* @return string * @return string
*/ */
protected function get_text() : string { protected function get_text() {
$context = \mod_customcert\element_helper::get_context($this->get_id()); $context = \mod_customcert\element_helper::get_context($this->get_id());
return format_text($this->get_data(), FORMAT_HTML, ['context' => $context]); return format_text($this->get_data(), FORMAT_HTML, ['context' => $context]);
} }

View file

@ -133,7 +133,7 @@ class element extends \mod_customcert\element {
* @param bool $preview Is this a preview? * @param bool $preview Is this a preview?
* @return string * @return string
*/ */
protected function get_user_field_value(\stdClass $user, bool $preview) : string { protected function get_user_field_value(\stdClass $user, $preview) {
global $CFG, $DB; global $CFG, $DB;
// The user field to display. // The user field to display.