Delete always-true condition
authorJakub Vrana <jakub@vrana.cz>
Sun, 2 Dec 2018 08:59:17 +0000 (09:59 +0100)
committerJakub Vrana <jakub@vrana.cz>
Sun, 2 Dec 2018 08:59:17 +0000 (09:59 +0100)
Found by PHPStan.

Change-Id: Ibefd9d5d1b374448650a36702db18144f5feddae

languages/Language.php

index aa287e9..0efade9 100644 (file)
@@ -1833,22 +1833,19 @@ class Language {
                while ( $hebrewMonth <= 12 ) {
                        # Calculate days in this month
                        if ( $isLeap && $hebrewMonth == 6 ) {
-                               # Adar in a leap year
-                               if ( $isLeap ) {
-                                       # Leap year - has Adar I, with 30 days, and Adar II, with 29 days
-                                       $days = 30;
+                               # Leap year - has Adar I, with 30 days, and Adar II, with 29 days
+                               $days = 30;
+                               if ( $hebrewDay <= $days ) {
+                                       # Day in Adar I
+                                       $hebrewMonth = 13;
+                               } else {
+                                       # Subtract the days of Adar I
+                                       $hebrewDay -= $days;
+                                       # Try Adar II
+                                       $days = 29;
                                        if ( $hebrewDay <= $days ) {
-                                               # Day in Adar I
-                                               $hebrewMonth = 13;
-                                       } else {
-                                               # Subtract the days of Adar I
-                                               $hebrewDay -= $days;
-                                               # Try Adar II
-                                               $days = 29;
-                                               if ( $hebrewDay <= $days ) {
-                                                       # Day in Adar II
-                                                       $hebrewMonth = 14;
-                                               }
+                                               # Day in Adar II
+                                               $hebrewMonth = 14;
                                        }
                                }
                        } elseif ( $hebrewMonth == 2 && $yearPattern == 2 ) {