X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fhtmlform%2FHTMLFormField.php;h=71aa27544983e5f0739008f21e56258b67557eef;hb=ff70e103def9601f40836cbd9022e1267200510e;hp=8604ba2098da405a005f7532e0ca3d8cee4179ba;hpb=e14ac4bcb8136332694ce417213b2a6099c44c6f;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/htmlform/HTMLFormField.php b/includes/htmlform/HTMLFormField.php index 8604ba2098..71aa275449 100644 --- a/includes/htmlform/HTMLFormField.php +++ b/includes/htmlform/HTMLFormField.php @@ -42,7 +42,7 @@ abstract class HTMLFormField { * * @return string Valid HTML. */ - abstract function getInputHTML( $value ); + abstract public function getInputHTML( $value ); /** * Same as getInputHTML, but returns an OOUI object. @@ -51,7 +51,7 @@ abstract class HTMLFormField { * @param string $value * @return OOUI\Widget|false */ - function getInputOOUI( $value ) { + public function getInputOOUI( $value ) { return false; } @@ -74,7 +74,7 @@ abstract class HTMLFormField { * * @return Message */ - function msg() { + public function msg() { $args = func_get_args(); if ( $this->mParent ) { @@ -266,7 +266,7 @@ abstract class HTMLFormField { * @param array $alldata The data collected from the form * @return bool */ - function isHidden( $alldata ) { + public function isHidden( $alldata ) { if ( !$this->mHideIf ) { return false; } @@ -284,7 +284,7 @@ abstract class HTMLFormField { * * @return bool True to cancel the submission */ - function cancelSubmit( $value, $alldata ) { + public function cancelSubmit( $value, $alldata ) { return false; } @@ -296,10 +296,10 @@ abstract class HTMLFormField { * @param string|array $value The value the field was submitted with * @param array $alldata The data collected from the form * - * @return bool|string True on success, or String error to display, or + * @return bool|string|Message True on success, or String/Message error to display, or * false to fail validation without displaying an error. */ - function validate( $value, $alldata ) { + public function validate( $value, $alldata ) { if ( $this->isHidden( $alldata ) ) { return true; } @@ -308,7 +308,7 @@ abstract class HTMLFormField { && $this->mParams['required'] !== false && $value === '' ) { - return $this->msg( 'htmlform-required' )->parse(); + return $this->msg( 'htmlform-required' ); } if ( isset( $this->mValidationCallback ) ) { @@ -318,7 +318,7 @@ abstract class HTMLFormField { return true; } - function filter( $value, $alldata ) { + public function filter( $value, $alldata ) { if ( isset( $this->mFilterCallback ) ) { $value = call_user_func( $this->mFilterCallback, $value, $alldata, $this->mParent ); } @@ -370,7 +370,7 @@ abstract class HTMLFormField { * @param WebRequest $request * @return string The value */ - function loadDataFromRequest( $request ) { + public function loadDataFromRequest( $request ) { if ( $request->getCheck( $this->mName ) ) { return $request->getText( $this->mName ); } else { @@ -386,7 +386,7 @@ abstract class HTMLFormField { * @since 1.22 The 'label' attribute no longer accepts raw HTML, use 'label-raw' instead * @throws MWException */ - function __construct( $params ) { + public function __construct( $params ) { $this->mParams = $params; if ( isset( $params['parent'] ) && $params['parent'] instanceof HTMLForm ) { @@ -472,7 +472,7 @@ abstract class HTMLFormField { * * @return string Complete HTML table row. */ - function getTableRow( $value ) { + public function getTableRow( $value ) { list( $errors, $errorClass ) = $this->getErrorsAndErrorClass( $value ); $inputHtml = $this->getInputHTML( $value ); $fieldType = get_class( $this ); @@ -821,7 +821,7 @@ abstract class HTMLFormField { /** * Determine the help text to display * @since 1.20 - * @return string HTML + * @return string|null HTML */ public function getHelpText() { $helptext = null; @@ -903,7 +903,7 @@ abstract class HTMLFormField { * @since 1.28 * @return string[] */ - function getNotices() { + public function getNotices() { $notices = []; if ( isset( $this->mParams['notice-message'] ) ) { @@ -924,11 +924,11 @@ abstract class HTMLFormField { /** * @return string HTML */ - function getLabel() { + public function getLabel() { return is_null( $this->mLabel ) ? '' : $this->mLabel; } - function getLabelHtml( $cellAttributes = [] ) { + public function getLabelHtml( $cellAttributes = [] ) { # Don't output a for= attribute for labels with no associated input. # Kind of hacky here, possibly we don't want these to be