Skip to content

Commit

Permalink
fix array init for early php version compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
stleary committed Jan 31, 2017
1 parent d359d7c commit ce88c52
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/class-stars-at-night-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,11 +242,11 @@ private function getSunAndMoonTable() {
* images to match up with the real phase days. Here is the result,
* where key=day of moon, value=image number
*/
$phaseArray = [ 1 => 1,2 => 2,3 => 3,4 => 4,5 => 5,6 => 6,7 => 8,8 => 8,9 => 9,10 => 10,
11 => 11,12 => 11,13 => 12,14 => 13,15 => 13,16 => 14,17 => 15,18 => 16,19 => 17,
20 => 18,21 => 19,22 => 20,23 => 21,24 => 22,25 => 23,26 => 24,27 => 25,28 => 26,
29 => 27,30 => 28
];
$phaseArray = array (1 => 1,2 => 2,3 => 3,4 => 4,5 => 5,6 => 6,7 => 8,8 => 8,9 => 9,
10 => 10,11 => 11,12 => 11,13 => 12,14 => 13,15 => 13,16 => 14,17 => 15,18 => 16,
19 => 17,20 => 18,21 => 19,22 => 20,23 => 21,24 => 22,25 => 23,26 => 24,27 => 25,
28 => 26,29 => 27,30 => 28
);

/**
* Get the Moon phase.
Expand Down Expand Up @@ -325,15 +325,15 @@ private function getSunAndMoonTable() {
}
$sunMoonTable .= '</table></div>';
// for debugging the phase array
//for($i = 0; $i < 200; ++ $i) {
//$moonPhase = new NGC2244_Moon_Phase ( $date->getTimestamp () );
//$age = $moonPhase->age ();
//$roundAge = round($age) + 1;
//error_log ( "test " . $i . " age " . $roundAge . " image " .
//$phaseArray[$roundAge] );
//$date->add ( new DateInterval ( 'P1D' ) );
//}
// for($i = 0; $i < 200; ++ $i) {
// $moonPhase = new NGC2244_Moon_Phase ( $date->getTimestamp () );
// $age = $moonPhase->age ();
// $roundAge = round($age) + 1;
// error_log ( "test " . $i . " age " . $roundAge . " image " .
// $phaseArray[$roundAge] );
// $date->add ( new DateInterval ( 'P1D' ) );
// }

return $sunMoonTable;
}

Expand Down

0 comments on commit ce88c52

Please sign in to comment.