Completed
Push — master ( 6ef271...8502f6 )
by
unknown
13s
created
src/CalendarSettings/Julian.php 2 patches
Indentation   +35 added lines, -35 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 [
5
+  return [
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,23 +22,23 @@  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
-     $year = $date_time->format('Y');
27
+      $year = $date_time->format('Y');
28 28
 
29
-     $month = $date_time->format('m');
29
+      $month = $date_time->format('m');
30 30
 
31
-     $day = $date_time->format('d');
31
+      $day = $date_time->format('d');
32 32
 
33
-     $jd = gregoriantojd($month, $day, $year);
33
+      $jd = gregoriantojd($month, $day, $year);
34 34
 
35
-     $date = explode('/', jdtojulian( $jd ));
35
+      $date = explode('/', jdtojulian( $jd ));
36 36
 
37
-     $date_time->setDate($date[2], $date[0], $date[1]);
37
+      $date_time->setDate($date[2], $date[0], $date[1]);
38 38
 
39
-     return $date_time;
39
+      return $date_time;
40 40
 
41
-   },
41
+    },
42 42
 
43 43
     /************************************************************
44 44
     *                        Convert From
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 
111 111
       'December'
112 112
 
113
-     ),
113
+      ),
114 114
 
115 115
     /************************************************************
116 116
     *                        Days of Week
@@ -123,28 +123,28 @@  discard block
 block discarded – undo
123 123
     */
124 124
     'days_of_week' => array (
125 125
 
126
-       'Monday',
127
-       'Tuesday',
128
-       'Wednesday',
129
-       'Thursday',
130
-       'Friday',
131
-       'Saturday',
132
-       'Sunday',
126
+        'Monday',
127
+        'Tuesday',
128
+        'Wednesday',
129
+        'Thursday',
130
+        'Friday',
131
+        'Saturday',
132
+        'Sunday',
133 133
     ),
134 134
 
135 135
 
136 136
     'month_days_number' => array(  1 => 31,
137
-                                   2 => 28,
138
-                                   3 => 31,
139
-                                   4 => 30,
140
-                                   5 => 31,
141
-                                   6 => 30,
142
-                                   7 => 31,
143
-                                   8 => 31,
144
-                                   9 => 30,
145
-                                   10 => 31,
146
-                                   11 => 30,
147
-                                   12 => 30 ),
137
+                                    2 => 28,
138
+                                    3 => 31,
139
+                                    4 => 30,
140
+                                    5 => 31,
141
+                                    6 => 30,
142
+                                    7 => 31,
143
+                                    8 => 31,
144
+                                    9 => 30,
145
+                                    10 => 31,
146
+                                    11 => 30,
147
+                                    12 => 30 ),
148 148
 
149 149
 
150 150
     'day_of_year' => function ($date_time) {
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -4,13 +4,13 @@  discard block
 block discarded – undo
4 4
 
5 5
  return [
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
  'am_time' => 'AM',
10 10
 
11 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
 
@@ -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
      $year = $date_time->format('Y');
28 28
 
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 
33 33
      $jd = gregoriantojd($month, $day, $year);
34 34
 
35
-     $date = explode('/', jdtojulian( $jd ));
35
+     $date = explode('/', jdtojulian($jd));
36 36
 
37 37
      $date_time->setDate($date[2], $date[0], $date[1]);
38 38
 
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
     *
49 49
     *\_________________________________________________________/
50 50
     */
51
-    'convert_from' => function ($date_time) {
51
+    'convert_from' => function($date_time) {
52 52
 
53 53
       $year = $date_time->format('Y');
54 54
 
@@ -56,9 +56,9 @@  discard block
 block discarded – undo
56 56
 
57 57
       $day = $date_time->format('d');
58 58
 
59
-      $date = juliantojd( $month, $day, $year );
59
+      $date = juliantojd($month, $day, $year);
60 60
 
61
-      $date = explode('/', JDToGregorian( $date ) );
61
+      $date = explode('/', JDToGregorian($date));
62 62
 
63 63
       $date_time->setDate($date[2], $date[0], $date[1]);
64 64
 
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
     *
122 122
     *\_________________________________________________________/
123 123
     */
124
-    'days_of_week' => array (
124
+    'days_of_week' => array(
125 125
 
126 126
        'Monday',
127 127
        'Tuesday',
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
     ),
134 134
 
135 135
 
136
-    'month_days_number' => array(  1 => 31,
136
+    'month_days_number' => array(1 => 31,
137 137
                                    2 => 28,
138 138
                                    3 => 31,
139 139
                                    4 => 30,
@@ -144,10 +144,10 @@  discard block
 block discarded – undo
144 144
                                    9 => 30,
145 145
                                    10 => 31,
146 146
                                    11 => 30,
147
-                                   12 => 30 ),
147
+                                   12 => 30),
148 148
 
149 149
 
150
-    'day_of_year' => function ($date_time) {
150
+    'day_of_year' => function($date_time) {
151 151
 
152 152
         $result = null;
153 153
 
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 
172 172
     },
173 173
 
174
-    'day_of_week' => function ($date_time) {
174
+    'day_of_week' => function($date_time) {
175 175
 
176 176
         $config = include 'Julian.php';
177 177
 
@@ -193,9 +193,9 @@  discard block
 block discarded – undo
193 193
     *
194 194
     *\_________________________________________________________/
195 195
     */
196
-    'leap_year' => function ($year) {
196
+    'leap_year' => function($year) {
197 197
 
198
-        return ( ( ( $year % 4 ) == 0 ) && ( ( ( $year % 100 ) != 0 ) || ( ( $year % 400 ) == 0 ) ) );
198
+        return ((($year % 4) == 0) && ((($year % 100) != 0) || (($year % 400) == 0)));
199 199
 
200 200
     },
201 201
 
@@ -207,6 +207,6 @@  discard block
 block discarded – undo
207 207
     *
208 208
     *\_________________________________________________________/
209 209
     */
210
-    'weekend' => array( 'saturday', 'sunday' ),
210
+    'weekend' => array('saturday', 'sunday'),
211 211
 
212 212
   ];
Please login to merge, or discard this patch.
src/lang/krd/general.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2,9 +2,9 @@
 block discarded – undo
2 2
 
3 3
   return array(
4 4
 
5
-       'events' => array(),
5
+        'events' => array(),
6 6
 
7
-       'month' => array(
7
+        'month' => array(
8 8
                           'خاکەلێوە',
9 9
                           'گوڵان',
10 10
                           'زجۆزەردان',
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,5 +37,5 @@
 block discarded – undo
37 37
 
38 38
         'end_of_days' => array(),
39 39
 
40
-        'numbers' => array( '۰', '۱', '۲', '۳', '۴', '۵', '۶', '۷', '۸', '۹' ),
40
+        'numbers' => array('۰', '۱', '۲', '۳', '۴', '۵', '۶', '۷', '۸', '۹'),
41 41
   );
Please login to merge, or discard this patch.
src/DayOf.php 2 patches
Indentation   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -7,35 +7,35 @@  discard block
 block discarded – undo
7 7
  */
8 8
 class DayOf
9 9
 {
10
-	/**
11
-     * @var object
12
-     */
10
+  /**
11
+   * @var object
12
+   */
13 13
     protected $date_time;
14 14
 
15
-	/**
16
-     * @var array
17
-     */
15
+  /**
16
+   * @var array
17
+   */
18 18
     protected $config;
19 19
 
20
-	/**
21
-	 * @var string
22
-	 */
23
-	protected $calendar_type;
20
+  /**
21
+   * @var string
22
+   */
23
+  protected $calendar_type;
24 24
 
25 25
     /**
26 26
      * @var int
27 27
      */
28 28
     protected $day_of_week;
29 29
 
30
-	/**
31
-   	 * Constructor of DayOf class
32
-     */
30
+  /**
31
+   * Constructor of DayOf class
32
+   */
33 33
     public function __construct($date_time, $calendar_type = 'gregorian', $day_of_week = null)
34 34
     {
35 35
 
36
-		$this->config = include __DIR__.'/CalendarSettings/' . ucfirst($calendar_type) . '.php';
36
+    $this->config = include __DIR__.'/CalendarSettings/' . ucfirst($calendar_type) . '.php';
37 37
 
38
-		$this->calendar_type = $calendar_type;
38
+    $this->calendar_type = $calendar_type;
39 39
 
40 40
         $this->date_time = $date_time;
41 41
 
@@ -46,11 +46,11 @@  discard block
 block discarded – undo
46 46
     }
47 47
 
48 48
     /**
49
-   * Which day of year is current day.
50
-   *
51
-   * @since  Aug, 03 2015
52
-   * @return integer
53
-   */
49
+     * Which day of year is current day.
50
+     *
51
+     * @since  Aug, 03 2015
52
+     * @return integer
53
+     */
54 54
     public function year()
55 55
     {
56 56
 
@@ -60,56 +60,56 @@  discard block
 block discarded – undo
60 60
 
61 61
 
62 62
     /**
63
-   * Which day of week is current day.
64
-   *
65
-   * @since  Aug, 09 2015
66
-   * @return integer
67
-   */
63
+     * Which day of week is current day.
64
+     *
65
+     * @since  Aug, 09 2015
66
+     * @return integer
67
+     */
68 68
     public function week()
69 69
     {
70 70
         return $this->config[ 'day_of_week' ]( $this->date_time, $this->day_of_week );
71 71
 
72 72
     }
73 73
 
74
-	/**
75
-	 * Return last day of current month
76
-	 *
77
-	 * @since  Oct, 18 2016
78
-	 * @return integer
79
-	 */
80
-	public function lastDayMonth() {
74
+  /**
75
+   * Return last day of current month
76
+   *
77
+   * @since  Oct, 18 2016
78
+   * @return integer
79
+   */
80
+  public function lastDayMonth() {
81 81
 
82
-		$days = 0;
82
+    $days = 0;
83 83
 
84
-		switch ( $this->calendar_type ) {
84
+    switch ( $this->calendar_type ) {
85 85
 
86
-			case 'gregorian':
86
+      case 'gregorian':
87 87
 
88
-				$days = ( intval( $this->date_time->format( 'm' ) ) == 2 &&
89
-				      	$this->config[ 'leap_year' ]( $this->date_time->format( 'Y' )) ) ?
90
-						$this->config[ 'month_days_number' ][ intval( $this->date_time->format( 'm' ) ) ] + 1 :
91
-						$this->config[ 'month_days_number' ][ intval( $this->date_time->format( 'm' ) ) ];
88
+        $days = ( intval( $this->date_time->format( 'm' ) ) == 2 &&
89
+                $this->config[ 'leap_year' ]( $this->date_time->format( 'Y' )) ) ?
90
+            $this->config[ 'month_days_number' ][ intval( $this->date_time->format( 'm' ) ) ] + 1 :
91
+            $this->config[ 'month_days_number' ][ intval( $this->date_time->format( 'm' ) ) ];
92 92
 
93
-				break;
93
+        break;
94 94
 
95
-			case 'jalali':
95
+      case 'jalali':
96 96
 
97
-				$days = ( intval( $this->date_time->format( 'm' ) ) == 12 &&
98
-				  		$this->config[ 'leap_year' ]( $this->date_time->format( 'Y' )) ) ?
99
-				 	 	$this->config[ 'month_days_number' ][ intval( $this->date_time->format( 'm' ) ) ] + 1 :
100
-					 	$this->config[ 'month_days_number' ][ intval( $this->date_time->format( 'm' ) ) ];
97
+        $days = ( intval( $this->date_time->format( 'm' ) ) == 12 &&
98
+              $this->config[ 'leap_year' ]( $this->date_time->format( 'Y' )) ) ?
99
+              $this->config[ 'month_days_number' ][ intval( $this->date_time->format( 'm' ) ) ] + 1 :
100
+             $this->config[ 'month_days_number' ][ intval( $this->date_time->format( 'm' ) ) ];
101 101
 
102
-			  	break;
102
+          break;
103 103
 
104
-		  default:
104
+      default:
105 105
 
106
-			$days = $this->config[ 'month_days_number' ][ intval( $this->date_time->format( 'm' ) ) ];
106
+      $days = $this->config[ 'month_days_number' ][ intval( $this->date_time->format( 'm' ) ) ];
107 107
 
108
-			break;
108
+      break;
109 109
 
110
-		}
110
+    }
111 111
 
112
-		return $days;
112
+    return $days;
113 113
 
114
-	}
114
+  }
115 115
 }
Please login to merge, or discard this patch.
Spacing   +11 added lines, -13 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
     public function __construct($date_time, $calendar_type = 'gregorian', $day_of_week = null)
34 34
     {
35 35
 
36
-		$this->config = include __DIR__.'/CalendarSettings/' . ucfirst($calendar_type) . '.php';
36
+		$this->config = include __DIR__.'/CalendarSettings/'.ucfirst($calendar_type).'.php';
37 37
 
38 38
 		$this->calendar_type = $calendar_type;
39 39
 
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
     public function year()
55 55
     {
56 56
 
57
-        return $this->config[ 'day_of_year' ]( $this->date_time );
57
+        return $this->config['day_of_year']($this->date_time);
58 58
 
59 59
     }
60 60
 
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
    */
68 68
     public function week()
69 69
     {
70
-        return $this->config[ 'day_of_week' ]( $this->date_time, $this->day_of_week );
70
+        return $this->config['day_of_week']($this->date_time, $this->day_of_week);
71 71
 
72 72
     }
73 73
 
@@ -81,29 +81,27 @@  discard block
 block discarded – undo
81 81
 
82 82
 		$days = 0;
83 83
 
84
-		switch ( $this->calendar_type ) {
84
+		switch ($this->calendar_type) {
85 85
 
86 86
 			case 'gregorian':
87 87
 
88
-				$days = ( intval( $this->date_time->format( 'm' ) ) == 2 &&
89
-				      	$this->config[ 'leap_year' ]( $this->date_time->format( 'Y' )) ) ?
90
-						$this->config[ 'month_days_number' ][ intval( $this->date_time->format( 'm' ) ) ] + 1 :
91
-						$this->config[ 'month_days_number' ][ intval( $this->date_time->format( 'm' ) ) ];
88
+				$days = (intval($this->date_time->format('m')) == 2 &&
89
+				      	$this->config['leap_year']($this->date_time->format('Y'))) ?
90
+						$this->config['month_days_number'][intval($this->date_time->format('m'))] + 1 : $this->config['month_days_number'][intval($this->date_time->format('m'))];
92 91
 
93 92
 				break;
94 93
 
95 94
 			case 'jalali':
96 95
 
97
-				$days = ( intval( $this->date_time->format( 'm' ) ) == 12 &&
98
-				  		$this->config[ 'leap_year' ]( $this->date_time->format( 'Y' )) ) ?
99
-				 	 	$this->config[ 'month_days_number' ][ intval( $this->date_time->format( 'm' ) ) ] + 1 :
100
-					 	$this->config[ 'month_days_number' ][ intval( $this->date_time->format( 'm' ) ) ];
96
+				$days = (intval($this->date_time->format('m')) == 12 &&
97
+				  		$this->config['leap_year']($this->date_time->format('Y'))) ?
98
+				 	 	$this->config['month_days_number'][intval($this->date_time->format('m'))] + 1 : $this->config['month_days_number'][intval($this->date_time->format('m'))];
101 99
 
102 100
 			  	break;
103 101
 
104 102
 		  default:
105 103
 
106
-			$days = $this->config[ 'month_days_number' ][ intval( $this->date_time->format( 'm' ) ) ];
104
+			$days = $this->config['month_days_number'][intval($this->date_time->format('m'))];
107 105
 
108 106
 			break;
109 107
 
Please login to merge, or discard this patch.
src/CalendarSettings/Kurdish.php 2 patches
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -118,30 +118,30 @@  discard block
 block discarded – undo
118 118
 
119 119
   'days_of_week' => array (
120 120
 
121
-     'Yekşeme',
122
-     'Dúşeme',
123
-     'Séşeme',
124
-     'Çúwarşeme',
125
-     'Péncşeme',
126
-     'Heyní',
127
-     'Şeme',
121
+      'Yekşeme',
122
+      'Dúşeme',
123
+      'Séşeme',
124
+      'Çúwarşeme',
125
+      'Péncşeme',
126
+      'Heyní',
127
+      'Şeme',
128 128
 
129 129
   ),
130 130
 
131 131
   'start_day_of_week' => 'Şeme',
132 132
 
133 133
   'month_days_number' => array(      1 => 31,
134
-                                     2 => 31,
135
-                                     3 => 31,
136
-                                     4 => 31,
137
-                                     5 => 31,
138
-                                     6 => 31,
139
-                                     7 => 30,
140
-                                     8 => 30,
141
-                                     9 => 30,
142
-                                     10 => 30,
143
-                                     11 => 30,
144
-                                     12 => 29 ),
134
+                                      2 => 31,
135
+                                      3 => 31,
136
+                                      4 => 31,
137
+                                      5 => 31,
138
+                                      6 => 31,
139
+                                      7 => 30,
140
+                                      8 => 30,
141
+                                      9 => 30,
142
+                                      10 => 30,
143
+                                      11 => 30,
144
+                                      12 => 29 ),
145 145
 
146 146
   /************************************************************
147 147
   *                      Day of year
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
 
214 214
         foreach ($days as $key => $value) {
215 215
             if ($day == $value) {
216
-               return $key;
216
+                return $key;
217 217
             }
218 218
         }
219 219
 
@@ -229,9 +229,9 @@  discard block
 block discarded – undo
229 229
    */
230 230
   'leap_year' => function ($year) {
231 231
 
232
-     $a = 0.025;
232
+      $a = 0.025;
233 233
 
234
-     $b = 266;
234
+      $b = 266;
235 235
 
236 236
     if ($year > 0) {
237 237
         $leapDays0 = (($year + 38) % 2820)*0.24219 + $a;
@@ -245,8 +245,8 @@  discard block
 block discarded – undo
245 245
         return false;
246 246
     }
247 247
 
248
-     $frac0 = intval(($leapDays0 - intval($leapDays0))*1000);
249
-     $frac1 = intval(($leapDays1 - intval($leapDays1))*1000);
248
+      $frac0 = intval(($leapDays0 - intval($leapDays0))*1000);
249
+      $frac1 = intval(($leapDays1 - intval($leapDays1))*1000);
250 250
 
251 251
     if ($frac0 <= $b && $frac1 > $b) {
252 252
         return true;
@@ -266,4 +266,4 @@  discard block
 block discarded – undo
266 266
    */
267 267
   'weekend' => array( 'friday' )
268 268
 
269
- );
269
+  );
Please login to merge, or discard this patch.
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -3,19 +3,19 @@  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
   'language' =>  'ku',
9 9
 
10 10
   'events' => array(),
11 11
 
12
-  'numbers' => array( '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'),
12
+  'numbers' => array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9'),
13 13
 
14 14
   'am_time' => 'AM',
15 15
 
16 16
   'pm_time' => 'PM',
17 17
 
18
-  'end_of_days' => array( 'th', 'st', 'nd', 'rd' ),
18
+  'end_of_days' => array('th', 'st', 'nd', 'rd'),
19 19
 
20 20
 
21 21
 
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
  *
28 28
  *\_________________________________________________________/
29 29
  */
30
-  'convert_to' => function ($date_time) {
30
+  'convert_to' => function($date_time) {
31 31
 
32 32
         $jalali = include 'Jalali.php';
33 33
 
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
    *
47 47
    *\_________________________________________________________/
48 48
    */
49
-  'convert_from' => function ($date_time) {
49
+  'convert_from' => function($date_time) {
50 50
 
51 51
     $jalali = include 'Jalali.php';
52 52
 
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
    *
78 78
    *\_________________________________________________________/
79 79
    */
80
-  'month' => array (
80
+  'month' => array(
81 81
 
82 82
     'Xakelêw',
83 83
 
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
    */
117 117
 
118 118
 
119
-  'days_of_week' => array (
119
+  'days_of_week' => array(
120 120
 
121 121
      'Yekşeme',
122 122
      'Dúşeme',
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 
131 131
   'start_day_of_week' => 'Şeme',
132 132
 
133
-  'month_days_number' => array(      1 => 31,
133
+  'month_days_number' => array(1 => 31,
134 134
                                      2 => 31,
135 135
                                      3 => 31,
136 136
                                      4 => 31,
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
                                      9 => 30,
142 142
                                      10 => 30,
143 143
                                      11 => 30,
144
-                                     12 => 29 ),
144
+                                     12 => 29),
145 145
 
146 146
   /************************************************************
147 147
   *                      Day of year
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
   *
152 152
   *\_________________________________________________________/
153 153
   */
154
-  'day_of_year' => function ($date_time) {
154
+  'day_of_year' => function($date_time) {
155 155
 
156 156
     $result = null;
157 157
 
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
 
162 162
     $day = $date_time->format('d');
163 163
 
164
-    foreach ($config[ 'month_days_number' ] as $_month => $value) {
164
+    foreach ($config['month_days_number'] as $_month => $value) {
165 165
         if ($_month < $month) {
166 166
             $result += $value;
167 167
         }
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
    *  example : Yekshanbe = result is 2
182 182
    *\_________________________________________________________/
183 183
   */
184
-  'day_of_week' => function ($date_tim, $day_of_week) {
184
+  'day_of_week' => function($date_tim, $day_of_week) {
185 185
 
186 186
       $days_of_week = array(
187 187
           'Dúşeme',
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
         $configGregorian = include 'Gregorian.php';
207 207
 
208 208
         $day = str_replace(
209
-            $configGregorian[ 'days_of_week' ],
209
+            $configGregorian['days_of_week'],
210 210
             $days_of_week,
211 211
             $day_of_week
212 212
         );
@@ -227,26 +227,26 @@  discard block
 block discarded – undo
227 227
    *
228 228
    *\_________________________________________________________/
229 229
    */
230
-  'leap_year' => function ($year) {
230
+  'leap_year' => function($year) {
231 231
 
232 232
      $a = 0.025;
233 233
 
234 234
      $b = 266;
235 235
 
236 236
     if ($year > 0) {
237
-        $leapDays0 = (($year + 38) % 2820)*0.24219 + $a;
237
+        $leapDays0 = (($year + 38) % 2820) * 0.24219 + $a;
238 238
         // 0.24219 ~ extra days of one year
239
-        $leapDays1 = (($year + 39) % 2820)*0.24219 + $a;
239
+        $leapDays1 = (($year + 39) % 2820) * 0.24219 + $a;
240 240
         // 38 days is the difference of epoch to 2820-year cycle
241 241
     } elseif ($year < 0) {
242
-        $leapDays0 = (($year + 39) % 2820)*0.24219 + $a;
243
-        $leapDays1 = (($year + 40) % 2820)*0.24219 + $a;
242
+        $leapDays0 = (($year + 39) % 2820) * 0.24219 + $a;
243
+        $leapDays1 = (($year + 40) % 2820) * 0.24219 + $a;
244 244
     } else {
245 245
         return false;
246 246
     }
247 247
 
248
-     $frac0 = intval(($leapDays0 - intval($leapDays0))*1000);
249
-     $frac1 = intval(($leapDays1 - intval($leapDays1))*1000);
248
+     $frac0 = intval(($leapDays0 - intval($leapDays0)) * 1000);
249
+     $frac1 = intval(($leapDays1 - intval($leapDays1)) * 1000);
250 250
 
251 251
     if ($frac0 <= $b && $frac1 > $b) {
252 252
         return true;
@@ -264,6 +264,6 @@  discard block
 block discarded – undo
264 264
    *
265 265
    *\_________________________________________________________/
266 266
    */
267
-  'weekend' => array( 'friday' )
267
+  'weekend' => array('friday')
268 268
 
269 269
  );
Please login to merge, or discard this patch.
src/CalendarSettings/Hijri.php 2 patches
Indentation   +55 added lines, -55 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
 
6 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
         $temp_day += $config[ 'month_days_number' ][ $i ];
@@ -39,13 +39,13 @@  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
-     $_year = explode('.', $_year);
44
+      $_year = explode('.', $_year);
45 45
 
46
-     $year = $_year[0];
46
+      $year = $_year[0];
47 47
 
48
-     $_month = $_year[1];
48
+      $_month = $_year[1];
49 49
 
50 50
       $var_temp = '0.0';
51 51
 
@@ -55,37 +55,37 @@  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
-     $_month = explode('.', $_month);
62
+      $_month = explode('.', $_month);
63 63
 
64
-     $month = $_month[0];
64
+      $month = $_month[0];
65 65
 
66
-     $_day = $_month[1];
66
+      $_day = $_month[1];
67 67
 
68
-     $var_temp = '0.0';
68
+      $var_temp = '0.0';
69 69
 
70 70
     for ($i = strlen($_day); $i > 2; $i--) {
71 71
         $var_temp .= '0' ;
72 72
     }
73 73
 
74
-     $var_temp .= '1';
74
+      $var_temp .= '1';
75 75
 
76
-     $_day = $_day * $var_temp;
76
+      $_day = $_day * $var_temp;
77 77
 
78
-     $_day = ( $_day * 29.530 );
78
+      $_day = ( $_day * 29.530 );
79 79
 
80
-     $_day = explode('.', $_day);
80
+      $_day = explode('.', $_day);
81 81
 
82
-     $day = $_day[0];
82
+      $day = $_day[0];
83 83
 
84 84
     $date_time->setDate($year, $month, $day);
85 85
 
86 86
     return $date_time;
87 87
 
88
-   },
88
+    },
89 89
 
90 90
     /************************************************************
91 91
     *                        Convert From
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 
166 166
         'Dhu al_Hijjah'
167 167
 
168
-     ),
168
+      ),
169 169
 
170 170
     /************************************************************
171 171
     *                        Days of Week
@@ -178,13 +178,13 @@  discard block
 block discarded – undo
178 178
     */
179 179
     'days_of_week' => array (
180 180
         
181
-         'al-Aḥad',
182
-         'al-Ithnayn',
183
-         'ath-Thulatha\'',
184
-         'al-Arbi\'a',
185
-         'al-Khamees',
186
-         'al-Jumu\'ah',
187
-         'as-Sabt',
181
+          'al-Aḥad',
182
+          'al-Ithnayn',
183
+          'ath-Thulatha\'',
184
+          'al-Arbi\'a',
185
+          'al-Khamees',
186
+          'al-Jumu\'ah',
187
+          'as-Sabt',
188 188
     ),
189 189
 
190 190
     'numbers' => array( '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'),
@@ -199,17 +199,17 @@  discard block
 block discarded – undo
199 199
 
200 200
 
201 201
     'month_days_number' => array(    1 => 30,
202
-                                     2 => 29,
203
-                                     3 => 30,
204
-                                     4 => 30,
205
-                                     5 => 29,
206
-                                     6 => 29,
207
-                                     7 => 30,
208
-                                     8 => 29,
209
-                                     9 => 30,
210
-                                     10 => 29,
211
-                                     11 => 30,
212
-                                     12 => 30 ),
202
+                                      2 => 29,
203
+                                      3 => 30,
204
+                                      4 => 30,
205
+                                      5 => 29,
206
+                                      6 => 29,
207
+                                      7 => 30,
208
+                                      8 => 29,
209
+                                      9 => 30,
210
+                                      10 => 29,
211
+                                      11 => 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
 
@@ -238,9 +238,9 @@  discard block
 block discarded – undo
238 238
 
239 239
         return $result;
240 240
 
241
-     },
241
+      },
242 242
 
243
-     /************************************************************
243
+      /************************************************************
244 244
       *                      Day of week
245 245
       ************************************************************
246 246
       *
@@ -248,9 +248,9 @@  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
-         $days_of_week = array(
253
+          $days_of_week = array(
254 254
             'al-Ithnayn',
255 255
             'ath-Thulatha\'',
256 256
             'al-Arbi\'a',
@@ -258,9 +258,9 @@  discard block
 block discarded – undo
258 258
             'al-Jumu\'ah',
259 259
             'as-Sabt',
260 260
             'al-Aḥad',
261
-         );
261
+          );
262 262
 
263
-         $days = array(
263
+          $days = array(
264 264
             1 => 'al-Aḥad',
265 265
             2 => 'al-Ithnayn',
266 266
             3 => 'ath-Thulatha\'',
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
             5 => 'al-Khamees',
269 269
             6 => 'al-Jumu\'ah',
270 270
             7 => 'as-Sabt',
271
-         );
271
+          );
272 272
 
273 273
         $configGregorian = include 'Gregorian.php';
274 274
 
@@ -280,9 +280,9 @@  discard block
 block discarded – undo
280 280
             }
281 281
         }
282 282
 
283
-     },
283
+      },
284 284
 
285
-     /************************************************************
285
+      /************************************************************
286 286
       *                       Leap year
287 287
       ************************************************************
288 288
       *
@@ -290,7 +290,7 @@  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 296
         if (( 2 == $result )
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
         ) {
308 308
             return $result;
309 309
         }
310
-     },
310
+      },
311 311
 
312 312
     /************************************************************
313 313
     *                        Weekend
Please login to merge, or discard this 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.