Completed
Branch master (07b0df)
by judicael
05:36 queued 02:38
created
bundles/lib/Date.php 1 patch
Braces   +7 added lines, -29 removed lines patch added patch discarded remove patch
@@ -76,18 +76,7 @@  discard block
 block discarded – undo
76 76
     {
77 77
         if ($sLanguage == 'fr') {
78 78
 
79
-            if ($sMonth == '01' || $sMonth == 1) { return 'Janvier'; }
80
-            else if ($sMonth == '02' || $sMonth == 2) { return 'Février'; }
81
-            else if ($sMonth == '03' || $sMonth == 3) { return 'Mars'; }
82
-            else if ($sMonth == '04' || $sMonth == 4) { return 'Avril'; }
83
-            else if ($sMonth == '05' || $sMonth == 5) { return 'Mai'; }
84
-            else if ($sMonth == '06' || $sMonth == 6) { return 'Juin'; }
85
-            else if ($sMonth == '07' || $sMonth == 7) { return 'Juillet'; }
86
-            else if ($sMonth == '08' || $sMonth == 8) { return 'Août'; }
87
-            else if ($sMonth == '09' || $sMonth == 9) { return 'Septembre'; }
88
-            else if ($sMonth == 10) { return 'Octobre'; }
89
-            else if ($sMonth == 11) { return 'Novembre'; }
90
-            else if ($sMonth == 12) { return 'Décembre'; }
79
+            if ($sMonth == '01' || $sMonth == 1) { return 'Janvier'; } else if ($sMonth == '02' || $sMonth == 2) { return 'Février'; } else if ($sMonth == '03' || $sMonth == 3) { return 'Mars'; } else if ($sMonth == '04' || $sMonth == 4) { return 'Avril'; } else if ($sMonth == '05' || $sMonth == 5) { return 'Mai'; } else if ($sMonth == '06' || $sMonth == 6) { return 'Juin'; } else if ($sMonth == '07' || $sMonth == 7) { return 'Juillet'; } else if ($sMonth == '08' || $sMonth == 8) { return 'Août'; } else if ($sMonth == '09' || $sMonth == 9) { return 'Septembre'; } else if ($sMonth == 10) { return 'Octobre'; } else if ($sMonth == 11) { return 'Novembre'; } else if ($sMonth == 12) { return 'Décembre'; }
91 80
         }
92 81
     }
93 82
 
@@ -103,13 +92,7 @@  discard block
 block discarded – undo
103 92
     {
104 93
         if ($sLanguage == 'fr') {
105 94
 
106
-            if ($sDay == 0) { return 'dimanche'; }
107
-            else if ($sDay == 1) { return 'lundi'; }
108
-            else if ($sDay == 2) { return 'mardi'; }
109
-            else if ($sDay == 3) { return 'mercredi'; }
110
-            else if ($sDay == 4) { return 'jeudi'; }
111
-            else if ($sDay == 5) { return 'vendredi'; }
112
-            else if ($sDay == 6) { return 'samedi'; }
95
+            if ($sDay == 0) { return 'dimanche'; } else if ($sDay == 1) { return 'lundi'; } else if ($sDay == 2) { return 'mardi'; } else if ($sDay == 3) { return 'mercredi'; } else if ($sDay == 4) { return 'jeudi'; } else if ($sDay == 5) { return 'vendredi'; } else if ($sDay == 6) { return 'samedi'; }
113 96
         }
114 97
     }
115 98
 
@@ -136,8 +119,7 @@  discard block
 block discarded – undo
136 119
             if ($iMonth == $aToday['mois']) {
137 120
 
138 121
                 if ($iDay > $aToday['jour']) { $iYears--; }
139
-            }
140
-            else {
122
+            } else {
141 123
 
142 124
                 $iYears--;
143 125
             }
@@ -158,18 +140,15 @@  discard block
 block discarded – undo
158 140
     {
159 141
         $iFirstDayInYear = date("N",mktime(0, 0, 0, 1, 1, $iYear));
160 142
 
161
-        if ($iFirstDayInYear < 5) { $iShift = -($iFirstDayInYear - 1) * 86400; }
162
-        else { $iShift = (8 - $iFirstDayInYear) * 86400; }
143
+        if ($iFirstDayInYear < 5) { $iShift = -($iFirstDayInYear - 1) * 86400; } else { $iShift = (8 - $iFirstDayInYear) * 86400; }
163 144
 
164
-        if ($iWeek > 1) { $iWeekInSeconds = ($iWeek-1) * 604800; }
165
-        else { $iWeekInSeconds = 0; }
145
+        if ($iWeek > 1) { $iWeekInSeconds = ($iWeek-1) * 604800; } else { $iWeekInSeconds = 0; }
166 146
 
167 147
         if (date('N') > 2) {
168 148
 
169 149
             $iTimestamp = mktime(0, 0, 0, 1, 1, $iYear) + $iWeekInSeconds + $iShift + 172800;
170 150
             $iTimestampLastDay = $iTimestamp + 604800;
171
-        }
172
-        else {
151
+        } else {
173 152
 
174 153
             $iTimestamp = mktime(0, 0, 0, 1, 1, $iYear) + $iWeekInSeconds + $iShift - 432000;
175 154
             $iTimestampLastDay = $iTimestamp + 604800;
@@ -224,7 +203,6 @@  discard block
 block discarded – undo
224 203
         if ($iTimeStamp < 3600) { return $sStartReturn.' '.(int)($iTimeStamp/60).' '.$sMinutes.$sEndReturn; }
225 204
         if ($iTimeStamp < 86400) { return $sStartReturn.' '.(int)($iTimeStamp/3600).' '.$sHours.$sEndReturn; }
226 205
         if ($iTimeStamp < 2592000) { return $sStartReturn.' '.(int)($iTimeStamp/86400).' '.$sDays.$sEndReturn; }
227
-        if ($iTimeStamp < 31536000) { return $sStartReturn.' '.(int)($iTimeStamp/2592000).' '.$sMonths.$sEndReturn; }
228
-        else { return $sStartReturn.' '.(int)($iTimeStamp/31536000).' '.$sYears.$sEndReturn; }
206
+        if ($iTimeStamp < 31536000) { return $sStartReturn.' '.(int)($iTimeStamp/2592000).' '.$sMonths.$sEndReturn; } else { return $sStartReturn.' '.(int)($iTimeStamp/31536000).' '.$sYears.$sEndReturn; }
229 207
     }
230 208
 }
Please login to merge, or discard this patch.
bundles/lib/Form.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -180,8 +180,7 @@
 block discarded – undo
180 180
 
181 181
             for ($i = 1; $i <= 31; $i++) {
182 182
 
183
-                if ($i < 10) { $aDay['0'.$i] = '0'.$i; }
184
-                else { $aDay[$i] = $i; }
183
+                if ($i < 10) { $aDay['0'.$i] = '0'.$i; } else { $aDay[$i] = $i; }
185 184
             }
186 185
 
187 186
             $this->_aElement[$sName.'_day'] = new Select($sName, $aDay);
Please login to merge, or discard this patch.