parent::__construct( $params );
if ( isset( $params['placeholder-message'] ) ) {
- $this->mPlaceholder = $this->getMessage( $params['placeholder-message'] )->parse();
+ $this->mPlaceholder = $this->getMessage( $params['placeholder-message'] )->text();
} elseif ( isset( $params['placeholder'] ) ) {
$this->mPlaceholder = $params['placeholder'];
}
}
public function getSize() {
- return isset( $this->mParams['size'] ) ? $this->mParams['size'] : 45;
+ return $this->mParams['size'] ?? 45;
}
public function getSpellCheck() {
- $val = isset( $this->mParams['spellcheck'] ) ? $this->mParams['spellcheck'] : null;
+ $val = $this->mParams['spellcheck'] ?? null;
if ( is_bool( $val ) ) {
// "spellcheck" attribute literally requires "true" or "false" to work.
return $val === true ? 'true' : 'false';
}
protected function getType( &$attribs ) {
- $type = isset( $attribs['type'] ) ? $attribs['type'] : 'text';
+ $type = $attribs['type'] ?? 'text';
unset( $attribs['type'] );
# Implement tiny differences between some field variants
$value = '';
}
- $attribs = $this->getTooltipAndAccessKey();
+ $attribs = $this->getTooltipAndAccessKeyOOUI();
if ( $this->mClass !== '' ) {
$attribs['classes'] = [ $this->mClass ];