Completed
Push — master ( 6ef271...8502f6 )
by
unknown
13s
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', 'M', 'Y', 'HT', 'MT', 'ST' ],
23
+  'date_interval' => ['D', 'M', 'Y', 'HT', 'MT', 'ST'],
24 24
 
25 25
 
26
-  'date_simple' => [ 'day', ' month', ' year', ' hour', ' minute', ' second' ],
26
+  'date_simple' => ['day', ' month', ' year', ' hour', ' minute', ' second'],
27 27
 
28 28
 ];
Please login to merge, or discard this patch.
src/CalendarSettings/Jalali.php 2 patches
Indentation   +28 added lines, -28 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
 
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
       $date_time->setDate($gregorian_year, $gregorian_month, $gregorian_day);
179 179
 
180 180
 
181
-     return $date_time;
181
+      return $date_time;
182 182
 
183 183
   },
184 184
 
@@ -241,30 +241,30 @@  discard block
 block discarded – undo
241 241
 
242 242
   'days_of_week' => array (
243 243
 
244
-     'Yekshanbe',
245
-     'Doshanbe',
246
-     'Seshanbe',
247
-     'Chaharshanbe',
248
-     'Panjshanbe',
249
-     'Jome',
250
-     'Shanbe',
244
+      'Yekshanbe',
245
+      'Doshanbe',
246
+      'Seshanbe',
247
+      'Chaharshanbe',
248
+      'Panjshanbe',
249
+      'Jome',
250
+      'Shanbe',
251 251
 
252 252
   ),
253 253
 
254 254
   'start_day_of_week' => 'Shanbe',
255 255
 
256 256
   'month_days_number' => array(      1 => 31,
257
-                                     2 => 31,
258
-                                     3 => 31,
259
-                                     4 => 31,
260
-                                     5 => 31,
261
-                                     6 => 31,
262
-                                     7 => 30,
263
-                                     8 => 30,
264
-                                     9 => 30,
265
-                                     10 => 30,
266
-                                     11 => 30,
267
-                                     12 => 29 ),
257
+                                      2 => 31,
258
+                                      3 => 31,
259
+                                      4 => 31,
260
+                                      5 => 31,
261
+                                      6 => 31,
262
+                                      7 => 30,
263
+                                      8 => 30,
264
+                                      9 => 30,
265
+                                      10 => 30,
266
+                                      11 => 30,
267
+                                      12 => 29 ),
268 268
 
269 269
   /************************************************************
270 270
   *                      Day of year
@@ -345,9 +345,9 @@  discard block
 block discarded – undo
345 345
    */
346 346
   'leap_year' => function ($year) {
347 347
 
348
-     $a = 0.025;
348
+      $a = 0.025;
349 349
 
350
-     $b = 266;
350
+      $b = 266;
351 351
 
352 352
     if ($year > 0) {
353 353
         $leapDays0 = (($year + 38) % 2820)*0.24219 + $a;
@@ -361,8 +361,8 @@  discard block
 block discarded – undo
361 361
         return false;
362 362
     }
363 363
 
364
-     $frac0 = intval(($leapDays0 - intval($leapDays0))*1000);
365
-     $frac1 = intval(($leapDays1 - intval($leapDays1))*1000);
364
+      $frac0 = intval(($leapDays0 - intval($leapDays0))*1000);
365
+      $frac1 = intval(($leapDays1 - intval($leapDays1))*1000);
366 366
 
367 367
     if ($frac0 <= $b && $frac1 > $b) {
368 368
         return true;
@@ -382,4 +382,4 @@  discard block
 block discarded – undo
382 382
    */
383 383
   'weekend' => array( 'friday' )
384 384
 
385
- );
385
+  );
Please login to merge, or discard this patch.
Spacing   +40 added lines, -40 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
 
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
    *
201 201
    *\_________________________________________________________/
202 202
    */
203
-  'month' => array (
203
+  'month' => array(
204 204
 
205 205
     'Farvardin',
206 206
 
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
    */
240 240
 
241 241
 
242
-  'days_of_week' => array (
242
+  'days_of_week' => array(
243 243
 
244 244
      'Yekshanbe',
245 245
      'Doshanbe',
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
 
254 254
   'start_day_of_week' => 'Shanbe',
255 255
 
256
-  'month_days_number' => array(      1 => 31,
256
+  'month_days_number' => array(1 => 31,
257 257
                                      2 => 31,
258 258
                                      3 => 31,
259 259
                                      4 => 31,
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
                                      9 => 30,
265 265
                                      10 => 30,
266 266
                                      11 => 30,
267
-                                     12 => 29 ),
267
+                                     12 => 29),
268 268
 
269 269
   /************************************************************
270 270
   *                      Day of year
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
   *
275 275
   *\_________________________________________________________/
276 276
   */
277
-  'day_of_year' => function ($date_time) {
277
+  'day_of_year' => function($date_time) {
278 278
 
279 279
     $result = null;
280 280
 
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
 
285 285
     $day = $date_time->format('d');
286 286
 
287
-    foreach ($config[ 'month_days_number' ] as $_month => $value) {
287
+    foreach ($config['month_days_number'] as $_month => $value) {
288 288
         if ($_month < $month) {
289 289
             $result += $value;
290 290
         }
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
    *  example : Yekshanbe = result is 2
305 305
    *\_________________________________________________________/
306 306
   */
307
-  'day_of_week' => function ($date_timem, $day_of_week) {
307
+  'day_of_week' => function($date_timem, $day_of_week) {
308 308
 
309 309
       $days_of_week = array(
310 310
           'Doshanbe',
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
         $configGregorian = include 'Gregorian.php';
329 329
 
330 330
         $day = str_replace(
331
-            $configGregorian[ 'days_of_week' ],
331
+            $configGregorian['days_of_week'],
332 332
             $days_of_week,
333 333
             $day_of_week
334 334
         );
@@ -349,26 +349,26 @@  discard block
 block discarded – undo
349 349
    *
350 350
    *\_________________________________________________________/
351 351
    */
352
-  'leap_year' => function ($year) {
352
+  'leap_year' => function($year) {
353 353
 
354 354
      $a = 0.025;
355 355
 
356 356
      $b = 266;
357 357
 
358 358
     if ($year > 0) {
359
-        $leapDays0 = (($year + 38) % 2820)*0.24219 + $a;
359
+        $leapDays0 = (($year + 38) % 2820) * 0.24219 + $a;
360 360
         // 0.24219 ~ extra days of one year
361
-        $leapDays1 = (($year + 39) % 2820)*0.24219 + $a;
361
+        $leapDays1 = (($year + 39) % 2820) * 0.24219 + $a;
362 362
         // 38 days is the difference of epoch to 2820-year cycle
363 363
     } elseif ($year < 0) {
364
-        $leapDays0 = (($year + 39) % 2820)*0.24219 + $a;
365
-        $leapDays1 = (($year + 40) % 2820)*0.24219 + $a;
364
+        $leapDays0 = (($year + 39) % 2820) * 0.24219 + $a;
365
+        $leapDays1 = (($year + 40) % 2820) * 0.24219 + $a;
366 366
     } else {
367 367
         return false;
368 368
     }
369 369
 
370
-     $frac0 = intval(($leapDays0 - intval($leapDays0))*1000);
371
-     $frac1 = intval(($leapDays1 - intval($leapDays1))*1000);
370
+     $frac0 = intval(($leapDays0 - intval($leapDays0)) * 1000);
371
+     $frac1 = intval(($leapDays1 - intval($leapDays1)) * 1000);
372 372
 
373 373
     if ($frac0 <= $b && $frac1 > $b) {
374 374
         return true;
@@ -386,6 +386,6 @@  discard block
 block discarded – undo
386 386
    *
387 387
    *\_________________________________________________________/
388 388
    */
389
-  'weekend' => array( 'friday' )
389
+  'weekend' => array('friday')
390 390
 
391 391
  );
Please login to merge, or discard this patch.
src/CalendarSettings/Hijri.php 1 patch
Spacing   +33 added lines, -33 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
         $year = $date_time->format('Y');
101 101
 
@@ -103,8 +103,8 @@  discard block
 block discarded – undo
103 103
 
104 104
         $day = $date_time->format('d');
105 105
 
106
-        $jd = (int)((11 * $year + 3) / 30) + 354 * $year +
107
-              30 * $month -(int)(($month - 1) / 2) + $day + 1948440 - 385;
106
+        $jd = (int) ((11 * $year + 3) / 30) + 354 * $year +
107
+              30 * $month - (int) (($month - 1) / 2) + $day + 1948440 - 385;
108 108
 
109 109
         $result = explode('/', jdtogregorian($jd));
110 110
 
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
     *
140 140
     *\_________________________________________________________/
141 141
     */
142
-    'month' => array (
142
+    'month' => array(
143 143
 
144 144
         'Muharram',
145 145
 
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
     *
177 177
     *\_________________________________________________________/
178 178
     */
179
-    'days_of_week' => array (
179
+    'days_of_week' => array(
180 180
         
181 181
          'al-Aḥad',
182 182
          'al-Ithnayn',
@@ -187,18 +187,18 @@  discard block
 block discarded – undo
187 187
          'as-Sabt',
188 188
     ),
189 189
 
190
-    'numbers' => array( '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'),
190
+    'numbers' => array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9'),
191 191
 
192 192
     'am_time' => 'AM',
193 193
 
194 194
     'pm_time' => 'PM',
195 195
 
196
-    'end_of_days' => array( 'th', 'st', 'nd', 'rd' ),
196
+    'end_of_days' => array('th', 'st', 'nd', 'rd'),
197 197
 
198 198
 
199 199
 
200 200
 
201
-    'month_days_number' => array(    1 => 30,
201
+    'month_days_number' => array(1 => 30,
202 202
                                      2 => 29,
203 203
                                      3 => 30,
204 204
                                      4 => 30,
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
                                      9 => 30,
210 210
                                      10 => 29,
211 211
                                      11 => 30,
212
-                                     12 => 30 ),
212
+                                     12 => 30),
213 213
     /************************************************************
214 214
     *                      Day of year
215 215
     ************************************************************
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
     *
219 219
     *\_________________________________________________________/
220 220
     */
221
-     'day_of_year' => function ($date_time) {
221
+     'day_of_year' => function($date_time) {
222 222
 
223 223
         $result = null;
224 224
 
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
       *  example : al-Aḥad = result is 1
249 249
       *\_________________________________________________________/
250 250
       */
251
-     'day_of_week' => function ($date_time, $day_of_week) {
251
+     'day_of_week' => function($date_time, $day_of_week) {
252 252
 
253 253
          $days_of_week = array(
254 254
             'al-Ithnayn',
@@ -290,20 +290,20 @@  discard block
 block discarded – undo
290 290
       *
291 291
       *\_________________________________________________________/
292 292
       */
293
-     'leap_year' => function ($year) {
293
+     'leap_year' => function($year) {
294 294
         $result = $this->year % 30;
295 295
 
296
-        if (( 2 == $result )
297
-            || ( 5 == $result )
298
-            || ( 7 == $result )
299
-            || ( 10 == $result )
300
-            || ( 13 == $result )
301
-            || ( 16 == $result )
302
-            || ( 18 == $result )
303
-            || ( 21 == $result )
304
-            || ( 24 == $year )
305
-            || ( 26 == $result )
306
-            || ( 29 == $result )
296
+        if ((2 == $result)
297
+            || (5 == $result)
298
+            || (7 == $result)
299
+            || (10 == $result)
300
+            || (13 == $result)
301
+            || (16 == $result)
302
+            || (18 == $result)
303
+            || (21 == $result)
304
+            || (24 == $year)
305
+            || (26 == $result)
306
+            || (29 == $result)
307 307
         ) {
308 308
             return $result;
309 309
         }
@@ -317,6 +317,6 @@  discard block
 block discarded – undo
317 317
     *
318 318
     *\_________________________________________________________/
319 319
     */
320
-    'weekend' => array( 'friday', 'saturday' ),
320
+    'weekend' => array('friday', 'saturday'),
321 321
 
322 322
   );
Please login to merge, or discard this patch.