Completed
Push — master ( 01907b...5981e6 )
by mehdi
03:03
created
src/Leap.php 1 patch
Indentation   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -7,42 +7,42 @@  discard block
 block discarded – undo
7 7
 {
8 8
 
9 9
     /**
10
-   * @param integer store year value
11
-   */
10
+     * @param integer store year value
11
+     */
12 12
     protected $year;
13 13
 
14 14
     /**
15
-   * @param string store type of year value
16
-   */
15
+     * @param string store type of year value
16
+     */
17 17
     protected $type;
18 18
 
19 19
     /**
20
-   * @param boolean store result of leap functions
21
-   */
20
+     * @param boolean store result of leap functions
21
+     */
22 22
     protected $result;
23 23
 
24 24
 
25 25
     /**
26
-   * @param $year integer
27
-   * @since Aug, 21 2015
28
-   */
26
+     * @param $year integer
27
+     * @since Aug, 21 2015
28
+     */
29 29
     public function __construct( $year, $type = 'gregorian' ) 
30 30
     {
31 31
 
32
-         $this->year = $year;
32
+          $this->year = $year;
33 33
 
34
-         $this->type = $type;
34
+          $this->type = $type;
35 35
 
36
-         return $this;
36
+          return $this;
37 37
 
38 38
     }
39 39
 
40 40
     /**
41
-   * check the gregorian year is leap or not
42
-   *
43
-   * @since  Oct, 24 2015
44
-   * @return boolean
45
-   */
41
+     * check the gregorian year is leap or not
42
+     *
43
+     * @since  Oct, 24 2015
44
+     * @return boolean
45
+     */
46 46
     public function gregorinLeapYear() 
47 47
     {
48 48
 
@@ -51,11 +51,11 @@  discard block
 block discarded – undo
51 51
     }
52 52
 
53 53
     /**
54
-   * check the jalali year is leap or not
55
-   *
56
-   * @since  Oct, 24 2015
57
-   * @return boolean
58
-   */
54
+     * check the jalali year is leap or not
55
+     *
56
+     * @since  Oct, 24 2015
57
+     * @return boolean
58
+     */
59 59
     public function jalaliLeapYear() 
60 60
     {
61 61
 
@@ -103,11 +103,11 @@  discard block
 block discarded – undo
103 103
     }
104 104
 
105 105
     /**
106
-   * check the hijri year is leap or not
107
-   *
108
-   * @since  Oct, 24 2015
109
-   * @return boolean
110
-   */
106
+     * check the hijri year is leap or not
107
+     *
108
+     * @since  Oct, 24 2015
109
+     * @return boolean
110
+     */
111 111
     public function hijriLeapYear() 
112 112
     {
113 113
 
@@ -122,11 +122,11 @@  discard block
 block discarded – undo
122 122
     }
123 123
 
124 124
     /**
125
-   * return the year is leap or not
126
-   *
127
-   * @since  Aug, 21 2015
128
-   * @return boolean
129
-   */
125
+     * return the year is leap or not
126
+     *
127
+     * @since  Aug, 21 2015
128
+     * @return boolean
129
+     */
130 130
     public function get() 
131 131
     {
132 132
 
Please login to merge, or discard this patch.
src/DayOf.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -34,11 +34,11 @@  discard block
 block discarded – undo
34 34
     }
35 35
 
36 36
     /**
37
-   * Which day of year is current day.
38
-   *
39
-   * @since  Aug, 03 2015
40
-   * @return integer
41
-   */
37
+     * Which day of year is current day.
38
+     *
39
+     * @since  Aug, 03 2015
40
+     * @return integer
41
+     */
42 42
     public function year() 
43 43
     {
44 44
 
@@ -50,11 +50,11 @@  discard block
 block discarded – undo
50 50
 
51 51
 
52 52
     /**
53
-   * Which day of week is current day.
54
-   *
55
-   * @since  Aug, 09 2015
56
-   * @return integer
57
-   */
53
+     * Which day of week is current day.
54
+     *
55
+     * @since  Aug, 09 2015
56
+     * @return integer
57
+     */
58 58
     public function week() 
59 59
     {
60 60
 
Please login to merge, or discard this patch.
src/Datium.php 1 patch
Indentation   +109 added lines, -109 removed lines patch added patch discarded remove patch
@@ -35,17 +35,17 @@  discard block
 block discarded – undo
35 35
 {
36 36
 
37 37
     /**
38
-   * Store DateTime object
39
-   */
38
+     * Store DateTime object
39
+     */
40 40
     protected $date_time;
41 41
 
42 42
     protected static $static_date_time;
43 43
 
44 44
     /**
45
-   * Store config file statements
46
-   *
47
-   * @param array
48
-   */
45
+     * Store config file statements
46
+     *
47
+     * @param array
48
+     */
49 49
     protected $config;
50 50
 
51 51
     protected $date_interval_expression;
@@ -63,10 +63,10 @@  discard block
 block discarded – undo
63 63
     protected $fromConfig;
64 64
 
65 65
     /**
66
-   * Return store day number
67
-   *
68
-   * @param integer
69
-   */
66
+     * Return store day number
67
+     *
68
+     * @param integer
69
+     */
70 70
     protected $day_of;
71 71
 
72 72
     protected $leap;
@@ -92,8 +92,8 @@  discard block
 block discarded – undo
92 92
     protected $language;
93 93
 
94 94
     /**
95
-    * Datium class constructure
96
-    */
95
+     * Datium class constructure
96
+     */
97 97
     public function __construct()
98 98
     {
99 99
 
@@ -154,10 +154,10 @@  discard block
 block discarded – undo
154 154
     }
155 155
 
156 156
     /**
157
-    * Return all datetime parts as an object
158
-    *
159
-    * @return object
160
-    */
157
+     * Return all datetime parts as an object
158
+     *
159
+     * @return object
160
+     */
161 161
     public function all()
162 162
     {
163 163
 
@@ -180,11 +180,11 @@  discard block
 block discarded – undo
180 180
     }
181 181
 
182 182
     /**
183
-   * Get current datetime
184
-   *
185
-   * @since  Aug 17 2015
186
-   * @return object
187
-   */
183
+     * Get current datetime
184
+     *
185
+     * @since  Aug 17 2015
186
+     * @return object
187
+     */
188 188
     public static function now()
189 189
     {
190 190
 
@@ -195,23 +195,23 @@  discard block
 block discarded – undo
195 195
     }
196 196
 
197 197
     /**
198
-   * Create new date time
199
-   *
200
-   * @param integer $year   Year number
201
-   * @param integer $month  month number
202
-   * @param integer $day    day number
203
-   * @param integer $hour   hour number
204
-   * @param integer $minute minute number
205
-   * @param integer $second second number
206
-   *
207
-   * @return object
208
-   */
198
+     * Create new date time
199
+     *
200
+     * @param integer $year   Year number
201
+     * @param integer $month  month number
202
+     * @param integer $day    day number
203
+     * @param integer $hour   hour number
204
+     * @param integer $minute minute number
205
+     * @param integer $second second number
206
+     *
207
+     * @return object
208
+     */
209 209
     public static function create( $year = 2000, $month = 1, $day = 1, $hour = 0, $minute = 0, $second = 0 )
210 210
     {
211 211
 
212 212
         /**
213
-       * When we want to set a Datetime object to Datium
214
-       */
213
+         * When we want to set a Datetime object to Datium
214
+         */
215 215
         if(func_num_args() === 1 ) {
216 216
 
217 217
             self::$static_date_time = func_get_arg(0);
@@ -238,13 +238,13 @@  discard block
 block discarded – undo
238 238
     }
239 239
 
240 240
     /**
241
-    * Select The range between two date object
242
-    *
243
-    * @param object $date_start Start of the DateTime
244
-    * @param object $date_end   End of the DateTime
245
-    *
246
-    * @return object
247
-    */
241
+     * Select The range between two date object
242
+     *
243
+     * @param object $date_start Start of the DateTime
244
+     * @param object $date_end   End of the DateTime
245
+     *
246
+     * @return object
247
+     */
248 248
     public static function between( $date_start, $date_end )
249 249
     {
250 250
 
@@ -259,12 +259,12 @@  discard block
 block discarded – undo
259 259
     }
260 260
 
261 261
     /**
262
-   * Convert from current calendar, what type is current calendar?
263
-   *
264
-   * @param object $calendar Assigned calendar to start from
265
-   *
266
-   * @return $object
267
-   */
262
+     * Convert from current calendar, what type is current calendar?
263
+     *
264
+     * @param object $calendar Assigned calendar to start from
265
+     *
266
+     * @return $object
267
+     */
268 268
     public function from( $calendar )
269 269
     {
270 270
 
@@ -274,8 +274,8 @@  discard block
 block discarded – undo
274 274
 
275 275
 
276 276
         /**
277
-     * We need this part for DayOf class
278
-     */
277
+         * We need this part for DayOf class
278
+         */
279 279
         $this->calendar_type = $calendar;
280 280
 
281 281
         $this->translate_to = $calendar;
@@ -285,12 +285,12 @@  discard block
 block discarded – undo
285 285
     }
286 286
 
287 287
     /**
288
-    * Convert date to current Date
289
-    *
290
-    * @param object $calendar Assigned calendar to when calendar should start.
291
-    *
292
-    * @return object
293
-    */
288
+     * Convert date to current Date
289
+     *
290
+     * @param object $calendar Assigned calendar to when calendar should start.
291
+     *
292
+     * @return object
293
+     */
294 294
     public function to( $calendar )
295 295
     {
296 296
 
@@ -299,8 +299,8 @@  discard block
 block discarded – undo
299 299
         $this->date_time = $this->convert->to($calendar);
300 300
 
301 301
         /**
302
-     * We need this part for DayOf class
303
-     */
302
+         * We need this part for DayOf class
303
+         */
304 304
         $this->calendar_type = $calendar;
305 305
 
306 306
         $this->translate_to = $calendar;
@@ -311,13 +311,13 @@  discard block
 block discarded – undo
311 311
 
312 312
 
313 313
     /**
314
-   * Difference between two time
315
-   *
316
-   * @param DateTime $start Start of the date
317
-   * @param DateTime $end   End of the date
318
-   *
319
-   * @return object
320
-   */
314
+     * Difference between two time
315
+     *
316
+     * @param DateTime $start Start of the date
317
+     * @param DateTime $end   End of the date
318
+     *
319
+     * @return object
320
+     */
321 321
     public static function diff( $start, $end )
322 322
     {
323 323
 
@@ -326,12 +326,12 @@  discard block
 block discarded – undo
326 326
     }
327 327
 
328 328
     /**
329
-   * Add new date value to current date
330
-   *
331
-   * @param string $value How much date should be added to current date
332
-   *
333
-   * @return object
334
-   */
329
+     * Add new date value to current date
330
+     *
331
+     * @param string $value How much date should be added to current date
332
+     *
333
+     * @return object
334
+     */
335 335
     public function add( $value )
336 336
     {
337 337
 
@@ -356,12 +356,12 @@  discard block
 block discarded – undo
356 356
     }
357 357
 
358 358
     /**
359
-   * Sub date from current date
360
-   *
361
-   * @param string $value How much date should increase from current date
362
-   *
363
-   * @return obejct
364
-   */
359
+     * Sub date from current date
360
+     *
361
+     * @param string $value How much date should increase from current date
362
+     *
363
+     * @return obejct
364
+     */
365 365
     public function sub( $value )
366 366
     {
367 367
 
@@ -386,12 +386,12 @@  discard block
 block discarded – undo
386 386
     }
387 387
 
388 388
     /**
389
-   * Check if current year is leap or not
390
-   *
391
-   * @param string $type Name of the calendar to caculate leap year
392
-   *
393
-   * @return boolean
394
-   */
389
+     * Check if current year is leap or not
390
+     *
391
+     * @param string $type Name of the calendar to caculate leap year
392
+     *
393
+     * @return boolean
394
+     */
395 395
     public function leap( $type = 'gregorian' )
396 396
     {
397 397
 
@@ -402,12 +402,12 @@  discard block
 block discarded – undo
402 402
     }
403 403
 
404 404
     /**
405
-    * Caculate day of year or week
406
-    *
407
-    * @since Aug, 22 2015
408
-    *
409
-    * @return integer
410
-    */
405
+     * Caculate day of year or week
406
+     *
407
+     * @since Aug, 22 2015
408
+     *
409
+     * @return integer
410
+     */
411 411
     public function dayOf()
412 412
     {
413 413
 
@@ -435,12 +435,12 @@  discard block
 block discarded – undo
435 435
     // }
436 436
 
437 437
     /**
438
-    * Return Datetime as a original object
439
-    *
440
-    * @since Oct 22, 2015
441
-    *
442
-    * @return object
443
-    */
438
+     * Return Datetime as a original object
439
+     *
440
+     * @since Oct 22, 2015
441
+     *
442
+     * @return object
443
+     */
444 444
     public function object()
445 445
     {
446 446
 
@@ -449,12 +449,12 @@  discard block
 block discarded – undo
449 449
     }
450 450
 
451 451
     /**
452
-    * Translate current date string to selected language
453
-    *
454
-    * @param string $language language short name fa, en, ar ...
455
-    *
456
-    * @return object
457
-    */
452
+     * Translate current date string to selected language
453
+     *
454
+     * @param string $language language short name fa, en, ar ...
455
+     *
456
+     * @return object
457
+     */
458 458
     public function lang( $language = 'fa' )
459 459
     {
460 460
 
@@ -471,14 +471,14 @@  discard block
 block discarded – undo
471 471
     }
472 472
 
473 473
     /**
474
-   * Return fainal result
475
-   *
476
-   * @param string $format Date format
477
-   *
478
-   * @since Aug 17 2015
479
-   *
480
-   * @return string
481
-   */
474
+     * Return fainal result
475
+     *
476
+     * @param string $format Date format
477
+     *
478
+     * @since Aug 17 2015
479
+     *
480
+     * @return string
481
+     */
482 482
     public function get( $format = 'Y-m-d H:i:s' )
483 483
     {
484 484
 
@@ -497,7 +497,7 @@  discard block
 block discarded – undo
497 497
         if (is_null($this->toConfig) ) {
498 498
 
499 499
             $this->toConfig = include 'CalendarSettings/' .
500
-                                       ucfirst($this->translate_to) . '.php';
500
+                                        ucfirst($this->translate_to) . '.php';
501 501
 
502 502
         }
503 503
 
Please login to merge, or discard this patch.
src/CalendarSettings/Gregorian.php 1 patch
Indentation   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -1,20 +1,20 @@  discard block
 block discarded – undo
1 1
 ``<?php
2 2
 
3
- use OpenCafe\Datium as Datium;
3
+  use OpenCafe\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
- 'am_time' => 'AM',
9
+  'am_time' => 'AM',
10 10
 
11
- 'pm_time' => 'PM',
11
+  'pm_time' => 'PM',
12 12
 
13
- 'end_of_days' => array( 'th', 'st', 'nd', 'rd' ),
13
+  'end_of_days' => array( 'th', 'st', 'nd', 'rd' ),
14 14
 
15 15
 
16 16
 
17
- /************************************************************
17
+  /************************************************************
18 18
   *                        Convert to
19 19
   ************************************************************
20 20
   *
@@ -22,11 +22,11 @@  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
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 
87 87
       'December'
88 88
 
89
-     ),
89
+      ),
90 90
 
91 91
     /************************************************************
92 92
     *                        Days of Week
@@ -99,28 +99,28 @@  discard block
 block discarded – undo
99 99
     */
100 100
     'days_of_week' => array (
101 101
 
102
-       'Monday',
103
-       'Tuesday',
104
-       'Wednesday',
105
-       'Thursday',
106
-       'Friday',
107
-       'Saturday',
108
-       'Sunday',
102
+        'Monday',
103
+        'Tuesday',
104
+        'Wednesday',
105
+        'Thursday',
106
+        'Friday',
107
+        'Saturday',
108
+        'Sunday',
109 109
     ),
110 110
 
111 111
 
112 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 ),
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 126
     'day_of_year' => function ( $date_time ) {
Please login to merge, or discard this patch.
src/CalendarSettings/Hijri.php 1 patch
Indentation   +51 added lines, -51 removed lines patch added patch discarded remove patch
@@ -3,9 +3,9 @@  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
10 10
   ************************************************************
11 11
   *
@@ -13,19 +13,19 @@  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
-     $config = include 'Jalali.php';
18
+      $config = include 'Jalali.php';
19 19
 
20
-     $date_time = Datium::create($date_time)->to('jalali')->object();
20
+      $date_time = Datium::create($date_time)->to('jalali')->object();
21 21
 
22
-     $year = $date_time->format('Y');
22
+      $year = $date_time->format('Y');
23 23
 
24
-     $month = $date_time->format('n');
24
+      $month = $date_time->format('n');
25 25
 
26
-     $day = $date_time->format('d');
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 31
 
@@ -40,13 +40,13 @@  discard block
 block discarded – undo
40 40
     if($leap->get() && $month > 11 ) { $temp_day++; 
41 41
     }
42 42
 
43
-     $_year = ( ( ( ( ( $year - 1 ) * 365.2422 ) + $temp_day ) - 119) / 354.3670 ) + 1;
43
+      $_year = ( ( ( ( ( $year - 1 ) * 365.2422 ) + $temp_day ) - 119) / 354.3670 ) + 1;
44 44
 
45
-     $_year = explode('.', $_year);
45
+      $_year = explode('.', $_year);
46 46
 
47
-     $year = $_year[0];
47
+      $year = $_year[0];
48 48
 
49
-     $_month = $_year[1];
49
+      $_month = $_year[1];
50 50
 
51 51
       $var_temp = '0.0';
52 52
 
@@ -58,17 +58,17 @@  discard block
 block discarded – undo
58 58
 
59 59
       $var_temp .= '1';
60 60
 
61
-     $_month = $_month * $var_temp ;
61
+      $_month = $_month * $var_temp ;
62 62
 
63
-     $_month = ( $_month * 12 ) + 1;
63
+      $_month = ( $_month * 12 ) + 1;
64 64
 
65
-     $_month = explode('.', $_month);
65
+      $_month = explode('.', $_month);
66 66
 
67
-     $month = $_month[0];
67
+      $month = $_month[0];
68 68
 
69
-     $_day = $_month[1];
69
+      $_day = $_month[1];
70 70
 
71
-     $var_temp = '0.0';
71
+      $var_temp = '0.0';
72 72
 
73 73
     for ( $i = strlen($_day);  $i > 2;  $i-- ) {
74 74
 
@@ -76,21 +76,21 @@  discard block
 block discarded – undo
76 76
 
77 77
     }
78 78
 
79
-     $var_temp .= '1';
79
+      $var_temp .= '1';
80 80
 
81
-     $_day = $_day * $var_temp;
81
+      $_day = $_day * $var_temp;
82 82
 
83
-     $_day = ( $_day * 29.530 );
83
+      $_day = ( $_day * 29.530 );
84 84
 
85
-     $_day = explode('.', $_day);
85
+      $_day = explode('.', $_day);
86 86
 
87
-     $day = $_day[0];
87
+      $day = $_day[0];
88 88
 
89 89
     $date_time->setDate($year, $month, $day);
90 90
 
91 91
     return $date_time;
92 92
 
93
-   },
93
+    },
94 94
 
95 95
     /************************************************************
96 96
     *                        Convert From
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
 
201 201
         'Dhu al_Hijjah'
202 202
 
203
-     ),
203
+      ),
204 204
 
205 205
     /************************************************************
206 206
     *                        Days of Week
@@ -212,13 +212,13 @@  discard block
 block discarded – undo
212 212
     *\_________________________________________________________/
213 213
     */
214 214
     'days_of_week' => array (
215
-         'al-Aḥad',
216
-         'al-Ithnayn',
217
-         'ath-Thulatha\'',
218
-         'al-Arbi\'a',
219
-         'al-Khamees',
220
-         'al-Jumu\'ah',
221
-         'as-Sabt',
215
+          'al-Aḥad',
216
+          'al-Ithnayn',
217
+          'ath-Thulatha\'',
218
+          'al-Arbi\'a',
219
+          'al-Khamees',
220
+          'al-Jumu\'ah',
221
+          'as-Sabt',
222 222
 
223 223
     ),
224 224
 
@@ -234,17 +234,17 @@  discard block
 block discarded – undo
234 234
 
235 235
 
236 236
     'month_days_number' => array(     1 => 30,
237
-                                     2 => 29,
238
-                                     3 => 30,
239
-                                     4 => 30,
240
-                                     5 => 29,
241
-                                     6 => 29,
242
-                                     7 => 30,
243
-                                     8 => 29,
244
-                                     9 => 30,
245
-                                     10 => 29,
246
-                                     11 => 30,
247
-                                     12 => 30 ),
237
+                                      2 => 29,
238
+                                      3 => 30,
239
+                                      4 => 30,
240
+                                      5 => 29,
241
+                                      6 => 29,
242
+                                      7 => 30,
243
+                                      8 => 29,
244
+                                      9 => 30,
245
+                                      10 => 29,
246
+                                      11 => 30,
247
+                                      12 => 30 ),
248 248
     /************************************************************
249 249
     *                      Day of year
250 250
     ************************************************************
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
     *
254 254
     *\_________________________________________________________/
255 255
     */
256
-     'day_of_year' => function ( $date_time ) {
256
+      'day_of_year' => function ( $date_time ) {
257 257
 
258 258
         $result = null;
259 259
 
@@ -277,9 +277,9 @@  discard block
 block discarded – undo
277 277
 
278 278
         return $result;
279 279
 
280
-     },
280
+      },
281 281
 
282
-     /************************************************************
282
+      /************************************************************
283 283
       *                      Day of week
284 284
       ************************************************************
285 285
       *
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
       *  example : al-Aḥad = result is 1
288 288
       *\_________________________________________________________/
289 289
       */
290
-     'day_of_week' => function ( $date_time ) {
290
+      'day_of_week' => function ( $date_time ) {
291 291
 
292 292
         $configGhamari = include 'Hijri.php';
293 293
 
@@ -307,9 +307,9 @@  discard block
 block discarded – undo
307 307
 
308 308
         }
309 309
 
310
-     },
310
+      },
311 311
 
312
-     /************************************************************
312
+      /************************************************************
313 313
       *                       Leap year
314 314
       ************************************************************
315 315
       *
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
       *
318 318
       *\_________________________________________________________/
319 319
       */
320
-     'leap_year' => null,
320
+      'leap_year' => null,
321 321
 
322 322
     /************************************************************
323 323
     *                        Weekend
Please login to merge, or discard this patch.
src/CalendarSettings/Jalali.php 1 patch
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -47,9 +47,9 @@  discard block
 block discarded – undo
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 54
     if ($leap->get() && $month > 2 ) { $temp_day++; 
55 55
     }
@@ -134,9 +134,9 @@  discard block
 block discarded – undo
134 134
 
135 135
     }
136 136
 
137
-         $date_time->setDate($year, $month, $day);
137
+          $date_time->setDate($year, $month, $day);
138 138
 
139
-         return $date_time;
139
+          return $date_time;
140 140
 
141 141
   },
142 142
 
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
       $date_time->setDate($gregorian_year, $gregorian_month, $gregorian_day);
209 209
 
210 210
 
211
-     return $date_time;
211
+      return $date_time;
212 212
 
213 213
   },
214 214
 
@@ -271,30 +271,30 @@  discard block
 block discarded – undo
271 271
 
272 272
   'days_of_week' => array (
273 273
 
274
-     'Yekshanbe',
275
-     'Doshanbe',
276
-     'Seshanbe',
277
-     'Chaharshanbe',
278
-     'Panjshanbe',
279
-     'Jome',
280
-     'Shanbe',
274
+      'Yekshanbe',
275
+      'Doshanbe',
276
+      'Seshanbe',
277
+      'Chaharshanbe',
278
+      'Panjshanbe',
279
+      'Jome',
280
+      'Shanbe',
281 281
 
282 282
   ),
283 283
 
284 284
   'start_day_of_week' => 'Shanbe',
285 285
 
286 286
   'month_days_number' => array(      1 => 31,
287
-                                     2 => 31,
288
-                                     3 => 31,
289
-                                     4 => 31,
290
-                                     5 => 31,
291
-                                     6 => 31,
292
-                                     7 => 30,
293
-                                     8 => 30,
294
-                                     9 => 30,
295
-                                     10 => 30,
296
-                                     11 => 30,
297
-                                     12 => 29 ),
287
+                                      2 => 31,
288
+                                      3 => 31,
289
+                                      4 => 31,
290
+                                      5 => 31,
291
+                                      6 => 31,
292
+                                      7 => 30,
293
+                                      8 => 30,
294
+                                      9 => 30,
295
+                                      10 => 30,
296
+                                      11 => 30,
297
+                                      12 => 29 ),
298 298
 
299 299
   /************************************************************
300 300
   *                      Day of year
@@ -378,4 +378,4 @@  discard block
 block discarded – undo
378 378
    */
379 379
   'weekend' => array( 'friday' )
380 380
 
381
- );
381
+  );
Please login to merge, or discard this patch.
src/Convert.php 1 patch
Indentation   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -12,48 +12,48 @@  discard block
 block discarded – undo
12 12
 {
13 13
 
14 14
     /**
15
-   * @var integer
16
-   */
15
+     * @var integer
16
+     */
17 17
     protected $year;
18 18
 
19 19
     /**
20
-   * @var integer
21
-   */
20
+     * @var integer
21
+     */
22 22
     protected $month;
23 23
 
24 24
     /**
25
-   * @var $day
26
-   */
25
+     * @var $day
26
+     */
27 27
     protected $day;
28 28
 
29 29
     /**
30
-   * @var DateTime
31
-   */
30
+     * @var DateTime
31
+     */
32 32
     public $date_time;
33 33
 
34 34
     /**
35
-   * @var array
36
-   */
35
+     * @var array
36
+     */
37 37
     protected $config;
38 38
 
39 39
     /**
40
-   * @var integer
41
-   */
40
+     * @var integer
41
+     */
42 42
     protected $leap;
43 43
 
44 44
     /**
45
-   * @var integer
46
-   */
45
+     * @var integer
46
+     */
47 47
     protected $temp_day;
48 48
 
49 49
     /**
50
-   * @var DateTime
51
-   */
50
+     * @var DateTime
51
+     */
52 52
     protected $date;
53 53
 
54 54
     /**
55
-   * @var array
56
-   */
55
+     * @var array
56
+     */
57 57
     protected $calendar_file;
58 58
 
59 59
     /************************************************************
@@ -104,11 +104,11 @@  discard block
 block discarded – undo
104 104
     }
105 105
 
106 106
     /**
107
-   *convert jalali year to gregorian year
108
- *
109
-   * @since  Oct, 16 2015
110
-   * @return object
111
-   */
107
+     *convert jalali year to gregorian year
108
+     *
109
+     * @since  Oct, 16 2015
110
+     * @return object
111
+     */
112 112
     public function jalaliToGregorian( $date_time ) 
113 113
     {
114 114
 
@@ -172,16 +172,16 @@  discard block
 block discarded – undo
172 172
           $this->date_time->setDate($gregorian_year, $gregorian_month, $gregorian_day);
173 173
 
174 174
 
175
-         return $this->date_time;
175
+          return $this->date_time;
176 176
 
177 177
     }
178 178
 
179 179
     /**
180
-   *convert jalali year to hijri year
181
- *
182
-   * @since  Oct, 17 2015
183
-   * @return object
184
-   */
180
+     *convert jalali year to hijri year
181
+     *
182
+     * @since  Oct, 17 2015
183
+     * @return object
184
+     */
185 185
     public function jalaliToHijri( $date_time ) 
186 186
     {
187 187
 
@@ -203,9 +203,9 @@  discard block
 block discarded – undo
203 203
 
204 204
         }
205 205
 
206
-         $this->temp_day += $this->day;
206
+          $this->temp_day += $this->day;
207 207
 
208
-         $this->leap = new Leap($this->year);
208
+          $this->leap = new Leap($this->year);
209 209
 
210 210
         if ($this->leap->get() && $this->month > 11 ) { $this->temp_day++; 
211 211
         }
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
 
219 219
         $_month = $_year[1];
220 220
 
221
-         $var_temp = '0.0';
221
+          $var_temp = '0.0';
222 222
 
223 223
         for ( $i = strlen($_month); $i > 2; $i-- ) {
224 224
 
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 
227 227
         }
228 228
 
229
-         $var_temp .= '1';
229
+          $var_temp .= '1';
230 230
 
231 231
         $_month = $_month * $var_temp ;
232 232
 
@@ -256,18 +256,18 @@  discard block
 block discarded – undo
256 256
 
257 257
         $this->day = $_day[0];
258 258
 
259
-           $this->date_time->setDate($this->year, $this->month, $this->day);
259
+            $this->date_time->setDate($this->year, $this->month, $this->day);
260 260
 
261
-           return $this->date_time;
261
+            return $this->date_time;
262 262
 
263 263
     }
264 264
 
265 265
     /**
266
-   *convert hijri year to jalali year
267
- *
268
-   * @since  Oct, 17 2015
269
-   * @return object
270
-   */
266
+     *convert hijri year to jalali year
267
+     *
268
+     * @since  Oct, 17 2015
269
+     * @return object
270
+     */
271 271
     public function hijriToJalali( $date_time ) 
272 272
     {
273 273
 
@@ -320,16 +320,16 @@  discard block
 block discarded – undo
320 320
 
321 321
           $this->date_time->setDate($jalali_year, $jalali_month, $jalali_day);
322 322
 
323
-         return $this->date_time;
323
+          return $this->date_time;
324 324
 
325 325
     }
326 326
 
327 327
     /**
328
-    * convert hijri year to gregorian year
329
-   *
330
-    * @since  Oct, 17 2015
331
-    * @return object
332
-    */
328
+     * convert hijri year to gregorian year
329
+     *
330
+     * @since  Oct, 17 2015
331
+     * @return object
332
+     */
333 333
     public function hijriToGregorian( $date_time ) 
334 334
     {
335 335
 
@@ -382,7 +382,7 @@  discard block
 block discarded – undo
382 382
 
383 383
         $this->date_time->setDate($gregorian_year, $gregorian_month, $gregorian_day);
384 384
 
385
-         return $this->date_time;
385
+          return $this->date_time;
386 386
 
387 387
     }
388 388
 
Please login to merge, or discard this patch.
src/Lang.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -42,13 +42,13 @@
 block discarded – undo
42 42
     {
43 43
 
44 44
         /**
45
-       * Fetch translated file to config attribute
46
-       */
45
+         * Fetch translated file to config attribute
46
+         */
47 47
         self::$config = include 'src/CalendarSettings/Jalali.php';
48 48
 
49 49
         /**
50
-        * Fetch translated expression to langTable attribute
51
-        */
50
+         * Fetch translated expression to langTable attribute
51
+         */
52 52
         self::$langTable = include 'lang/' . $language . '/general.php';
53 53
 
54 54
         foreach( self::$langTable as $key => $translate ){
Please login to merge, or discard this patch.