Completed
Push — master ( 969234...eaa02d )
by mehdi
02:56
created
src/Events/Global/global.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
      * @link http://www.un.org/en/sections/observances/international-days/
14 14
      */
15 15
     'events' => array(
16
-      1 => array( 27 => 'International Day of Commemoration in Memory of the Victims of the Holocaust' ),
16
+      1 => array(27 => 'International Day of Commemoration in Memory of the Victims of the Holocaust'),
17 17
       2 => array(
18 18
         4 => 'World Cancer Day',
19 19
         6 => 'International Day of Zero Tolerance to Female Genital Mutilation',
Please login to merge, or discard this patch.
src/Events/Localization/ir.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -12,9 +12,9 @@
 block discarded – undo
12 12
      * as a arraye value
13 13
      */
14 14
     'events' => array(
15
-      1 => array( 1 => 'nowruz', 2 => 'nowruz', 3 => 'nowruz', 5 => 'nowruz' ),
16
-      10 => array( 22 => 'Iran revelution day' ),
17
-      12 => array( 29 => 'Iran oil national day' )
15
+      1 => array(1 => 'nowruz', 2 => 'nowruz', 3 => 'nowruz', 5 => 'nowruz'),
16
+      10 => array(22 => 'Iran revelution day'),
17
+      12 => array(29 => 'Iran oil national day')
18 18
     ),
19 19
 
20 20
 );
Please login to merge, or discard this patch.
src/Events/Localization/us.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -9,9 +9,9 @@
 block discarded – undo
9 9
 
10 10
   'events' => array(
11 11
 
12
-    4  => array( 22 => 'Earth day' ),
12
+    4  => array(22 => 'Earth day'),
13 13
 
14
-    12 => array( 25 => 'Christmas' )
14
+    12 => array(25 => 'Christmas')
15 15
 
16 16
   )
17 17
 
Please login to merge, or discard this patch.
src/lang/fa/general.php 2 patches
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@  discard block
 block discarded – undo
2 2
 
3 3
   return array(
4 4
 
5
-       'events' => array( 'nowruz' => 'عید نوروز',
5
+        'events' => array( 'nowruz' => 'عید نوروز',
6 6
 
7 7
                           'iran_national_day' => 'روز جمهوری اسلامی',
8 8
 
@@ -12,16 +12,16 @@  discard block
 block discarded – undo
12 12
         'month' => array(
13 13
                           'فروردین',
14 14
                           'اردیبهشت',
15
-                           'خرداد',
16
-                           'تیر',
17
-                           'مرداد',
18
-                           'شهریور',
19
-                           'مهر',
20
-                           'آبان',
21
-                           'آذر',
22
-                           'دی',
23
-                           'بهمن',
24
-                           'اسفند',
15
+                            'خرداد',
16
+                            'تیر',
17
+                            'مرداد',
18
+                            'شهریور',
19
+                            'مهر',
20
+                            'آبان',
21
+                            'آذر',
22
+                            'دی',
23
+                            'بهمن',
24
+                            'اسفند',
25 25
                         ),
26 26
 
27 27
         'week_days_name' => array(
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@  discard block
 block discarded – undo
2 2
 
3 3
   return array(
4 4
 
5
-       'events' => array( 'nowruz' => 'عید نوروز',
5
+       'events' => array('nowruz' => 'عید نوروز',
6 6
 
7 7
                           'iran_national_day' => 'روز جمهوری اسلامی',
8 8
 
@@ -40,9 +40,9 @@  discard block
 block discarded – undo
40 40
 
41 41
         'pm_time' => 'ب.ظ',
42 42
 
43
-        'end_of_days' => array( "" ),
43
+        'end_of_days' => array(""),
44 44
 
45
-        'numbers' => array( '۰', '۱', '۲', '۳', '۴', '۵', '۶', '۷', '۸', '۹' ),
45
+        'numbers' => array('۰', '۱', '۲', '۳', '۴', '۵', '۶', '۷', '۸', '۹'),
46 46
         '0' => '۰',
47 47
         '1' => '۱',
48 48
         '2' => '۲',
Please login to merge, or discard this patch.
src/Config.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -125,4 +125,4 @@
 block discarded – undo
125 125
    */
126 126
   'weekend' => array( 'friday' )
127 127
 
128
- );
128
+  );
Please login to merge, or discard this 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', 'H', 'm', 'S' ),
38
+  'date_interval' => array('D', 'M', 'Y', 'H', 'm', 'S'),
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/ar/general.php 2 patches
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -2,23 +2,23 @@
 block discarded – undo
2 2
 
3 3
   return array(
4 4
 
5
-       'events' => array( 'eid fitr' => 'عيد الفطر',
5
+        'events' => array( 'eid fitr' => 'عيد الفطر',
6 6
 
7 7
                         ),
8 8
 
9 9
         'month' => array(
10 10
                           'مُحَرَّم',
11 11
                           'صَفَر',
12
-                           'رَبيع الأوّل',
13
-                           'رَبيع الآخر',
14
-                           'جُمادى الأولى',
15
-                           'جُمادى الآخرة',
16
-                           'رَجَب',
17
-                           'شَعْبان',
18
-                           'رَمَضان',
19
-                           'شَوّال',
20
-                           'ذو القِعْدة',
21
-                           'ذو الحِجّة'
12
+                            'رَبيع الأوّل',
13
+                            'رَبيع الآخر',
14
+                            'جُمادى الأولى',
15
+                            'جُمادى الآخرة',
16
+                            'رَجَب',
17
+                            'شَعْبان',
18
+                            'رَمَضان',
19
+                            'شَوّال',
20
+                            'ذو القِعْدة',
21
+                            'ذو الحِجّة'
22 22
                         ),
23 23
 
24 24
         'days_of_week' => array(
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@  discard block
 block discarded – undo
2 2
 
3 3
   return array(
4 4
 
5
-       'events' => array( 'eid fitr' => 'عيد الفطر',
5
+       'events' => array('eid fitr' => 'عيد الفطر',
6 6
 
7 7
                         ),
8 8
 
@@ -37,9 +37,9 @@  discard block
 block discarded – undo
37 37
 
38 38
         'pm_time' => '',
39 39
 
40
-        'end_of_days' => array( "" ),
40
+        'end_of_days' => array(""),
41 41
 
42
-        'numbers' => array( '۰', '۱', '۲', '۳', '٤‎', '٥‎', '٦‎', '۷', '۸', '۹'),
42
+        'numbers' => array('۰', '۱', '۲', '۳', '٤‎', '٥‎', '٦‎', '۷', '۸', '۹'),
43 43
 
44 44
   );
45 45
 
Please login to merge, or discard this patch.
test.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 use OpenCafe\Datium as Datium;
3 3
 use OpenCafe\Tools\Convert as Covnert;
4
-try{
4
+try {
5 5
     include_once 'vendor/autoload.php';
6 6
     var_dump("-----------------------[ Test Start ]-------------------------<br/>");
7 7
     // echo '<br>this year:<br>';
@@ -39,6 +39,6 @@  discard block
 block discarded – undo
39 39
     // echo 'Persian calendar:';
40 40
     // var_dump( Datium::now()->lang('fa')->get( 'l jS F Y h:i:s A' ) );
41 41
     var_dump("-----------------------[ Test End ]-------------------------<br/>");
42
-} catch (Exception $e ) {
42
+} catch (Exception $e) {
43 43
     var_dump($e);
44 44
 }
Please login to merge, or discard this patch.
src/Leap.php 2 patches
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.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
    * @param $year integer
27 27
    * @since Aug, 21 2015
28 28
    */
29
-    public function __construct( $year, $type = 'gregorian' ) 
29
+    public function __construct($year, $type = 'gregorian') 
30 30
     {
31 31
 
32 32
          $this->year = $year;
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
     public function gregorinLeapYear() 
47 47
     {
48 48
 
49
-        return ( ( ( $this->year % 4 ) == 0 ) && ( ( ( $this->year % 100 ) != 0 ) || ( ( $this->year % 400 ) == 0 ) ) );
49
+        return ((($this->year % 4) == 0) && ((($this->year % 100) != 0) || (($this->year % 400) == 0)));
50 50
 
51 51
     }
52 52
 
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 
62 62
         $jalali_years = 0;
63 63
 
64
-        while ( $jalali_years < ( $this->year - 128 ) ) {
64
+        while ($jalali_years < ($this->year - 128)) {
65 65
 
66 66
             $jalali_years += 128;
67 67
 
@@ -72,13 +72,13 @@  discard block
 block discarded – undo
72 72
 
73 73
         $this->result -= $jalali_years;
74 74
 
75
-        if ($this->result >= 33 ) {
75
+        if ($this->result >= 33) {
76 76
 
77 77
             $this->result = $this->result % 33;
78 78
 
79 79
         }
80 80
 
81
-        if (( $this->result == 28 ) || ( $this->result == 27 ) ) {
81
+        if (($this->result == 28) || ($this->result == 27)) {
82 82
 
83 83
             return $this->result;
84 84
 
@@ -89,13 +89,13 @@  discard block
 block discarded – undo
89 89
 
90 90
         $this->result -= $jalali_years;
91 91
 
92
-        if ($this->result >= 33 ) {
92
+        if ($this->result >= 33) {
93 93
 
94 94
             $this->result = $this->result % 33;
95 95
 
96 96
         }
97 97
 
98
-        if (( ( $this->result % 4 ) == 0 ) && ( $this->result != 28 ) ) {
98
+        if ((($this->result % 4) == 0) && ($this->result != 28)) {
99 99
 
100 100
             return $this->result;
101 101
 
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 
114 114
         $this->result = $this->year % 30;
115 115
 
116
-        if (( 2 == $this->result ) || ( 5 == $this->result ) || ( 7 == $this->result ) || ( 10 == $this->result ) || ( 13 == $this->result ) || ( 16 == $this->result ) || ( 18 == $this->result ) || ( 21 == $this->result ) || ( 24 == $this->year ) || ( 26 == $this->result ) || ( 29 == $this->result ) ) {
116
+        if ((2 == $this->result) || (5 == $this->result) || (7 == $this->result) || (10 == $this->result) || (13 == $this->result) || (16 == $this->result) || (18 == $this->result) || (21 == $this->result) || (24 == $this->year) || (26 == $this->result) || (29 == $this->result)) {
117 117
 
118 118
             return $this->result;
119 119
 
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
     public function get() 
131 131
     {
132 132
 
133
-        switch ( $this->type ) {
133
+        switch ($this->type) {
134 134
 
135 135
         case 'gregorian':
136 136
 
Please login to merge, or discard this patch.
src/DayOf.php 2 patches
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.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 
21 21
     protected $geregorian_DayofWeek;
22 22
 
23
-    public function __construct( $date_time, $calendar_type = 'gregorian' ) 
23
+    public function __construct($date_time, $calendar_type = 'gregorian') 
24 24
     {
25 25
 
26 26
         $this->config = include 'Config.php';
@@ -42,9 +42,9 @@  discard block
 block discarded – undo
42 42
     public function year() 
43 43
     {
44 44
 
45
-        $this->config = include 'CalendarSettings/' . ucfirst($this->calendar_type) . '.php';
45
+        $this->config = include 'CalendarSettings/'.ucfirst($this->calendar_type).'.php';
46 46
 
47
-        return $this->config[ 'day_of_year' ]( $this->date_time );
47
+        return $this->config['day_of_year']($this->date_time);
48 48
 
49 49
     }
50 50
 
@@ -58,9 +58,9 @@  discard block
 block discarded – undo
58 58
     public function week() 
59 59
     {
60 60
 
61
-        $this->config = include 'CalendarSettings/' . ucfirst($this->calendar_type) . '.php';
61
+        $this->config = include 'CalendarSettings/'.ucfirst($this->calendar_type).'.php';
62 62
 
63
-        return $this->config[ 'day_of_week' ]( $this->date_time );
63
+        return $this->config['day_of_week']($this->date_time);
64 64
 
65 65
     }
66 66
 
Please login to merge, or discard this patch.