Completed
Push — master ( f45c4b...6ef271 )
by
unknown
03:46 queued 02:22
created
src/Config.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,9 +20,9 @@
 block discarded – undo
20 20
   'default_calendar' => 'gregorian',
21 21
 
22 22
 
23
-  'date_interval' => [ 'D', 'W','M', 'Y', 'HT', 'MT', 'ST' ],
23
+  'date_interval' => ['D', 'W', 'M', 'Y', 'HT', 'MT', 'ST'],
24 24
 
25 25
 
26
-  'date_simple' => [ 'day', ' week', ' month', ' year', ' hour', ' minute', ' second' ],
26
+  'date_simple' => ['day', ' week', ' month', ' year', ' hour', ' minute', ' second'],
27 27
 
28 28
 ];
Please login to merge, or discard this patch.
src/CalendarSettings/Jalali.php 2 patches
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -45,9 +45,9 @@  discard block
 block discarded – undo
45 45
         $temp_day += $config[ 'month_days_number' ][ $i ];
46 46
     }
47 47
 
48
-         $temp_day += $day;
48
+          $temp_day += $day;
49 49
 
50
-         $leap = new Leap($year);
50
+          $leap = new Leap($year);
51 51
 
52 52
     if ($leap->get() && $month > 2) {
53 53
         $temp_day++;
@@ -101,9 +101,9 @@  discard block
 block discarded – undo
101 101
         }
102 102
     }
103 103
 
104
-         $date_time->setDate($year, $month, $day);
104
+          $date_time->setDate($year, $month, $day);
105 105
 
106
-         return $date_time;
106
+          return $date_time;
107 107
 
108 108
   },
109 109
 
@@ -244,30 +244,30 @@  discard block
 block discarded – undo
244 244
 
245 245
   'days_of_week' => array (
246 246
 
247
-     'Yekshanbe',
248
-     'Doshanbe',
249
-     'Seshanbe',
250
-     'Chaharshanbe',
251
-     'Panjshanbe',
252
-     'Jome',
253
-     'Shanbe',
247
+      'Yekshanbe',
248
+      'Doshanbe',
249
+      'Seshanbe',
250
+      'Chaharshanbe',
251
+      'Panjshanbe',
252
+      'Jome',
253
+      'Shanbe',
254 254
 
255 255
   ),
256 256
 
257 257
   'start_day_of_week' => 'Shanbe',
258 258
 
259 259
   'month_days_number' => array(      1 => 31,
260
-                                     2 => 31,
261
-                                     3 => 31,
262
-                                     4 => 31,
263
-                                     5 => 31,
264
-                                     6 => 31,
265
-                                     7 => 30,
266
-                                     8 => 30,
267
-                                     9 => 30,
268
-                                     10 => 30,
269
-                                     11 => 30,
270
-                                     12 => 29 ),
260
+                                      2 => 31,
261
+                                      3 => 31,
262
+                                      4 => 31,
263
+                                      5 => 31,
264
+                                      6 => 31,
265
+                                      7 => 30,
266
+                                      8 => 30,
267
+                                      9 => 30,
268
+                                      10 => 30,
269
+                                      11 => 30,
270
+                                      12 => 29 ),
271 271
 
272 272
   /************************************************************
273 273
   *                      Day of year
@@ -354,9 +354,9 @@  discard block
 block discarded – undo
354 354
    */
355 355
   'leap_year' => function ($year) {
356 356
 
357
-     $a = 0.025;
357
+      $a = 0.025;
358 358
 
359
-     $b = 266;
359
+      $b = 266;
360 360
 
361 361
     if ($year > 0) {
362 362
         $leapDays0 = (($year + 38) % 2820)*0.24219 + $a;
@@ -370,8 +370,8 @@  discard block
 block discarded – undo
370 370
         return false;
371 371
     }
372 372
 
373
-     $frac0 = intval(($leapDays0 - intval($leapDays0))*1000);
374
-     $frac1 = intval(($leapDays1 - intval($leapDays1))*1000);
373
+      $frac0 = intval(($leapDays0 - intval($leapDays0))*1000);
374
+      $frac1 = intval(($leapDays1 - intval($leapDays1))*1000);
375 375
 
376 376
     if ($frac0 <= $b && $frac1 > $b) {
377 377
         return true;
@@ -391,4 +391,4 @@  discard block
 block discarded – undo
391 391
    */
392 392
   'weekend' => array( 'friday' )
393 393
 
394
- );
394
+  );
Please login to merge, or discard this patch.
Spacing   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
 use OpenCafe\Datium as Datium;
4 4
 use OpenCafe\Tools\Leap as Leap;
5 5
 
6
-return array (
6
+return array(
7 7
 
8 8
   'timezone' => 'Asia/Tehran',
9 9
 
@@ -11,13 +11,13 @@  discard block
 block discarded – undo
11 11
 
12 12
   'events' => array(),
13 13
 
14
-  'numbers' => array( '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'),
14
+  'numbers' => array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9'),
15 15
 
16 16
   'am_time' => 'AM',
17 17
 
18 18
   'pm_time' => 'PM',
19 19
 
20
-  'end_of_days' => array( 'th', 'st', 'nd', 'rd' ),
20
+  'end_of_days' => array('th', 'st', 'nd', 'rd'),
21 21
 
22 22
 
23 23
 
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
  *
30 30
  *\_________________________________________________________/
31 31
  */
32
-  'convert_to' => function ($date_time) {
32
+  'convert_to' => function($date_time) {
33 33
 
34 34
         $config = include 'Gregorian.php';
35 35
 
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
         $temp_day = 0;
43 43
 
44 44
     for ($i = 1; $i < $month; $i++) {
45
-        $temp_day += $config[ 'month_days_number' ][ $i ];
45
+        $temp_day += $config['month_days_number'][$i];
46 46
     }
47 47
 
48 48
          $temp_day += $day;
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
     }
55 55
 
56 56
     if ($temp_day <= 79) {
57
-        if (( $year - 1 ) % 4 == 0) {
57
+        if (($year - 1) % 4 == 0) {
58 58
             $temp_day = $temp_day + 11;
59 59
         } else {
60 60
             $temp_day = $temp_day + 10;
@@ -63,11 +63,11 @@  discard block
 block discarded – undo
63 63
         $year = $year - 622;
64 64
 
65 65
         if ($temp_day % 30 == 0) {
66
-            $month = ( $temp_day / 30 ) + 9;
66
+            $month = ($temp_day / 30) + 9;
67 67
 
68 68
             $day = 30;
69 69
         } else {
70
-            $month = ( $temp_day / 30 ) + 10;
70
+            $month = ($temp_day / 30) + 10;
71 71
 
72 72
             $day = $temp_day % 30;
73 73
         }
@@ -78,23 +78,23 @@  discard block
 block discarded – undo
78 78
 
79 79
         if ($temp_day <= 186) {
80 80
             if ($temp_day % 31 == 0) {
81
-                $month = ( $temp_day / 31 );
81
+                $month = ($temp_day / 31);
82 82
 
83 83
                 $day = 31;
84 84
             } else {
85
-                $month = ( $temp_day / 31 ) + 1;
85
+                $month = ($temp_day / 31) + 1;
86 86
 
87
-                $day = ( $temp_day % 31 );
87
+                $day = ($temp_day % 31);
88 88
             }
89 89
         } else {
90 90
             $temp_day = $temp_day - 186;
91 91
 
92 92
             if ($temp_day % 30 == 0) {
93
-                $month = ( $temp_day / 30 ) + 6;
93
+                $month = ($temp_day / 30) + 6;
94 94
 
95 95
                 $day = 30;
96 96
             } else {
97
-                $month = ( $temp_day / 30 ) + 7;
97
+                $month = ($temp_day / 30) + 7;
98 98
 
99 99
                 $day = $temp_day % 30;
100 100
             }
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
    *
116 116
    *\_________________________________________________________/
117 117
    */
118
-  'convert_from' => function ($date_time) {
118
+  'convert_from' => function($date_time) {
119 119
 
120 120
     $config = include 'Jalali.php';
121 121
 
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 
128 128
     $days_of_year = 0;
129 129
 
130
-    foreach ($config[ 'month_days_number' ] as $mon => $value) {
130
+    foreach ($config['month_days_number'] as $mon => $value) {
131 131
         if ($month > $mon) {
132 132
             $days_of_year += $value;
133 133
         }
@@ -135,25 +135,25 @@  discard block
 block discarded – undo
135 135
 
136 136
     $days_of_year += $day;
137 137
 
138
-    $days_of_leap_years =  intval(( ( $year - 1 ) / 4 ));
138
+    $days_of_leap_years = intval((($year - 1) / 4));
139 139
 
140
-    $days_of_shamsi_years = ( ( ( $year - 1 ) * 365 ) + $days_of_year + $days_of_leap_years );
140
+    $days_of_shamsi_years = ((($year - 1) * 365) + $days_of_year + $days_of_leap_years);
141 141
 
142 142
     $days_of_gregorain_years = $days_of_shamsi_years + 226899;
143 143
 
144 144
     if ($month < 10) {
145
-        $days_of_gregorain_years = $days_of_gregorain_years - intval(( ( $year + 621 ) / 4 ));
146
-    } elseif (( ( 10 == $month ) && ( $day > 10 ) ) || ( $month > 10 )) {
147
-        $days_of_gregorain_years = $days_of_gregorain_years - intval(( ( $year + 622 ) / 4 ));
145
+        $days_of_gregorain_years = $days_of_gregorain_years - intval((($year + 621) / 4));
146
+    } elseif (((10 == $month) && ($day > 10)) || ($month > 10)) {
147
+        $days_of_gregorain_years = $days_of_gregorain_years - intval((($year + 622) / 4));
148 148
     }
149 149
 
150
-    $gregorian_month = ( $days_of_gregorain_years % 365 );
150
+    $gregorian_month = ($days_of_gregorain_years % 365);
151 151
 
152 152
     $gregorian_year = intval($days_of_gregorain_years / 365) + 1;
153 153
 
154 154
     $config = include 'Gregorian.php';
155 155
 
156
-    foreach ($config[ 'month_days_number' ] as $month => $value) {
156
+    foreach ($config['month_days_number'] as $month => $value) {
157 157
         if ($gregorian_month < $value) {
158 158
             break;
159 159
         }
@@ -165,9 +165,9 @@  discard block
 block discarded – undo
165 165
 
166 166
     $gregorian_month = $month;
167 167
 
168
-    if ( ( ( $gregorian_year % 4 ) == 0 ) && ( ( ( $gregorian_year % 100 ) != 0 ) || ( ( $gregorian_year % 400 ) == 0 ) ) ) {
168
+    if ((($gregorian_year % 4) == 0) && ((($gregorian_year % 100) != 0) || (($gregorian_year % 400) == 0))) {
169 169
 
170
-        if ( $gregorian_month < 3 || ( $gregorian_month == 3 && $gregorian_day < 22 ) ) {
170
+        if ($gregorian_month < 3 || ($gregorian_month == 3 && $gregorian_day < 22)) {
171 171
 
172 172
           $gregorian_day++;
173 173
 
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 
176 176
     }
177 177
 
178
-    if (! $gregorian_day || $config['leap_year']($gregorian_year - 1) ) {
178
+    if ( ! $gregorian_day || $config['leap_year']($gregorian_year - 1)) {
179 179
         $gregorian_day++;
180 180
     }
181 181
 
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
    *
204 204
    *\_________________________________________________________/
205 205
    */
206
-  'month' => array (
206
+  'month' => array(
207 207
 
208 208
     'Farvardin',
209 209
 
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
    */
243 243
 
244 244
 
245
-  'days_of_week' => array (
245
+  'days_of_week' => array(
246 246
 
247 247
      'Yekshanbe',
248 248
      'Doshanbe',
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
 
257 257
   'start_day_of_week' => 'Shanbe',
258 258
 
259
-  'month_days_number' => array(      1 => 31,
259
+  'month_days_number' => array(1 => 31,
260 260
                                      2 => 31,
261 261
                                      3 => 31,
262 262
                                      4 => 31,
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
                                      9 => 30,
268 268
                                      10 => 30,
269 269
                                      11 => 30,
270
-                                     12 => 29 ),
270
+                                     12 => 29),
271 271
 
272 272
   /************************************************************
273 273
   *                      Day of year
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
   *
278 278
   *\_________________________________________________________/
279 279
   */
280
-  'day_of_year' => function ($date_time) {
280
+  'day_of_year' => function($date_time) {
281 281
 
282 282
     $result = null;
283 283
 
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
 
288 288
     $day = $date_time->format('d');
289 289
 
290
-    foreach ($config[ 'month_days_number' ] as $_month => $value) {
290
+    foreach ($config['month_days_number'] as $_month => $value) {
291 291
         if ($_month < $month) {
292 292
             $result += $value;
293 293
         }
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
    *  example : Yekshanbe = result is 2
308 308
    *\_________________________________________________________/
309 309
   */
310
-  'day_of_week' => function ($date_timem, $day_of_week) {
310
+  'day_of_week' => function($date_timem, $day_of_week) {
311 311
 
312 312
       $days_of_week = array(
313 313
           'Doshanbe',
@@ -331,7 +331,7 @@  discard block
 block discarded – undo
331 331
         $configGregorian = include 'Gregorian.php';
332 332
 
333 333
         $day = str_replace(
334
-            $configGregorian[ 'days_of_week' ],
334
+            $configGregorian['days_of_week'],
335 335
             $days_of_week,
336 336
             $day_of_week
337 337
         );
@@ -352,26 +352,26 @@  discard block
 block discarded – undo
352 352
    *
353 353
    *\_________________________________________________________/
354 354
    */
355
-  'leap_year' => function ($year) {
355
+  'leap_year' => function($year) {
356 356
 
357 357
      $a = 0.025;
358 358
 
359 359
      $b = 266;
360 360
 
361 361
     if ($year > 0) {
362
-        $leapDays0 = (($year + 38) % 2820)*0.24219 + $a;
362
+        $leapDays0 = (($year + 38) % 2820) * 0.24219 + $a;
363 363
         // 0.24219 ~ extra days of one year
364
-        $leapDays1 = (($year + 39) % 2820)*0.24219 + $a;
364
+        $leapDays1 = (($year + 39) % 2820) * 0.24219 + $a;
365 365
         // 38 days is the difference of epoch to 2820-year cycle
366 366
     } elseif ($year < 0) {
367
-        $leapDays0 = (($year + 39) % 2820)*0.24219 + $a;
368
-        $leapDays1 = (($year + 40) % 2820)*0.24219 + $a;
367
+        $leapDays0 = (($year + 39) % 2820) * 0.24219 + $a;
368
+        $leapDays1 = (($year + 40) % 2820) * 0.24219 + $a;
369 369
     } else {
370 370
         return false;
371 371
     }
372 372
 
373
-     $frac0 = intval(($leapDays0 - intval($leapDays0))*1000);
374
-     $frac1 = intval(($leapDays1 - intval($leapDays1))*1000);
373
+     $frac0 = intval(($leapDays0 - intval($leapDays0)) * 1000);
374
+     $frac1 = intval(($leapDays1 - intval($leapDays1)) * 1000);
375 375
 
376 376
     if ($frac0 <= $b && $frac1 > $b) {
377 377
         return true;
@@ -389,6 +389,6 @@  discard block
 block discarded – undo
389 389
    *
390 390
    *\_________________________________________________________/
391 391
    */
392
-  'weekend' => array( 'friday' )
392
+  'weekend' => array('friday')
393 393
 
394 394
  );
Please login to merge, or discard this patch.
src/CalendarSettings/Hijri.php 1 patch
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
 use OpenCafe\Datium as Datium;
4 4
 use OpenCafe\Tools\Leap as Leap;
5 5
 
6
-return array (
6
+return array(
7 7
 
8 8
  /************************************************************
9 9
   *                        Convert to
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
   *
14 14
   *\_________________________________________________________/
15 15
   */
16
-   'convert_to' => function ($date_time) {
16
+   'convert_to' => function($date_time) {
17 17
 
18 18
      $config = include 'Jalali.php';
19 19
 
@@ -25,10 +25,10 @@  discard block
 block discarded – undo
25 25
 
26 26
      $day = $date_time->format('d');
27 27
 
28
-     $temp_day = 0 ;
28
+     $temp_day = 0;
29 29
 
30 30
     for ($i = 1; $i < $month; $i++) {
31
-        $temp_day += $config[ 'month_days_number' ][ $i ];
31
+        $temp_day += $config['month_days_number'][$i];
32 32
     }
33 33
 
34 34
       $temp_day += $day;
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
         $temp_day++;
40 40
     }
41 41
 
42
-     $_year = ( ( ( ( ( $year - 1 ) * 365.2422 ) + $temp_day ) - 119) / 354.3670 ) + 1;
42
+     $_year = ((((($year - 1) * 365.2422) + $temp_day) - 119) / 354.3670) + 1;
43 43
 
44 44
      $_year = explode('.', $_year);
45 45
 
@@ -55,9 +55,9 @@  discard block
 block discarded – undo
55 55
 
56 56
       $var_temp .= '1';
57 57
 
58
-     $_month = $_month * $var_temp ;
58
+     $_month = $_month * $var_temp;
59 59
 
60
-     $_month = ( $_month * 12 ) + 1;
60
+     $_month = ($_month * 12) + 1;
61 61
 
62 62
      $_month = explode('.', $_month);
63 63
 
@@ -68,14 +68,14 @@  discard block
 block discarded – undo
68 68
      $var_temp = '0.0';
69 69
 
70 70
     for ($i = strlen($_day); $i > 2; $i--) {
71
-        $var_temp .= '0' ;
71
+        $var_temp .= '0';
72 72
     }
73 73
 
74 74
      $var_temp .= '1';
75 75
 
76 76
      $_day = $_day * $var_temp;
77 77
 
78
-     $_day = ( $_day * 29.530 );
78
+     $_day = ($_day * 29.530);
79 79
 
80 80
      $_day = explode('.', $_day);
81 81
 
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
     *
96 96
     *\_________________________________________________________/
97 97
     */
98
-    'convert_from' => function ($date_time) {
98
+    'convert_from' => function($date_time) {
99 99
 
100 100
         $config = include 'Gregorian.php';
101 101
 
@@ -105,8 +105,8 @@  discard block
 block discarded – undo
105 105
 
106 106
         $day = $date_time->format('d');
107 107
 
108
-        $jd = (int)((11 * $year + 3) / 30) + 354 * $year +
109
-              30 * $month -(int)(($month - 1) / 2) + $day + 1948440 - 385;
108
+        $jd = (int) ((11 * $year + 3) / 30) + 354 * $year +
109
+              30 * $month - (int) (($month - 1) / 2) + $day + 1948440 - 385;
110 110
 
111 111
         $result = explode('/', jdtogregorian($jd));
112 112
 
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 
117 117
         $year = $result[2];
118 118
 
119
-        if (! $day || $config['leap_year']($year - 1) ) {
119
+        if ( ! $day || $config['leap_year']($year - 1)) {
120 120
             $day++;
121 121
         }
122 122
 
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
     *
146 146
     *\_________________________________________________________/
147 147
     */
148
-    'month' => array (
148
+    'month' => array(
149 149
 
150 150
         'Muharram',
151 151
 
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
     *
183 183
     *\_________________________________________________________/
184 184
     */
185
-    'days_of_week' => array (
185
+    'days_of_week' => array(
186 186
 
187 187
          'al-Aḥad',
188 188
          'al-Ithnayn',
@@ -193,18 +193,18 @@  discard block
 block discarded – undo
193 193
          'as-Sabt',
194 194
     ),
195 195
 
196
-    'numbers' => array( '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'),
196
+    'numbers' => array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9'),
197 197
 
198 198
     'am_time' => 'AM',
199 199
 
200 200
     'pm_time' => 'PM',
201 201
 
202
-    'end_of_days' => array( 'th', 'st', 'nd', 'rd' ),
202
+    'end_of_days' => array('th', 'st', 'nd', 'rd'),
203 203
 
204 204
 
205 205
 
206 206
 
207
-    'month_days_number' => array(    1 => 30,
207
+    'month_days_number' => array(1 => 30,
208 208
                                      2 => 29,
209 209
                                      3 => 30,
210 210
                                      4 => 30,
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
                                      9 => 30,
216 216
                                      10 => 29,
217 217
                                      11 => 30,
218
-                                     12 => 30 ),
218
+                                     12 => 30),
219 219
     /************************************************************
220 220
     *                      Day of year
221 221
     ************************************************************
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
     *
225 225
     *\_________________________________________________________/
226 226
     */
227
-     'day_of_year' => function ($date_time) {
227
+     'day_of_year' => function($date_time) {
228 228
 
229 229
         $result = null;
230 230
 
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
       *  example : al-Aḥad = result is 1
255 255
       *\_________________________________________________________/
256 256
       */
257
-     'day_of_week' => function ($date_time, $day_of_week) {
257
+     'day_of_week' => function($date_time, $day_of_week) {
258 258
 
259 259
          $days_of_week = array(
260 260
             'al-Ithnayn',
@@ -296,20 +296,20 @@  discard block
 block discarded – undo
296 296
       *
297 297
       *\_________________________________________________________/
298 298
       */
299
-     'leap_year' => function ($year) {
299
+     'leap_year' => function($year) {
300 300
         $result = $this->year % 30;
301 301
 
302
-        if (( 2 == $result )
303
-            || ( 5 == $result )
304
-            || ( 7 == $result )
305
-            || ( 10 == $result )
306
-            || ( 13 == $result )
307
-            || ( 16 == $result )
308
-            || ( 18 == $result )
309
-            || ( 21 == $result )
310
-            || ( 24 == $year )
311
-            || ( 26 == $result )
312
-            || ( 29 == $result )
302
+        if ((2 == $result)
303
+            || (5 == $result)
304
+            || (7 == $result)
305
+            || (10 == $result)
306
+            || (13 == $result)
307
+            || (16 == $result)
308
+            || (18 == $result)
309
+            || (21 == $result)
310
+            || (24 == $year)
311
+            || (26 == $result)
312
+            || (29 == $result)
313 313
         ) {
314 314
             return $result;
315 315
         }
@@ -323,6 +323,6 @@  discard block
 block discarded – undo
323 323
     *
324 324
     *\_________________________________________________________/
325 325
     */
326
-    'weekend' => array( 'friday', 'saturday' ),
326
+    'weekend' => array('friday', 'saturday'),
327 327
 
328 328
   );
Please login to merge, or discard this patch.