Skip to content

Commit ce88c52

Browse files
committed
fix array init for early php version compatibility
1 parent d359d7c commit ce88c52

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

src/class-stars-at-night-manager.php

+14-14
Original file line numberDiff line numberDiff line change
@@ -242,11 +242,11 @@ private function getSunAndMoonTable() {
242242
* images to match up with the real phase days. Here is the result,
243243
* where key=day of moon, value=image number
244244
*/
245-
$phaseArray = [ 1 => 1,2 => 2,3 => 3,4 => 4,5 => 5,6 => 6,7 => 8,8 => 8,9 => 9,10 => 10,
246-
11 => 11,12 => 11,13 => 12,14 => 13,15 => 13,16 => 14,17 => 15,18 => 16,19 => 17,
247-
20 => 18,21 => 19,22 => 20,23 => 21,24 => 22,25 => 23,26 => 24,27 => 25,28 => 26,
248-
29 => 27,30 => 28
249-
];
245+
$phaseArray = array (1 => 1,2 => 2,3 => 3,4 => 4,5 => 5,6 => 6,7 => 8,8 => 8,9 => 9,
246+
10 => 10,11 => 11,12 => 11,13 => 12,14 => 13,15 => 13,16 => 14,17 => 15,18 => 16,
247+
19 => 17,20 => 18,21 => 19,22 => 20,23 => 21,24 => 22,25 => 23,26 => 24,27 => 25,
248+
28 => 26,29 => 27,30 => 28
249+
);
250250

251251
/**
252252
* Get the Moon phase.
@@ -325,15 +325,15 @@ private function getSunAndMoonTable() {
325325
}
326326
$sunMoonTable .= '</table></div>';
327327
// for debugging the phase array
328-
//for($i = 0; $i < 200; ++ $i) {
329-
//$moonPhase = new NGC2244_Moon_Phase ( $date->getTimestamp () );
330-
//$age = $moonPhase->age ();
331-
//$roundAge = round($age) + 1;
332-
//error_log ( "test " . $i . " age " . $roundAge . " image " .
333-
//$phaseArray[$roundAge] );
334-
//$date->add ( new DateInterval ( 'P1D' ) );
335-
//}
336-
328+
// for($i = 0; $i < 200; ++ $i) {
329+
// $moonPhase = new NGC2244_Moon_Phase ( $date->getTimestamp () );
330+
// $age = $moonPhase->age ();
331+
// $roundAge = round($age) + 1;
332+
// error_log ( "test " . $i . " age " . $roundAge . " image " .
333+
// $phaseArray[$roundAge] );
334+
// $date->add ( new DateInterval ( 'P1D' ) );
335+
// }
336+
337337
return $sunMoonTable;
338338
}
339339

0 commit comments

Comments
 (0)