Completed
Push — master ( 197347...f6fd8e )
by mehdi
02:04
created
src/Convert.php 1 patch
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -78,9 +78,9 @@  discard block
 block discarded – undo
78 78
     public function from($calendar)
79 79
     {
80 80
 
81
-        $this->calendar_file = include __DIR__.'/CalendarSettings/' . ucfirst($calendar) . '.php';
81
+        $this->calendar_file = include __DIR__.'/CalendarSettings/'.ucfirst($calendar).'.php';
82 82
 
83
-        return $this->calendar_file[ 'convert_from' ]( $this->date_time );
83
+        return $this->calendar_file['convert_from']($this->date_time);
84 84
 
85 85
     }
86 86
 
@@ -95,9 +95,9 @@  discard block
 block discarded – undo
95 95
     public function to($calendar)
96 96
     {
97 97
 
98
-        $this->calendar_file = include __DIR__.'/CalendarSettings/' . ucfirst($calendar) . '.php';
98
+        $this->calendar_file = include __DIR__.'/CalendarSettings/'.ucfirst($calendar).'.php';
99 99
 
100
-        return $this->calendar_file[ 'convert_to' ]( $this->date_time );
100
+        return $this->calendar_file['convert_to']($this->date_time);
101 101
 
102 102
     }
103 103
 
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 
123 123
           $days_of_year = 0;
124 124
 
125
-        foreach ($this->config[ 'month_days_number' ] as $month => $value) {
125
+        foreach ($this->config['month_days_number'] as $month => $value) {
126 126
             if ($this->month > $month) {
127 127
                 $days_of_year += $value;
128 128
             }
@@ -130,25 +130,25 @@  discard block
 block discarded – undo
130 130
 
131 131
           $days_of_year += $this->day;
132 132
 
133
-          $days_of_leap_years =  intval(( ( $this->year - 1 ) / 4 ));
133
+          $days_of_leap_years = intval((($this->year - 1) / 4));
134 134
 
135
-          $days_of_jalali_years = ( ( ( $this->year - 1 ) * 365 ) + $days_of_year + $days_of_leap_years );
135
+          $days_of_jalali_years = ((($this->year - 1) * 365) + $days_of_year + $days_of_leap_years);
136 136
 
137 137
           $days_of_gregorain_years = $days_of_jalali_years + 226899;
138 138
 
139 139
         if ($this->month < 10) {
140
-            $days_of_gregorain_years = $days_of_gregorain_years - intval(( ( $this->year + 621 ) / 4 ));
141
-        } elseif (( ( 10 == $this->month ) && ( $this->day > 10 ) ) || ( $this->month > 10 )) {
142
-            $days_of_gregorain_years = $days_of_gregorain_years - intval(( ( $this->year + 622 ) / 4 ));
140
+            $days_of_gregorain_years = $days_of_gregorain_years - intval((($this->year + 621) / 4));
141
+        } elseif (((10 == $this->month) && ($this->day > 10)) || ($this->month > 10)) {
142
+            $days_of_gregorain_years = $days_of_gregorain_years - intval((($this->year + 622) / 4));
143 143
         }
144 144
 
145
-            $gregorian_month = ( $days_of_gregorain_years % 365 );
145
+            $gregorian_month = ($days_of_gregorain_years % 365);
146 146
 
147 147
             $gregorian_year = intval($days_of_gregorain_years / 365) + 1;
148 148
 
149 149
             $this->config = include __DIR__.'/Gregorian.php';
150 150
 
151
-        foreach ($this->config[ 'month_days_number' ] as $month => $value) {
151
+        foreach ($this->config['month_days_number'] as $month => $value) {
152 152
             if ($gregorian_month < $value) {
153 153
                 break;
154 154
             }
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 
185 185
         $this->day = $this->date_time->format('d');
186 186
 
187
-        $this->temp_day = 0 ;
187
+        $this->temp_day = 0;
188 188
 
189 189
         $this->config = include __DIR__.'/Jalali.php';
190 190
 
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
             $this->temp_day++;
201 201
         }
202 202
 
203
-        $_year = ( ( ( ( ( $this->year - 1 ) * 365.2422 ) + $this->temp_day ) - 119) / 354.3670 ) + 1;
203
+        $_year = ((((($this->year - 1) * 365.2422) + $this->temp_day) - 119) / 354.3670) + 1;
204 204
 
205 205
         $_year = explode('.', $_year);
206 206
 
@@ -216,9 +216,9 @@  discard block
 block discarded – undo
216 216
 
217 217
          $var_temp .= '1';
218 218
 
219
-        $_month = $_month * $var_temp ;
219
+        $_month = $_month * $var_temp;
220 220
 
221
-        $_month = ( $_month * 12 ) + 1;
221
+        $_month = ($_month * 12) + 1;
222 222
 
223 223
         $_month = explode('.', $_month);
224 224
 
@@ -229,14 +229,14 @@  discard block
 block discarded – undo
229 229
         $var_temp = '0.0';
230 230
 
231 231
         for ($i = strlen($_day); $i > 2; $i--) {
232
-            $var_temp .= '0' ;
232
+            $var_temp .= '0';
233 233
         }
234 234
 
235 235
         $var_temp .= '1';
236 236
 
237 237
         $_day = $_day * $var_temp;
238 238
 
239
-        $_day = ( $_day * 29.530 );
239
+        $_day = ($_day * 29.530);
240 240
 
241 241
         $_day = explode('.', $_day);
242 242
 
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
 
270 270
           $this->config = include __DIR__.'/Hijri.php';
271 271
 
272
-        foreach ($this->config[ 'month_days_number' ] as $month => $value) {
272
+        foreach ($this->config['month_days_number'] as $month => $value) {
273 273
             if ($this->month > $month) {
274 274
                 $days_of_year += $value;
275 275
             }
@@ -277,21 +277,21 @@  discard block
 block discarded – undo
277 277
 
278 278
           $days_of_year += $this->day;
279 279
 
280
-          $days_of_leap_years =  intval(( ( $this->year - 1 ) / 3 ));
280
+          $days_of_leap_years = intval((($this->year - 1) / 3));
281 281
 
282
-          $days_of_hijri_years = ( ( ( $this->year - 1 ) * 354 ) + $days_of_year + $days_of_leap_years );
282
+          $days_of_hijri_years = ((($this->year - 1) * 354) + $days_of_year + $days_of_leap_years);
283 283
 
284 284
           $days_of_jalali_years = $days_of_hijri_years + 179;
285 285
 
286
-          $days_of_jalali_years = $days_of_jalali_years - intval(( ( $this->year - 43 ) / 4 ));
286
+          $days_of_jalali_years = $days_of_jalali_years - intval((($this->year - 43) / 4));
287 287
 
288
-          $jalali_month = ( $days_of_jalali_years % 365 );
288
+          $jalali_month = ($days_of_jalali_years % 365);
289 289
 
290 290
           $jalali_year = intval($days_of_jalali_years / 365) + 1;
291 291
 
292 292
           $this->config = include __DIR__.'/Jalali.php';
293 293
 
294
-        foreach ($this->config[ 'month_days_number' ] as $month => $value) {
294
+        foreach ($this->config['month_days_number'] as $month => $value) {
295 295
             if ($jalali_month < $value) {
296 296
                 break;
297 297
             }
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
 
331 331
         $this->config = include __DIR__.'/Hijri.php';
332 332
 
333
-        foreach ($this->config[ 'month_days_number' ] as $month => $value) {
333
+        foreach ($this->config['month_days_number'] as $month => $value) {
334 334
             if ($this->month > $month) {
335 335
                 $days_of_year += $value;
336 336
             }
@@ -338,21 +338,21 @@  discard block
 block discarded – undo
338 338
 
339 339
         $days_of_year += $this->day;
340 340
 
341
-        $days_of_leap_years =  intval(( ( $this->year - 1 ) / 3 ));
341
+        $days_of_leap_years = intval((($this->year - 1) / 3));
342 342
 
343
-        $days_of_hijri_years = ( ( ( $this->year - 1 ) * 354 ) + $days_of_year + $days_of_leap_years );
343
+        $days_of_hijri_years = ((($this->year - 1) * 354) + $days_of_year + $days_of_leap_years);
344 344
 
345 345
         $days_of_gregorain_years = $days_of_hijri_years + 227078;
346 346
 
347
-        $days_of_gregorain_years = $days_of_gregorain_years - intval(( ( $this->year + 578 ) / 4 ));
347
+        $days_of_gregorain_years = $days_of_gregorain_years - intval((($this->year + 578) / 4));
348 348
 
349
-        $gregorian_month = ( $days_of_gregorain_years % 365 );
349
+        $gregorian_month = ($days_of_gregorain_years % 365);
350 350
 
351 351
         $gregorian_year = intval($days_of_gregorain_years / 365) + 1;
352 352
 
353 353
         $this->config = include __DIR__.'/Gregorian.php';
354 354
 
355
-        foreach ($this->config[ 'month_days_number' ] as $month => $value) {
355
+        foreach ($this->config['month_days_number'] as $month => $value) {
356 356
             if ($gregorian_month < $value) {
357 357
                 break;
358 358
             }
Please login to merge, or discard this patch.
src/Datium.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
     public function all()
172 172
     {
173 173
 
174
-        return ( object )array(
174
+        return (object) array(
175 175
 
176 176
             'second' => $this->date_time->format('s'),
177 177
 
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
 
392 392
         $difference->year = $difference->y;
393 393
 
394
-        $difference->simple = ( new SimpleDiff( $start, $end, $difference ) );
394
+        $difference->simple = (new SimpleDiff($start, $end, $difference));
395 395
 
396 396
         return $difference;
397 397
 
Please login to merge, or discard this patch.