MDL-53251 tool_lp: Apply PHP7 fixes

This commit is contained in:
Frederic Massart 2016-02-26 09:46:15 +08:00
parent 8e3eb9f865
commit a8f1af5e6f
3 changed files with 3 additions and 8 deletions

View file

@ -43,14 +43,12 @@ class tool_lp_course_competencies_form_element extends MoodleQuickForm_autocompl
/** /**
* Constructor * Constructor
* *
* @TODO: Convert this to a real constructor when the PHP7 changes are merged.
*
* @param string $elementName Element name * @param string $elementName Element name
* @param mixed $elementLabel Label(s) for an element * @param mixed $elementLabel Label(s) for an element
* @param array $options Options to control the element's display * @param array $options Options to control the element's display
* @param mixed $attributes Either a typical HTML attribute string or an associative array. * @param mixed $attributes Either a typical HTML attribute string or an associative array.
*/ */
function tool_lp_course_competencies_form_element($elementName=null, $elementLabel=null, $options=array(), $attributes=null) { public function __construct($elementName=null, $elementLabel=null, $options=array(), $attributes=null) {
global $OUTPUT; global $OUTPUT;
if ($elementName == null) { if ($elementName == null) {

View file

@ -45,14 +45,12 @@ class tool_lp_course_competency_rule_form_element extends MoodleQuickForm_select
/** /**
* Constructor * Constructor
* *
* @TODO: Convert this to a real constructor when the PHP7 changes are merged.
*
* @param string $elementName Element name * @param string $elementName Element name
* @param mixed $elementLabel Label(s) for an element * @param mixed $elementLabel Label(s) for an element
* @param array $options Options to control the element's display * @param array $options Options to control the element's display
* @param mixed $attributes Either a typical HTML attribute string or an associative array. * @param mixed $attributes Either a typical HTML attribute string or an associative array.
*/ */
function tool_lp_course_competency_rule_form_element($elementName=null, $elementLabel=null, $options=array(), $attributes=null) { public function __construct($elementName=null, $elementLabel=null, $options=array(), $attributes=null) {
global $OUTPUT; global $OUTPUT;
if ($elementName == null) { if ($elementName == null) {

View file

@ -104,9 +104,8 @@ abstract class persistent extends moodleform {
$this->persistent = new static::$persistentclass(); $this->persistent = new static::$persistentclass();
$this->persistent->from_record($persistendata); $this->persistent->from_record($persistendata);
// TODO Make PHP7 compatible.
unset($customdata['persistent']); unset($customdata['persistent']);
parent::moodleform($action, $customdata, $method, $target, $attributes, $editable); parent::__construct($action, $customdata, $method, $target, $attributes, $editable);
// Load the defaults. // Load the defaults.
$this->set_data($this->get_default_data()); $this->set_data($this->get_default_data());