r105934 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r105933‎ | r105934 | r105935 >
Date:21:56, 12 December 2011
Author:robin
Status:ok
Tags:
Comment:
Simplify code (minor)
Modified paths:
  • /trunk/phase3/includes/installer/WebInstallerOutput.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/installer/WebInstallerOutput.php
@@ -144,11 +144,7 @@
145145 */
146146 public function getDir() {
147147 global $wgLang;
148 - if( !is_object( $wgLang ) || !$wgLang->isRtl() ) {
149 - return 'ltr';
150 - } else {
151 - return 'rtl';
152 - }
 148+ return is_object( $wgLang ) ? $wgLang->getDir() : 'ltr';
153149 }
154150
155151 /**
@@ -156,11 +152,7 @@
157153 */
158154 public function getLanguageCode() {
159155 global $wgLang;
160 - if( !is_object( $wgLang ) ) {
161 - return 'en';
162 - } else {
163 - return $wgLang->getCode();
164 - }
 156+ return is_object( $wgLang ) ? $wgLang->getCode() : 'en';
165157 }
166158
167159 /**

Status & tagging log