Found by PHPStan.
Change-Id: Ibefd9d5d1b374448650a36702db18144f5feddae
while ( $hebrewMonth <= 12 ) {
# Calculate days in this month
if ( $isLeap && $hebrewMonth == 6 ) {
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 ) {
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 ) {
}
}
} elseif ( $hebrewMonth == 2 && $yearPattern == 2 ) {