Completed
Push — master ( c8b97f...cd3622 )
by
unknown
02:25
created
src/CalendarSettings/Shamsi.php 2 patches
Indentation   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -41,19 +41,19 @@  discard block
 block discarded – undo
41 41
 
42 42
         $temp_day = 0;
43 43
 
44
-         for ( $i = 1 ; $i < $month ; $i++ ) {
44
+          for ( $i = 1 ; $i < $month ; $i++ ) {
45 45
 
46
-           $temp_day += $config['month_days_number'][$i];
46
+            $temp_day += $config['month_days_number'][$i];
47 47
 
48
-         }
48
+          }
49 49
 
50
-         $temp_day += $day;
50
+          $temp_day += $day;
51 51
 
52
-         $leap = new Leap( $year );
52
+          $leap = new Leap( $year );
53 53
 
54
-         if( $leap->get() && $month > 2 ) $temp_day++;
54
+          if( $leap->get() && $month > 2 ) $temp_day++;
55 55
 
56
-         if ( $temp_day <= 79 ) {
56
+          if ( $temp_day <= 79 ) {
57 57
 
58 58
           if( ( $year - 1 ) % 4 == 0 )
59 59
 
@@ -81,9 +81,9 @@  discard block
 block discarded – undo
81 81
 
82 82
           }
83 83
 
84
-         }
84
+          }
85 85
 
86
-         else {
86
+          else {
87 87
 
88 88
           $year = $year - 621;
89 89
 
@@ -129,11 +129,11 @@  discard block
 block discarded – undo
129 129
 
130 130
           }
131 131
 
132
-         }
132
+          }
133 133
 
134
-         $date_time->setDate( $year, $month, $day );
134
+          $date_time->setDate( $year, $month, $day );
135 135
 
136
-         return $date_time;
136
+          return $date_time;
137 137
 
138 138
   },
139 139
 
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
       $date_time->setDate( $gregorian_year, $gregorian_month, $gregorian_day );
204 204
 
205 205
 
206
-     return $date_time;
206
+      return $date_time;
207 207
 
208 208
   },
209 209
 
@@ -264,30 +264,30 @@  discard block
 block discarded – undo
264 264
    */
265 265
   'days_of_week' => array (
266 266
 
267
-     'Yekshanbe',
268
-     'Doshanbe',
269
-     'Seshanbe',
270
-     'Chaharshanbe',
271
-     'Panjshanbe',
272
-     'Jome',
273
-     'Shanbe',
267
+      'Yekshanbe',
268
+      'Doshanbe',
269
+      'Seshanbe',
270
+      'Chaharshanbe',
271
+      'Panjshanbe',
272
+      'Jome',
273
+      'Shanbe',
274 274
 
275 275
   ),
276 276
 
277 277
   'start_day_of_week' => 'Shanbe',
278 278
 
279 279
   'month_days_number' => array(      1 => 31,
280
-                                     2 => 31,
281
-                                     3 => 31,
282
-                                     4 => 31,
283
-                                     5 => 31,
284
-                                     6 => 31,
285
-                                     7 => 30,
286
-                                     8 => 30,
287
-                                     9 => 30,
288
-                                     10 => 30,
289
-                                     11 => 30,
290
-                                     12 => 29 ),
280
+                                      2 => 31,
281
+                                      3 => 31,
282
+                                      4 => 31,
283
+                                      5 => 31,
284
+                                      6 => 31,
285
+                                      7 => 30,
286
+                                      8 => 30,
287
+                                      9 => 30,
288
+                                      10 => 30,
289
+                                      11 => 30,
290
+                                      12 => 29 ),
291 291
 
292 292
 
293 293
   'day_of_year' => function( $date_time ) {
@@ -354,4 +354,4 @@  discard block
 block discarded – undo
354 354
    */
355 355
   'weekend' => array( 'friday' )
356 356
 
357
- );
357
+  );
Please login to merge, or discard this patch.
Spacing   +56 added lines, -56 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
 use Datium\Datium as Datium;
4 4
 use Datium\Tools\Leap as Leap;
5 5
 
6
-return array (
6
+return array(
7 7
 
8 8
   'timezone' => 'Asia/Tehran',
9 9
 
@@ -11,7 +11,7 @@  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
   'day_to_nigh' => 'AM',
17 17
 
@@ -29,19 +29,19 @@  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
-        $config = include( 'Gregorian.php' );
34
+        $config = include('Gregorian.php');
35 35
 
36
-        $year = $date_time->format( 'Y' );
36
+        $year = $date_time->format('Y');
37 37
 
38
-        $month = $date_time->format( 'm' );
38
+        $month = $date_time->format('m');
39 39
 
40
-        $day = $date_time->format( 'd' );
40
+        $day = $date_time->format('d');
41 41
 
42 42
         $temp_day = 0;
43 43
 
44
-         for ( $i = 1 ; $i < $month ; $i++ ) {
44
+         for ($i = 1; $i < $month; $i++) {
45 45
 
46 46
            $temp_day += $config['month_days_number'][$i];
47 47
 
@@ -49,13 +49,13 @@  discard block
 block discarded – undo
49 49
 
50 50
          $temp_day += $day;
51 51
 
52
-         $leap = new Leap( $year );
52
+         $leap = new Leap($year);
53 53
 
54
-         if( $leap->get() && $month > 2 ) $temp_day++;
54
+         if ($leap->get() && $month > 2) $temp_day++;
55 55
 
56
-         if ( $temp_day <= 79 ) {
56
+         if ($temp_day <= 79) {
57 57
 
58
-          if( ( $year - 1 ) % 4 == 0 )
58
+          if (($year - 1) % 4 == 0)
59 59
 
60 60
             $temp_day = $temp_day + 11;
61 61
 
@@ -65,9 +65,9 @@  discard block
 block discarded – undo
65 65
 
66 66
           $year = $year - 622;
67 67
 
68
-          if($temp_day % 30 == 0) {
68
+          if ($temp_day % 30 == 0) {
69 69
 
70
-            $month = ( $temp_day / 30 ) + 9;
70
+            $month = ($temp_day / 30) + 9;
71 71
 
72 72
             $day = 30;
73 73
 
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 
76 76
           else {
77 77
 
78
-            $month = ( $temp_day / 30 ) + 10;
78
+            $month = ($temp_day / 30) + 10;
79 79
 
80 80
             $day = $temp_day % 30;
81 81
 
@@ -89,20 +89,20 @@  discard block
 block discarded – undo
89 89
 
90 90
           $temp_day = $temp_day - 79;
91 91
 
92
-          if( $temp_day <= 186 ) {
92
+          if ($temp_day <= 186) {
93 93
 
94
-            if( $temp_day % 31 == 0 ) {
94
+            if ($temp_day % 31 == 0) {
95 95
 
96
-              $month = ( $temp_day / 31 );
96
+              $month = ($temp_day / 31);
97 97
 
98 98
               $day = 31;
99 99
             }
100 100
 
101 101
           else {
102 102
 
103
-            $month = ( $temp_day / 31 ) + 1;
103
+            $month = ($temp_day / 31) + 1;
104 104
 
105
-            $day = ( $temp_day % 31 );
105
+            $day = ($temp_day % 31);
106 106
           }
107 107
 
108 108
           }
@@ -111,9 +111,9 @@  discard block
 block discarded – undo
111 111
 
112 112
             $temp_day = $temp_day - 186;
113 113
 
114
-            if( $temp_day % 30 == 0 ) {
114
+            if ($temp_day % 30 == 0) {
115 115
 
116
-            $month = ( $temp_day / 30 ) + 6;
116
+            $month = ($temp_day / 30) + 6;
117 117
 
118 118
             $day = 30;
119 119
 
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 
122 122
             else {
123 123
 
124
-            $month = ( $temp_day / 30 ) + 7;
124
+            $month = ($temp_day / 30) + 7;
125 125
 
126 126
             $day = $temp_day % 30;
127 127
 
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 
132 132
          }
133 133
 
134
-         $date_time->setDate( $year, $month, $day );
134
+         $date_time->setDate($year, $month, $day);
135 135
 
136 136
          return $date_time;
137 137
 
@@ -145,9 +145,9 @@  discard block
 block discarded – undo
145 145
    *
146 146
    *\_________________________________________________________/
147 147
    */
148
-  'convert_from' => function( $date_time ) {
148
+  'convert_from' => function($date_time) {
149 149
 
150
-    $config = include( 'Shamsi.php' );
150
+    $config = include('Shamsi.php');
151 151
 
152 152
     $year = $date_time->format('Y');
153 153
 
@@ -157,41 +157,41 @@  discard block
 block discarded – undo
157 157
 
158 158
     $days_of_year = 0;
159 159
 
160
-    foreach ( $config['month_days_number'] as $mon => $value ) {
160
+    foreach ($config['month_days_number'] as $mon => $value) {
161 161
 
162
-      if( $month > $mon ) $days_of_year += $value;
162
+      if ($month > $mon) $days_of_year += $value;
163 163
 
164 164
     }
165 165
 
166 166
     $days_of_year += $day;
167 167
 
168
-    $days_of_leap_years =  intval( ( ( $year - 1 ) / 4 )  );
168
+    $days_of_leap_years = intval((($year - 1) / 4));
169 169
 
170
-    $days_of_shamsi_years = ( ( ( $year - 1 ) * 365 ) + $days_of_year + $days_of_leap_years );
170
+    $days_of_shamsi_years = ((($year - 1) * 365) + $days_of_year + $days_of_leap_years);
171 171
 
172 172
     $days_of_gregorain_years = $days_of_shamsi_years + 226899;
173 173
 
174
-    if ( $month < 10 )  {
174
+    if ($month < 10) {
175 175
 
176
-    $days_of_gregorain_years = $days_of_gregorain_years - intval( ( ( $year + 621 ) / 4 ) );
176
+    $days_of_gregorain_years = $days_of_gregorain_years - intval((($year + 621) / 4));
177 177
 
178 178
     }
179 179
 
180
-    elseif ( ( ( 10 == $month ) && ( $day > 10 ) ) || ( $month > 10 ) ) {
180
+    elseif (((10 == $month) && ($day > 10)) || ($month > 10)) {
181 181
 
182
-    $days_of_gregorain_years = $days_of_gregorain_years - intval( ( ( $year + 622 ) / 4 ) );
182
+    $days_of_gregorain_years = $days_of_gregorain_years - intval((($year + 622) / 4));
183 183
 
184 184
     }
185 185
 
186
-    $gregorian_month = ( $days_of_gregorain_years % 365 );
186
+    $gregorian_month = ($days_of_gregorain_years % 365);
187 187
 
188
-    $gregorian_year = intval( $days_of_gregorain_years / 365 ) + 1;
188
+    $gregorian_year = intval($days_of_gregorain_years / 365) + 1;
189 189
 
190
-    $config = include( 'Gregorian.php' );
190
+    $config = include('Gregorian.php');
191 191
 
192
-    foreach ( $config['month_days_number'] as $month => $value ) {
192
+    foreach ($config['month_days_number'] as $month => $value) {
193 193
 
194
-      if ( $gregorian_month < $value ) break;
194
+      if ($gregorian_month < $value) break;
195 195
 
196 196
         $gregorian_month -= $value;
197 197
     }
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
 
201 201
       $gregorian_month = $month;
202 202
 
203
-      $date_time->setDate( $gregorian_year, $gregorian_month, $gregorian_day );
203
+      $date_time->setDate($gregorian_year, $gregorian_month, $gregorian_day);
204 204
 
205 205
 
206 206
      return $date_time;
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
    *
226 226
    *\_________________________________________________________/
227 227
    */
228
-  'month' => array (
228
+  'month' => array(
229 229
 
230 230
     'Farvardin',
231 231
 
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
    */
265 265
 
266 266
 
267
-  'days_of_week' => array (
267
+  'days_of_week' => array(
268 268
 
269 269
      'Yekshanbe',
270 270
      'Doshanbe',
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
 
279 279
   'start_day_of_week' => 'Shanbe',
280 280
 
281
-  'month_days_number' => array(      1 => 31,
281
+  'month_days_number' => array(1 => 31,
282 282
                                      2 => 31,
283 283
                                      3 => 31,
284 284
                                      4 => 31,
@@ -289,22 +289,22 @@  discard block
 block discarded – undo
289 289
                                      9 => 30,
290 290
                                      10 => 30,
291 291
                                      11 => 30,
292
-                                     12 => 29 ),
292
+                                     12 => 29),
293 293
 
294 294
 
295
-  'day_of_year' => function( $date_time ) {
295
+  'day_of_year' => function($date_time) {
296 296
 
297 297
     $result = null;
298 298
 
299
-    $config = include( 'Shamsi.php' );
299
+    $config = include('Shamsi.php');
300 300
 
301 301
     $month = $date_time->format('n');
302 302
 
303 303
     $day = $date_time->format('d');
304 304
 
305
-    foreach( $config['month_days_number'] as $_month => $value ) {
305
+    foreach ($config['month_days_number'] as $_month => $value) {
306 306
 
307
-      if ( $_month < $month ) $result += $value;
307
+      if ($_month < $month) $result += $value;
308 308
 
309 309
     }
310 310
 
@@ -314,21 +314,21 @@  discard block
 block discarded – undo
314 314
 
315 315
   },
316 316
 
317
-  'day_of_week' => function( $date_time ) {
317
+  'day_of_week' => function($date_time) {
318 318
 
319
-        $days = array( 1 => 'Shanbe',  2 => 'Yekshanbe', 3 => 'Doshanbe', 4 => 'Seshanbe', 5 => 'Chaharshanbe', 6 => 'Panjshanbe', 7 => 'Jome' );
319
+        $days = array(1 => 'Shanbe', 2 => 'Yekshanbe', 3 => 'Doshanbe', 4 => 'Seshanbe', 5 => 'Chaharshanbe', 6 => 'Panjshanbe', 7 => 'Jome');
320 320
 
321
-        $configShamsi = include(  'Shamsi.php' );
321
+        $configShamsi = include('Shamsi.php');
322 322
 
323
-        $configGregorian = include( 'Gregorian.php' );
323
+        $configGregorian = include('Gregorian.php');
324 324
 
325 325
         $day = $date_time->format('l');
326 326
 
327
-        $day = str_replace( $configGregorian['days_of_week'],$configShamsi['days_of_week'], $day );
327
+        $day = str_replace($configGregorian['days_of_week'], $configShamsi['days_of_week'], $day);
328 328
 
329
-        foreach ( $days as $key => $value ) {
329
+        foreach ($days as $key => $value) {
330 330
 
331
-          if( $day == $value ) {
331
+          if ($day == $value) {
332 332
 
333 333
               return $key;
334 334
 
@@ -355,6 +355,6 @@  discard block
 block discarded – undo
355 355
    *
356 356
    *\_________________________________________________________/
357 357
    */
358
-  'weekend' => array( 'friday' )
358
+  'weekend' => array('friday')
359 359
 
360 360
  );
Please login to merge, or discard this patch.
src/CalendarSettings/Gregorian.php 3 patches
Indentation   +57 added lines, -57 removed lines patch added patch discarded remove patch
@@ -1,20 +1,20 @@  discard block
 block discarded – undo
1 1
 ``<?php
2 2
 
3
- use Datium\Datium as Datium;
3
+  use Datium\Datium as Datium;
4 4
 
5
- return array (
5
+  return array (
6 6
 
7
- 'numbers' => array( '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'),
7
+  'numbers' => array( '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'),
8 8
 
9
- 'day_to_nigh' => 'AM',
9
+  'day_to_nigh' => 'AM',
10 10
 
11
- 'night_to_day' => 'PM',
11
+  'night_to_day' => 'PM',
12 12
 
13
- 'end_of_days_number' => 'th',
13
+  'end_of_days_number' => 'th',
14 14
 
15 15
 
16 16
 
17
- /************************************************************
17
+  /************************************************************
18 18
   *                        Convert to
19 19
   ************************************************************
20 20
   *
@@ -22,13 +22,13 @@  discard block
 block discarded – undo
22 22
   *
23 23
   *\_________________________________________________________/
24 24
   */
25
-   'convert_to' => function( $date_time ) {
25
+    'convert_to' => function( $date_time ) {
26 26
 
27
-     return null;
27
+      return null;
28 28
 
29
-   },
29
+    },
30 30
 
31
-   /************************************************************
31
+    /************************************************************
32 32
     *                        Convert From
33 33
     ************************************************************
34 34
     *
@@ -36,13 +36,13 @@  discard block
 block discarded – undo
36 36
     *
37 37
     *\_________________________________________________________/
38 38
     */
39
-   'convert_from' => function( $date_time ) {
39
+    'convert_from' => function( $date_time ) {
40 40
 
41
-     return null;
41
+      return null;
42 42
 
43
-   },
43
+    },
44 44
 
45
-   /************************************************************
45
+    /************************************************************
46 46
     *               Shorthand for jalali calendar
47 47
     ************************************************************
48 48
     *
@@ -50,9 +50,9 @@  discard block
 block discarded – undo
50 50
     *
51 51
     *\_________________________________________________________/
52 52
     */
53
-   'shorthand' => 'gr',
53
+    'shorthand' => 'gr',
54 54
 
55
-   /************************************************************
55
+    /************************************************************
56 56
     *                        Month's name
57 57
     ************************************************************
58 58
     *
@@ -86,9 +86,9 @@  discard block
 block discarded – undo
86 86
 
87 87
       'December'
88 88
 
89
-     ),
89
+      ),
90 90
 
91
-   /************************************************************
91
+    /************************************************************
92 92
     *                        Days of Week
93 93
     ************************************************************
94 94
     *
@@ -97,55 +97,55 @@  discard block
 block discarded – undo
97 97
     *
98 98
     *\_________________________________________________________/
99 99
     */
100
-   'days_of_week' => array (
100
+    'days_of_week' => array (
101 101
 
102
-       'Monday',
103
-       'Tuesday',
104
-       'Wednesday',
105
-       'Thursday',
106
-       'Friday',
107
-       'Saturday',
108
-       'Sunday',
109
-   ),
102
+        'Monday',
103
+        'Tuesday',
104
+        'Wednesday',
105
+        'Thursday',
106
+        'Friday',
107
+        'Saturday',
108
+        'Sunday',
109
+    ),
110 110
 
111 111
 
112
-   'month_days_number' => array(   1 => 31,
113
-                                   2 => 28,
114
-                                   3 => 31,
115
-                                   4 => 30,
116
-                                   5 => 31,
117
-                                   6 => 30,
118
-                                   7 => 31,
119
-                                   8 => 31,
120
-                                   9 => 30,
121
-                                   10 => 31,
122
-                                   11 => 30,
123
-                                   12 => 30 ),
112
+    'month_days_number' => array(   1 => 31,
113
+                                    2 => 28,
114
+                                    3 => 31,
115
+                                    4 => 30,
116
+                                    5 => 31,
117
+                                    6 => 30,
118
+                                    7 => 31,
119
+                                    8 => 31,
120
+                                    9 => 30,
121
+                                    10 => 31,
122
+                                    11 => 30,
123
+                                    12 => 30 ),
124 124
 
125 125
 
126
-   'day_of_year' => function( $date_time ) {
126
+    'day_of_year' => function( $date_time ) {
127 127
 
128
-     $result = null;
128
+      $result = null;
129 129
 
130
-     $_month = null;
130
+      $_month = null;
131 131
 
132
-     $config = include( 'Gregorian.php' );
132
+      $config = include( 'Gregorian.php' );
133 133
 
134
-     $month = $date_time->format('n');
134
+      $month = $date_time->format('n');
135 135
 
136
-     $day = $date_time->format('d');
136
+      $day = $date_time->format('d');
137 137
 
138
-     foreach( $config['month_days_number'] as $_month => $value ) {
138
+      foreach( $config['month_days_number'] as $_month => $value ) {
139 139
 
140
-       if ( $_month < $month ) $result += $value;
140
+        if ( $_month < $month ) $result += $value;
141 141
 
142
-     }
142
+      }
143 143
 
144
-     $result += $day;
144
+      $result += $day;
145 145
 
146
-     return $result;
146
+      return $result;
147 147
 
148
-   },
148
+    },
149 149
 
150 150
   'day_of_week' => function( $date_time ) {
151 151
 
@@ -159,9 +159,9 @@  discard block
 block discarded – undo
159 159
 
160 160
     }
161 161
 
162
-   },
162
+    },
163 163
 
164
-   /************************************************************
164
+    /************************************************************
165 165
     *                       Leap year
166 166
     ************************************************************
167 167
     *
@@ -169,9 +169,9 @@  discard block
 block discarded – undo
169 169
     *
170 170
     *\_________________________________________________________/
171 171
     */
172
-   'leap_year' => null,
172
+    'leap_year' => null,
173 173
 
174
-   /************************************************************
174
+    /************************************************************
175 175
     *                        Weekend
176 176
     ************************************************************
177 177
     *
@@ -179,6 +179,6 @@  discard block
 block discarded – undo
179 179
     *
180 180
     *\_________________________________________________________/
181 181
     */
182
-   'weekend' => array( 'friday' )
182
+    'weekend' => array( 'friday' )
183 183
 
184 184
   );
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -2,9 +2,9 @@  discard block
 block discarded – undo
2 2
 
3 3
  use Datium\Datium as Datium;
4 4
 
5
- return array (
5
+ return array(
6 6
 
7
- 'numbers' => array( '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'),
7
+ 'numbers' => array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9'),
8 8
 
9 9
  'day_to_nigh' => 'AM',
10 10
 
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
   *
23 23
   *\_________________________________________________________/
24 24
   */
25
-   'convert_to' => function( $date_time ) {
25
+   'convert_to' => function($date_time) {
26 26
 
27 27
      return null;
28 28
 
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
     *
37 37
     *\_________________________________________________________/
38 38
     */
39
-   'convert_from' => function( $date_time ) {
39
+   'convert_from' => function($date_time) {
40 40
 
41 41
      return null;
42 42
 
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
     *
98 98
     *\_________________________________________________________/
99 99
     */
100
-   'days_of_week' => array (
100
+   'days_of_week' => array(
101 101
 
102 102
        'Monday',
103 103
        'Tuesday',
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
    ),
110 110
 
111 111
 
112
-   'month_days_number' => array(   1 => 31,
112
+   'month_days_number' => array(1 => 31,
113 113
                                    2 => 28,
114 114
                                    3 => 31,
115 115
                                    4 => 30,
@@ -120,24 +120,24 @@  discard block
 block discarded – undo
120 120
                                    9 => 30,
121 121
                                    10 => 31,
122 122
                                    11 => 30,
123
-                                   12 => 30 ),
123
+                                   12 => 30),
124 124
 
125 125
 
126
-   'day_of_year' => function( $date_time ) {
126
+   'day_of_year' => function($date_time) {
127 127
 
128 128
      $result = null;
129 129
 
130 130
      $_month = null;
131 131
 
132
-     $config = include( 'Gregorian.php' );
132
+     $config = include('Gregorian.php');
133 133
 
134 134
      $month = $date_time->format('n');
135 135
 
136 136
      $day = $date_time->format('d');
137 137
 
138
-     foreach( $config['month_days_number'] as $_month => $value ) {
138
+     foreach ($config['month_days_number'] as $_month => $value) {
139 139
 
140
-       if ( $_month < $month ) $result += $value;
140
+       if ($_month < $month) $result += $value;
141 141
 
142 142
      }
143 143
 
@@ -147,15 +147,15 @@  discard block
 block discarded – undo
147 147
 
148 148
    },
149 149
 
150
-  'day_of_week' => function( $date_time ) {
150
+  'day_of_week' => function($date_time) {
151 151
 
152
-    $config = include( 'Gregorian.php' );
152
+    $config = include('Gregorian.php');
153 153
 
154 154
     $day = $date_time->format('l');
155 155
 
156 156
     foreach ($config['days_of_week'] as $key => $value) {
157 157
 
158
-      if ( $value == $day ) return $key += 1;
158
+      if ($value == $day) return $key += 1;
159 159
 
160 160
     }
161 161
 
@@ -179,6 +179,6 @@  discard block
 block discarded – undo
179 179
     *
180 180
     *\_________________________________________________________/
181 181
     */
182
-   'weekend' => array( 'friday' )
182
+   'weekend' => array('friday')
183 183
 
184 184
   );
Please login to merge, or discard this patch.
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -137,7 +137,9 @@  discard block
 block discarded – undo
137 137
 
138 138
      foreach( $config['month_days_number'] as $_month => $value ) {
139 139
 
140
-       if ( $_month < $month ) $result += $value;
140
+       if ( $_month < $month ) {
141
+         $result += $value;
142
+       }
141 143
 
142 144
      }
143 145
 
@@ -155,7 +157,9 @@  discard block
 block discarded – undo
155 157
 
156 158
     foreach ($config['days_of_week'] as $key => $value) {
157 159
 
158
-      if ( $value == $day ) return $key += 1;
160
+      if ( $value == $day ) {
161
+        return $key += 1;
162
+      }
159 163
 
160 164
     }
161 165
 
Please login to merge, or discard this patch.
test.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -3,56 +3,56 @@  discard block
 block discarded – undo
3 3
 use Datium\Datium as Datium;
4 4
 use Datium\Tools\Convert as Covnert;
5 5
 
6
-try{
6
+try {
7 7
 
8
-require_once( 'vendor/autoload.php' );
9
-var_dump( Datium::create( 1394, 9, 24 )->from( 'shamsi' )->get() );
10
-var_dump( Datium::create( 2020, 07, 11 )->to( 'shamsi' )->get() );
11
-var_dump( Datium::create( 2020, 07, 11 )->to( 'ghamari' )->get() );
8
+require_once('vendor/autoload.php');
9
+var_dump(Datium::create(1394, 9, 24)->from('shamsi')->get());
10
+var_dump(Datium::create(2020, 07, 11)->to('shamsi')->get());
11
+var_dump(Datium::create(2020, 07, 11)->to('ghamari')->get());
12 12
 echo '<br>this year:<br>';
13
-var_dump( Datium::now()->to( 'shamsi' )->lang( 'fa' )->get('l jS F Y h:i:s A') );
13
+var_dump(Datium::now()->to('shamsi')->lang('fa')->get('l jS F Y h:i:s A'));
14 14
 echo "<br>";
15
-var_dump( Datium::now()->to( 'shamsi' )->get('l jS F Y h:i:s A') );
15
+var_dump(Datium::now()->to('shamsi')->get('l jS F Y h:i:s A'));
16 16
 echo "<br>";
17
-var_dump( Datium::now()->to( 'shamsi' )->sub('3 year')->get() );
17
+var_dump(Datium::now()->to('shamsi')->sub('3 year')->get());
18 18
 echo "<br>";
19
-var_dump( Datium::now()->to( 'shamsi' )->add('3 year')->get() );
19
+var_dump(Datium::now()->to('shamsi')->add('3 year')->get());
20 20
 echo "<br>";
21
-var_dump( Datium::now()->get( 'l jS F Y h:i:s A' ) );
21
+var_dump(Datium::now()->get('l jS F Y h:i:s A'));
22 22
 echo "<br>Leap year ";
23
-var_dump( Datium::now()->leap()->get() );
23
+var_dump(Datium::now()->leap()->get());
24 24
 echo "<br>Create new DateTime: ";
25
-var_dump( Datium::create(2000, 1, 1, 0, 0, 0)->get() );
25
+var_dump(Datium::create(2000, 1, 1, 0, 0, 0)->get());
26 26
 echo "<br>";
27 27
 echo 'Is next year leap? ';
28
-var_dump( Datium::now()->add('1 year')->leap()->get() );
28
+var_dump(Datium::now()->add('1 year')->leap()->get());
29 29
 echo "<br>";
30 30
 echo "Day of Year in gregorian:";
31 31
 echo "<br>";
32
-var_dump( Datium::now()->dayOf()->year() );
32
+var_dump(Datium::now()->dayOf()->year());
33 33
 echo "<br>";
34 34
 echo "Day of Year in shamsi:";
35 35
 echo "<br>";
36
-var_dump( Datium::now()->to('shamsi')->dayOf()->year() );
36
+var_dump(Datium::now()->to('shamsi')->dayOf()->year());
37 37
 echo "<br>";
38 38
 echo "Day of Year in ghamari:";
39 39
 echo "<br>";
40
-var_dump( Datium::now()->to( 'ghamari' )->dayOf()->year() );
40
+var_dump(Datium::now()->to('ghamari')->dayOf()->year());
41 41
 echo "<br>";
42 42
 echo "Day of Week";
43 43
 echo "<br>";
44
-var_dump( Datium::now()->dayOf()->week() );
44
+var_dump(Datium::now()->dayOf()->week());
45 45
 echo "<br>";
46
-var_dump( Datium::create( 2015, 1, 1 )->dayOf()->week() );
46
+var_dump(Datium::create(2015, 1, 1)->dayOf()->week());
47 47
 echo "<br>";
48
-var_dump( Datium::now()->to('shamsi')->dayOf()->week() );
48
+var_dump(Datium::now()->to('shamsi')->dayOf()->week());
49 49
 echo "<br>";
50
-var_dump( Datium::create( 2015, 1, 1 )->to('shamsi')->dayOf()->week() );
50
+var_dump(Datium::create(2015, 1, 1)->to('shamsi')->dayOf()->week());
51 51
 echo "<br>";
52 52
 echo "Change date form gregorian to shamsi with method: ";
53
-var_dump( Datium::create( 1989, 10, 27 )->to( 'shamsi' )->get( 'l jS F Y h:i:s A' ) );
53
+var_dump(Datium::create(1989, 10, 27)->to('shamsi')->get('l jS F Y h:i:s A'));
54 54
 echo "<br>";
55
-var_dump( Datium::now()->to( 'ghamari' )->get( 'l jS F Y h:i:s A' ) );
55
+var_dump(Datium::now()->to('ghamari')->get('l jS F Y h:i:s A'));
56 56
 echo "<br>";
57 57
 echo "<br>";
58 58
 echo "<br>is persian holiday? ";
@@ -60,17 +60,17 @@  discard block
 block discarded – undo
60 60
 echo 'return international days';
61 61
 // var_dump(  Datium::between( Datium::now()->object() , Datium::now()->add('4 month')->object() )->events()->international()->get() );
62 62
 echo 'Convert gregorian to perisan';
63
-var_dump( Datium::now()->to('shamsi')->get() );
63
+var_dump(Datium::now()->to('shamsi')->get());
64 64
 echo 'Today\'s events:';
65 65
 // var_dump( Datium::now()->events()->local( 'ir' )->get() );
66 66
 echo 'Date diff';
67
-$diff = Datium::diff( Datium::now()->object(), Datium::now()->add('5 day')->object() );
68
-var_dump( $diff->days );
69
-var_dump( Datium::create( 2015, 11, 9 )->to( 'ghamari' )->get() );
67
+$diff = Datium::diff(Datium::now()->object(), Datium::now()->add('5 day')->object());
68
+var_dump($diff->days);
69
+var_dump(Datium::create(2015, 11, 9)->to('ghamari')->get());
70 70
 
71 71
 
72
-} catch (Exception $e ) {
72
+} catch (Exception $e) {
73 73
 
74
-  var_dump( $e );
74
+  var_dump($e);
75 75
 
76 76
 }
Please login to merge, or discard this patch.