MDL-52081 forms: Use __construct() for constructors

This commit is contained in:
Marina Glancy
2015-12-10 13:38:01 +08:00
parent 0dfcc2541a
commit 1a0df5535e
83 changed files with 1014 additions and 208 deletions
+12 -3
View File
@@ -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()