@@ -18,13 +18,13 @@ discard block |
||
18 | 18 | |
19 | 19 | protected $gregorian_DayofWeek; |
20 | 20 | |
21 | - protected $english_number = array( '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' ); |
|
21 | + protected $english_number = array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9'); |
|
22 | 22 | |
23 | - public function __construct( $date_time, $calendar, $format, $gregorian_DayofWeek ){ |
|
23 | + public function __construct($date_time, $calendar, $format, $gregorian_DayofWeek) { |
|
24 | 24 | |
25 | - $this->translate = include( 'lang/fa/general.php' ); |
|
25 | + $this->translate = include('lang/fa/general.php'); |
|
26 | 26 | |
27 | - $this->config = include( 'Config.php' ); |
|
27 | + $this->config = include('Config.php'); |
|
28 | 28 | |
29 | 29 | $this->date_time = $date_time; |
30 | 30 | |
@@ -38,13 +38,13 @@ discard block |
||
38 | 38 | |
39 | 39 | } |
40 | 40 | |
41 | - protected function format( $calendar, $format ) { |
|
41 | + protected function format($calendar, $format) { |
|
42 | 42 | |
43 | - $this->date_time = $this->date_time->format( $format ); |
|
43 | + $this->date_time = $this->date_time->format($format); |
|
44 | 44 | |
45 | - if( in_array( $calendar, $this->config['calendar'] ) ) { |
|
45 | + if (in_array($calendar, $this->config['calendar'])) { |
|
46 | 46 | |
47 | - switch( $calendar ){ |
|
47 | + switch ($calendar) { |
|
48 | 48 | |
49 | 49 | case 'ir': |
50 | 50 | |
@@ -74,25 +74,25 @@ discard block |
||
74 | 74 | |
75 | 75 | protected function translateToPersian() { |
76 | 76 | |
77 | - $this->date_time = str_replace( $this->config['month']['english'], $this->config['month']['persian'], $this->date_time ); |
|
77 | + $this->date_time = str_replace($this->config['month']['english'], $this->config['month']['persian'], $this->date_time); |
|
78 | 78 | |
79 | - $this->date_time = str_replace( $this->config['week_days_name']['english'], $this->config['week_days_name']['persian'][$this->gregorian_DayofWeek], $this->date_time ); |
|
79 | + $this->date_time = str_replace($this->config['week_days_name']['english'], $this->config['week_days_name']['persian'][$this->gregorian_DayofWeek], $this->date_time); |
|
80 | 80 | |
81 | - $this->date_time = str_replace( $this->english_number , $this->translate['number'], $this->date_time ); |
|
81 | + $this->date_time = str_replace($this->english_number, $this->translate['number'], $this->date_time); |
|
82 | 82 | |
83 | - $this->date_time = str_replace( $this->config['month']['persian'], $this->translate['month'], $this->date_time ); |
|
83 | + $this->date_time = str_replace($this->config['month']['persian'], $this->translate['month'], $this->date_time); |
|
84 | 84 | |
85 | - $this->date_time = str_replace( $this->config['week_days_name']['persian'], $this->translate['week_days_name'], $this->date_time ); |
|
85 | + $this->date_time = str_replace($this->config['week_days_name']['persian'], $this->translate['week_days_name'], $this->date_time); |
|
86 | 86 | |
87 | - $this->date_time = str_replace( 'th', 'ام', $this->date_time ); |
|
87 | + $this->date_time = str_replace('th', 'ام', $this->date_time); |
|
88 | 88 | |
89 | - $this->date_time = str_replace( 'AM', 'قبل از ظهر', $this->date_time ); |
|
89 | + $this->date_time = str_replace('AM', 'قبل از ظهر', $this->date_time); |
|
90 | 90 | |
91 | - $this->date_time = str_replace( 'am', 'ق.ظ', $this->date_time ); |
|
91 | + $this->date_time = str_replace('am', 'ق.ظ', $this->date_time); |
|
92 | 92 | |
93 | - $this->date_time = str_replace( 'PM', 'بعد از ظهر', $this->date_time ); |
|
93 | + $this->date_time = str_replace('PM', 'بعد از ظهر', $this->date_time); |
|
94 | 94 | |
95 | - $this->date_time = str_replace( 'pm', 'ب.ظ', $this->date_time ); |
|
95 | + $this->date_time = str_replace('pm', 'ب.ظ', $this->date_time); |
|
96 | 96 | |
97 | 97 | return $this->date_time; |
98 | 98 | |
@@ -100,9 +100,9 @@ discard block |
||
100 | 100 | |
101 | 101 | protected function translateToArabic() { |
102 | 102 | |
103 | - $this->date_time = str_replace( $this->config['month']['english'], $this->config['month']['islamic'], $this->date_time ); |
|
103 | + $this->date_time = str_replace($this->config['month']['english'], $this->config['month']['islamic'], $this->date_time); |
|
104 | 104 | |
105 | - $this->date_time = str_replace( $this->config['week_days_name']['english'], $this->config['week_days_name']['islamic'][$this->gregorian_DayofWeek], $this->date_time ); |
|
105 | + $this->date_time = str_replace($this->config['week_days_name']['english'], $this->config['week_days_name']['islamic'][$this->gregorian_DayofWeek], $this->date_time); |
|
106 | 106 | |
107 | 107 | return $this->date_time; |
108 | 108 | } |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | |
117 | 117 | public function get() |
118 | 118 | { |
119 | - return $this->format( $this->calendar, $this->format ); |
|
119 | + return $this->format($this->calendar, $this->format); |
|
120 | 120 | } |
121 | 121 | |
122 | 122 |