return $this->session;
}
- if ( isset( $session['happyPages'] ) ) {
- $this->happyPages = $session['happyPages'];
- } else {
- $this->happyPages = [];
- }
+ $this->happyPages = $session['happyPages'] ?? [];
- if ( isset( $session['skippedPages'] ) ) {
- $this->skippedPages = $session['skippedPages'];
- } else {
- $this->skippedPages = [];
- }
+ $this->skippedPages = $session['skippedPages'] ?? [];
$lowestUnhappy = $this->getLowestUnhappy();
* @return array
*/
public function getSession( $name, $default = null ) {
- if ( !isset( $this->session[$name] ) ) {
- return $default;
- } else {
- return $this->session[$name];
- }
+ return $this->session[$name] ?? $default;
}
/**
if ( !isset( $params['labelAttribs'] ) ) {
$params['labelAttribs'] = [];
}
- if ( isset( $params['rawtext'] ) ) {
- $labelText = $params['rawtext'];
- } else {
- $labelText = $this->parse( wfMessage( $params['label'] )->text() );
- }
+ $labelText = $params['rawtext'] ?? $this->parse( wfMessage( $params['label'] )->plain() );
return "<div class=\"config-input-check\">\n" .
$params['help'] .
public function getRadioSet( $params ) {
$items = $this->getRadioElements( $params );
- if ( !isset( $params['label'] ) ) {
- $label = '';
- } else {
- $label = $params['label'];
- }
+ $label = $params['label'] ?? '';
if ( !isset( $params['controlName'] ) ) {
$params['controlName'] = 'config_' . $params['var'];