Completed
Push — master ( 3848cb...1f8425 )
by mehdi
02:54
created
src/Config.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -35,9 +35,9 @@
 block discarded – undo
35 35
   'default_calendar' => 'gregorian',
36 36
 
37 37
 
38
-  'date_interval' => array( 'D', 'M', 'Y', 'HT', 'MT', 'ST' ),
38
+  'date_interval' => array('D', 'M', 'Y', 'HT', 'MT', 'ST'),
39 39
 
40 40
 
41
-  'date_simple' => array( 'day', ' month', ' year', ' hour', ' minute', ' second' ),
41
+  'date_simple' => array('day', ' month', ' year', ' hour', ' minute', ' second'),
42 42
 
43 43
  );
Please login to merge, or discard this patch.
src/Lang.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -49,12 +49,12 @@  discard block
 block discarded – undo
49 49
         /**
50 50
         * Fetch translated expression to langTable attribute
51 51
         */
52
-        self::$langTable = include 'lang/' . $language . '/general.php';
52
+        self::$langTable = include 'lang/'.$language.'/general.php';
53 53
 
54 54
         foreach (self::$langTable as $key => $translate) {
55
-            if (isset(self::$config[ $key ])) {
56
-                if (self::$config[ $key ]) {
57
-                    self::$config[ $key ] = $translate;
55
+            if (isset(self::$config[$key])) {
56
+                if (self::$config[$key]) {
57
+                    self::$config[$key] = $translate;
58 58
                 }
59 59
             }
60 60
         }
@@ -68,9 +68,9 @@  discard block
 block discarded – undo
68 68
 
69 69
     }
70 70
 
71
-    public static function get( $lang, $value ) {
71
+    public static function get($lang, $value) {
72 72
 
73
-      $file = include( 'lang/' . $lang . '/general.php' );
73
+      $file = include('lang/'.$lang.'/general.php');
74 74
 
75 75
       return $file[$value];
76 76
 
Please login to merge, or discard this patch.
src/Datium.php 1 patch
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -113,9 +113,9 @@  discard block
 block discarded – undo
113 113
 
114 114
         $this->config = include 'Config.php';
115 115
 
116
-        $this->calendar_type = $this->config[ 'default_calendar' ];
116
+        $this->calendar_type = $this->config['default_calendar'];
117 117
 
118
-        date_default_timezone_set($this->config[ 'timezone' ]);
118
+        date_default_timezone_set($this->config['timezone']);
119 119
 
120 120
         $this->calendar_type = 'gregorian';
121 121
 
@@ -131,15 +131,15 @@  discard block
 block discarded – undo
131 131
             $this->date_time = new DateTime('now');
132 132
 
133 133
             $this->date_time->setDate(
134
-                self::$array_date[ 'year' ],
135
-                self::$array_date[ 'month' ],
136
-                self::$array_date[ 'day' ]
134
+                self::$array_date['year'],
135
+                self::$array_date['month'],
136
+                self::$array_date['day']
137 137
             );
138 138
 
139 139
             $this->date_time->setTime(
140
-                self::$array_date[ 'hour' ],
141
-                self::$array_date[ 'minute' ],
142
-                self::$array_date[ 'second' ]
140
+                self::$array_date['hour'],
141
+                self::$array_date['minute'],
142
+                self::$array_date['second']
143 143
             );
144 144
 
145 145
             $this->gregorian_DayofWeek = $this->date_time->format('w');
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
     public function all()
165 165
     {
166 166
 
167
-        return ( object ) array(
167
+        return (object) array(
168 168
 
169 169
         'second' => $this->date_time->format('s'),
170 170
 
@@ -341,16 +341,16 @@  discard block
 block discarded – undo
341 341
     {
342 342
 
343 343
         $this->date_interval_expression = str_replace(
344
-            $this->config[ 'date_simple' ],
345
-            $this->config[ 'date_interval' ],
344
+            $this->config['date_simple'],
345
+            $this->config['date_interval'],
346 346
             $value
347 347
         );
348 348
 
349 349
         $unit = 'P';
350 350
 
351
-        if( strpos($this->date_interval_expression, 'T') ) {
351
+        if (strpos($this->date_interval_expression, 'T')) {
352 352
 
353
-          $this->date_interval_expression= str_replace(
353
+          $this->date_interval_expression = str_replace(
354 354
             'T',
355 355
             '',
356 356
             $this->date_interval_expression
@@ -363,7 +363,7 @@  discard block
 block discarded – undo
363 363
         $this->date_interval_expression = str_replace(
364 364
             ' ',
365 365
             '',
366
-            $unit . $this->date_interval_expression
366
+            $unit.$this->date_interval_expression
367 367
         );
368 368
 
369 369
         $this->date_time->add(
@@ -385,16 +385,16 @@  discard block
 block discarded – undo
385 385
     {
386 386
 
387 387
         $this->date_interval_expression = str_replace(
388
-            $this->config[ 'date_simple' ],
389
-            $this->config[ 'date_interval' ],
388
+            $this->config['date_simple'],
389
+            $this->config['date_interval'],
390 390
             $value
391 391
         );
392 392
 
393 393
         $unit = 'P';
394 394
 
395
-        if( strpos($this->date_interval_expression, 'T') ) {
395
+        if (strpos($this->date_interval_expression, 'T')) {
396 396
 
397
-          $this->date_interval_expression= str_replace(
397
+          $this->date_interval_expression = str_replace(
398 398
             'T',
399 399
             '',
400 400
             $this->date_interval_expression
@@ -407,7 +407,7 @@  discard block
 block discarded – undo
407 407
         $this->date_interval_expression = str_replace(
408 408
             ' ',
409 409
             '',
410
-            $unit . $this->date_interval_expression
410
+            $unit.$this->date_interval_expression
411 411
         );
412 412
 
413 413
         $this->date_time->sub(
@@ -442,7 +442,7 @@  discard block
 block discarded – undo
442 442
     public function ago()
443 443
     {
444 444
 
445
-      $this->ago = new TimeAgo( $this->date_time, $this->language );
445
+      $this->ago = new TimeAgo($this->date_time, $this->language);
446 446
 
447 447
       return $this->ago->get();
448 448
 
@@ -546,52 +546,52 @@  discard block
 block discarded – undo
546 546
         // $this->translate_to_file = include( 'Lang/' . $this->language . '/general.php' );
547 547
 
548 548
         if (is_null($this->fromConfig)) {
549
-            $this->fromConfig = include 'CalendarSettings/' .
550
-                                ucfirst($this->translate_from) . '.php';
549
+            $this->fromConfig = include 'CalendarSettings/'.
550
+                                ucfirst($this->translate_from).'.php';
551 551
         }
552 552
 
553 553
 
554 554
         if (is_null($this->toConfig)) {
555
-            $this->toConfig = include 'CalendarSettings/' .
556
-                                       ucfirst($this->translate_to) . '.php';
555
+            $this->toConfig = include 'CalendarSettings/'.
556
+                                       ucfirst($this->translate_to).'.php';
557 557
         }
558 558
 
559 559
         $string_date = $this->date_time->format($format);
560 560
 
561 561
         if ($this->translate_to != 'gregorian') {
562 562
             $string_date = str_replace(
563
-                $this->fromConfig[ 'month' ],
564
-                $this->toConfig[ 'month' ],
563
+                $this->fromConfig['month'],
564
+                $this->toConfig['month'],
565 565
                 $string_date
566 566
             );
567 567
 
568 568
             $string_date = str_replace(
569
-                $this->fromConfig[ 'days_of_week' ],
570
-                $this->toConfig[ 'days_of_week' ][ $this->gregorian_DayofWeek ],
569
+                $this->fromConfig['days_of_week'],
570
+                $this->toConfig['days_of_week'][$this->gregorian_DayofWeek],
571 571
                 $string_date
572 572
             );
573 573
 
574 574
             $string_date = str_replace(
575
-                $this->fromConfig[ 'numbers' ],
576
-                $this->toConfig[ 'numbers' ],
575
+                $this->fromConfig['numbers'],
576
+                $this->toConfig['numbers'],
577 577
                 $string_date
578 578
             );
579 579
 
580 580
             $string_date = str_replace(
581
-                $this->fromConfig[ 'am_time' ],
582
-                $this->toConfig[ 'am_time' ],
581
+                $this->fromConfig['am_time'],
582
+                $this->toConfig['am_time'],
583 583
                 $string_date
584 584
             );
585 585
 
586 586
             $string_date = str_replace(
587
-                $this->fromConfig[ 'pm_time' ],
588
-                $this->toConfig[ 'pm_time' ],
587
+                $this->fromConfig['pm_time'],
588
+                $this->toConfig['pm_time'],
589 589
                 $string_date
590 590
             );
591 591
 
592 592
             $string_date = str_replace(
593
-                $this->fromConfig[ 'end_of_days' ],
594
-                $this->toConfig[ 'end_of_days' ],
593
+                $this->fromConfig['end_of_days'],
594
+                $this->toConfig['end_of_days'],
595 595
                 $string_date
596 596
             );
597 597
         }
Please login to merge, or discard this patch.