r90368 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r90367‎ | r90368 | r90369 >
Date:21:24, 18 June 2011
Author:platonides
Status:ok
Tags:
Comment:
Code formatting.
Modified paths:
  • /trunk/tools/ToolserverI18N/TsIntuition.php (modified) (history)

Diff [purge]

Index: trunk/tools/ToolserverI18N/TsIntuition.php
@@ -103,7 +103,7 @@
104104 */
105105 function __construct( $options = array() ) {
106106
107 - if ( is_string( $options) ) {
 107+ if ( is_string( $options ) ) {
108108 $options = array( 'domain' => $options );
109109 }
110110
@@ -194,7 +194,7 @@
195195 /* Get/Set variables
196196 * ------------------------------------------------- */
197197
198 - public function getLang(){
 198+ public function getLang() {
199199 return $this->currentLanguage;
200200 }
201201
@@ -250,7 +250,7 @@
251251 * Return the currently selected text domain.
252252 * @return string
253253 */
254 - public function getDomain(){
 254+ public function getDomain() {
255255 return $this->currentTextdomain;
256256 }
257257
@@ -258,7 +258,7 @@
259259 * Get an array of all registered text domains.
260260 * @return array
261261 */
262 - public function getAllRegisteredDomains(){
 262+ public function getAllRegisteredDomains() {
263263 return $this->registeredTextdomains;
264264 }
265265
@@ -278,7 +278,7 @@
279279 *
280280 * @return array An array of aliases as keys and actual cookienames as values
281281 */
282 - public function getCookieNames(){
 282+ public function getCookieNames() {
283283 return $this->cookieNames;
284284 }
285285
@@ -293,7 +293,7 @@
294294 *
295295 * @return array An array of aliases as keys and actual parameter names as values.
296296 */
297 - public function getParamNames(){
 297+ public function getParamNames() {
298298 return $this->paramNames;
299299 }
300300
@@ -307,7 +307,7 @@
308308 *
309309 * @return boolean
310310 */
311 - public function getUseRequestParam(){
 311+ public function getUseRequestParam() {
312312 return $this->useRequestParam;
313313 }
314314
@@ -508,7 +508,7 @@
509509 */
510510 public function setMsgs( $messagesByKeys, $domain = 0, $lang = 0 ) {
511511 foreach ( $messagesByKeys as $key => $message ) {
512 - $this->setMsg( $key, $message, $domain, $lang);
 512+ $this->setMsg( $key, $message, $domain, $lang );
513513 }
514514 }
515515
@@ -772,8 +772,8 @@
773773 * It's recommended to redirectTo() directly after this.
774774 * @return boolean
775775 */
776 - public function wipeCookies(){
777 - $week = 7*24*3600;
 776+ public function wipeCookies() {
 777+ $week = 7 * 24 * 3600;
778778 foreach( $this->getCookieNames() as $name ) {
779779 setcookie( $name, '', time()-$week, '/', '.toolserver.org' );
780780 unset( $_COOKIE[$name] );
@@ -785,7 +785,7 @@
786786 * Get expiration timestamp.
787787 * @return integer Unix timestamp of expiration date or 0 if not available.
788788 */
789 - public function getCookieExpiration(){
 789+ public function getCookieExpiration() {
790790 $name = $this->getCookieName( 'track-expire' );
791791 $expire = isset( $_COOKIE[$name] ) ? intval( $_COOKIE[$name] ) : 0;
792792 return $expire;
@@ -795,14 +795,14 @@
796796 * Get expected lifetime left in seconds.
797797 * Returns 0 if expired or unavailable.
798798 */
799 - public function getCookieLifetime(){
 799+ public function getCookieLifetime() {
800800 $expire = $this->getCookieExpiration();
801801 $lifetime = $expire - time();
802802 // If already expired (-xxx), return 0
803803 return $lifetime < 0 ? 0 : $lifetime;
804804 }
805805
806 - public function hasCookies(){
 806+ public function hasCookies() {
807807 return isset( $_COOKIE[ $this->getCookieName( 'userlang' ) ] );
808808 }
809809
@@ -836,7 +836,7 @@
837837 *
838838 * @return true
839839 */
840 - private function loadDomainRegistry(){
 840+ private function loadDomainRegistry() {
841841
842842 // Don't load twice
843843 if ( is_array( $this->registeredTextdomains ) ) {
@@ -865,7 +865,7 @@
866866 *
867867 * @return true
868868 */
869 - private function loadFallbacks(){
 869+ private function loadFallbacks() {
870870
871871 // Don't load twice
872872 if ( is_array( $this->langFallbacks ) ) {
@@ -893,7 +893,7 @@
894894 *
895895 * @return true
896896 */
897 - private function loadNames(){
 897+ private function loadNames() {
898898
899899 // Don't load twice
900900 if ( is_array( $this->langNames ) ) {
@@ -1019,7 +1019,7 @@
10201020 * Show a typical "powered by .." footer line.
10211021 * Same as getPromoBox() but without the image.
10221022 */
1023 - public function getFooterLine( $helpTranslateDomain = null ){
 1023+ public function getFooterLine( $helpTranslateDomain = null ) {
10241024 return $this->getPromoBox( 'no-image', $helpTranslateDomain );
10251025 }
10261026
@@ -1066,7 +1066,7 @@
10671067 $this->redirectTo = array( $url, $code );
10681068 }
10691069
1070 - public function doRedirect(){
 1070+ public function doRedirect() {
10711071 if ( is_array( $this->redirectTo ) ) {
10721072 header( 'Content-Type: text/html; charset=utf-8' );
10731073 header( 'Location: ' . $this->redirectTo[0], true, $this->redirectTo[1] );
@@ -1076,7 +1076,7 @@
10771077 }
10781078 }
10791079
1080 - public function isRedirecting(){
 1080+ public function isRedirecting() {
10811081 return is_array( $this->redirectTo );
10821082 }
10831083
@@ -1156,7 +1156,7 @@
11571157 }
11581158
11591159 /**
1160 - * Check language choise tree in the following order:
 1160+ * Check language choice tree in the following order:
11611161 * - First: Construct override
11621162 * - Second: Parameter override
11631163 * - Third: Saved cookie
@@ -1189,7 +1189,7 @@
11901190 * for it to be applied
11911191 * @return true
11921192 */
1193 - public function refreshLang(){
 1193+ public function refreshLang() {
11941194 $this->initLangSelect();
11951195 return true;
11961196 }

Status & tagging log