Remove isset() check for $wgLocalTZoffset in Language.php
authorAlexandre Emsenhuber <mediawiki@emsenhuber.ch>
Sat, 10 May 2014 11:19:58 +0000 (13:19 +0200)
committerAlexandre Emsenhuber <mediawiki@emsenhuber.ch>
Sat, 10 May 2014 11:19:58 +0000 (13:19 +0200)
Do not use isset() to check for null; furthermore this variable
can no longer be null at this point now, so the check is useless.

Also remove the initial defintion of $minDiff since this was the
only case where it could be not set afterwards and fix spacing
after the comment.

Change-Id: I6e62ce1217e6e8750acb411673903fc3bde57841

languages/Language.php

index 964cd9f..38d3af5 100644 (file)
@@ -1908,12 +1908,9 @@ class Language {
                        $data[0] = 'Offset';
                }
 
-               $minDiff = 0;
                if ( $data[0] == 'System' || $tz == '' ) {
-                       #  Global offset in minutes.
-                       if ( isset( $wgLocalTZoffset ) ) {
-                               $minDiff = $wgLocalTZoffset;
-                       }
+                       # Global offset in minutes.
+                       $minDiff = $wgLocalTZoffset;
                } elseif ( $data[0] == 'Offset' ) {
                        $minDiff = intval( $data[1] );
                } else {