MDL-52081 forms: Use __construct() for constructors
This commit is contained in:
@@ -266,9 +266,8 @@ class HTML_QuickForm_date extends HTML_QuickForm_group
|
||||
* @param array Options to control the element's display
|
||||
* @param mixed Either a typical HTML attribute string or an associative array
|
||||
*/
|
||||
function HTML_QuickForm_date($elementName = null, $elementLabel = null, $options = array(), $attributes = null)
|
||||
{
|
||||
$this->HTML_QuickForm_element($elementName, $elementLabel, $attributes);
|
||||
public function __construct($elementName = null, $elementLabel = null, $options = array(), $attributes = null) {
|
||||
HTML_QuickForm_element::__construct($elementName, $elementLabel, $attributes);
|
||||
$this->_persistantFreeze = true;
|
||||
$this->_appendName = true;
|
||||
$this->_type = 'date';
|
||||
@@ -288,6 +287,16 @@ class HTML_QuickForm_date extends HTML_QuickForm_group
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Old syntax of class constructor. Deprecated in PHP7.
|
||||
*
|
||||
* @deprecated since Moodle 3.1
|
||||
*/
|
||||
public function HTML_QuickForm_date($elementName = null, $elementLabel = null, $options = array(), $attributes = null) {
|
||||
debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
|
||||
self::__construct($elementName, $elementLabel, $options, $attributes);
|
||||
}
|
||||
|
||||
// }}}
|
||||
// {{{ _createElements()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user