@@ -2,7 +2,7 @@ discard block |
||
| 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 |
||
| 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 | |
@@ -2,7 +2,7 @@ discard block |
||
| 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 |
||
| 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' => '۲', |
@@ -1,7 +1,5 @@ |
||
| 1 | 1 | ``<?php |
| 2 | 2 | |
| 3 | - use OpenCafe\Datium as Datium; |
|
| 4 | - |
|
| 5 | 3 | return array ( |
| 6 | 4 | |
| 7 | 5 | 'numbers' => array( '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'), |
@@ -4,13 +4,13 @@ discard block |
||
| 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 |
||
| 22 | 22 | * |
| 23 | 23 | *\_________________________________________________________/ |
| 24 | 24 | */ |
| 25 | - 'convert_to' => function ($date_time) { |
|
| 25 | + 'convert_to' => function($date_time) { |
|
| 26 | 26 | |
| 27 | 27 | return null; |
| 28 | 28 | |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | * |
| 37 | 37 | *\_________________________________________________________/ |
| 38 | 38 | */ |
| 39 | - 'convert_from' => function ($date_time) { |
|
| 39 | + 'convert_from' => function($date_time) { |
|
| 40 | 40 | |
| 41 | 41 | return null; |
| 42 | 42 | |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | * |
| 98 | 98 | *\_________________________________________________________/ |
| 99 | 99 | */ |
| 100 | - 'days_of_week' => array ( |
|
| 100 | + 'days_of_week' => array( |
|
| 101 | 101 | |
| 102 | 102 | 'Monday', |
| 103 | 103 | 'Tuesday', |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | ), |
| 110 | 110 | |
| 111 | 111 | |
| 112 | - 'month_days_number' => array( 1 => 31, |
|
| 112 | + 'month_days_number' => array(1 => 31, |
|
| 113 | 113 | 2 => 28, |
| 114 | 114 | 3 => 31, |
| 115 | 115 | 4 => 30, |
@@ -120,10 +120,10 @@ discard block |
||
| 120 | 120 | 9 => 30, |
| 121 | 121 | 10 => 31, |
| 122 | 122 | 11 => 30, |
| 123 | - 12 => 30 ), |
|
| 123 | + 12 => 30), |
|
| 124 | 124 | |
| 125 | 125 | |
| 126 | - 'day_of_year' => function ($date_time) { |
|
| 126 | + 'day_of_year' => function($date_time) { |
|
| 127 | 127 | |
| 128 | 128 | $result = null; |
| 129 | 129 | |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | |
| 148 | 148 | }, |
| 149 | 149 | |
| 150 | - 'day_of_week' => function ($date_time) { |
|
| 150 | + 'day_of_week' => function($date_time) { |
|
| 151 | 151 | |
| 152 | 152 | $config = include 'Gregorian.php'; |
| 153 | 153 | |
@@ -169,9 +169,9 @@ discard block |
||
| 169 | 169 | * |
| 170 | 170 | *\_________________________________________________________/ |
| 171 | 171 | */ |
| 172 | - 'leap_year' => function ($year) { |
|
| 172 | + 'leap_year' => function($year) { |
|
| 173 | 173 | |
| 174 | - return ( ( ( $year % 4 ) == 0 ) && ( ( ( $year % 100 ) != 0 ) || ( ( $year % 400 ) == 0 ) ) ); |
|
| 174 | + return ((($year % 4) == 0) && ((($year % 100) != 0) || (($year % 400) == 0))); |
|
| 175 | 175 | |
| 176 | 176 | }, |
| 177 | 177 | |
@@ -183,6 +183,6 @@ discard block |
||
| 183 | 183 | * |
| 184 | 184 | *\_________________________________________________________/ |
| 185 | 185 | */ |
| 186 | - 'weekend' => array( 'saturday', 'sunday' ), |
|
| 186 | + 'weekend' => array('saturday', 'sunday'), |
|
| 187 | 187 | |
| 188 | 188 | ]; |
@@ -78,9 +78,9 @@ discard block |
||
| 78 | 78 | public function from($calendar) |
| 79 | 79 | { |
| 80 | 80 | |
| 81 | - $this->calendar_file = include 'CalendarSettings/' . ucfirst($calendar) . '.php'; |
|
| 81 | + $this->calendar_file = include '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 |
||
| 95 | 95 | public function to($calendar) |
| 96 | 96 | { |
| 97 | 97 | |
| 98 | - $this->calendar_file = include 'CalendarSettings/' . ucfirst($calendar) . '.php'; |
|
| 98 | + $this->calendar_file = include '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 |
||
| 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 |
||
| 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 '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 |
||
| 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 'Jalali.php'; |
| 190 | 190 | |
@@ -200,7 +200,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 269 | 269 | |
| 270 | 270 | $this->config = include '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 |
||
| 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 '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 |
||
| 330 | 330 | |
| 331 | 331 | $this->config = include '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 |
||
| 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 '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 | } |
@@ -42,9 +42,9 @@ discard block |
||
| 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 |
||
| 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 | } |
@@ -47,7 +47,7 @@ |
||
| 47 | 47 | public function get() |
| 48 | 48 | { |
| 49 | 49 | |
| 50 | - $this->result = include 'CalendarSettings/' . ucfirst($this->type) . '.php'; |
|
| 50 | + $this->result = include 'CalendarSettings/'.ucfirst($this->type).'.php'; |
|
| 51 | 51 | |
| 52 | 52 | return $this->result['leap_year']($this->year); |
| 53 | 53 | |
@@ -4,7 +4,6 @@ |
||
| 4 | 4 | |
| 5 | 5 | use OpenCafe\Tools\Lang; |
| 6 | 6 | use OpenCafe\Datium; |
| 7 | -use stdClass; |
|
| 8 | 7 | |
| 9 | 8 | /** |
| 10 | 9 | * Calculate Time ago with current date difference |
@@ -25,14 +25,14 @@ discard block |
||
| 25 | 25 | * @param DateTime $time_difference The time to calculate with now |
| 26 | 26 | * @param string $lang Language |
| 27 | 27 | */ |
| 28 | - public function __construct($time_difference, $lang ) |
|
| 28 | + public function __construct($time_difference, $lang) |
|
| 29 | 29 | { |
| 30 | 30 | |
| 31 | 31 | $this->language = $lang; |
| 32 | 32 | |
| 33 | - $now = Datium::now()->object(); |
|
| 33 | + $now = Datium::now()->object(); |
|
| 34 | 34 | |
| 35 | - $this->output = Datium::diff( $now, $time_difference ); |
|
| 35 | + $this->output = Datium::diff($now, $time_difference); |
|
| 36 | 36 | |
| 37 | 37 | $this->year = $this->output->year; |
| 38 | 38 | |
@@ -66,18 +66,18 @@ discard block |
||
| 66 | 66 | * @param integer $date date index in ago config file |
| 67 | 67 | * @param string $type duration type on ago config file |
| 68 | 68 | */ |
| 69 | - public function read( $value, $type ) |
|
| 69 | + public function read($value, $type) |
|
| 70 | 70 | { |
| 71 | 71 | |
| 72 | 72 | $config = include 'config/ago.php'; |
| 73 | 73 | |
| 74 | - if( array_key_exists( $value, $config[ $type ] ) ) { |
|
| 74 | + if (array_key_exists($value, $config[$type])) { |
|
| 75 | 75 | |
| 76 | - return Lang::get( $this->language, $config[ $type ][ $value ] ); |
|
| 76 | + return Lang::get($this->language, $config[$type][$value]); |
|
| 77 | 77 | |
| 78 | 78 | } else { |
| 79 | 79 | |
| 80 | - return $value . " " . Lang::get( $this->language, $config[ $type ][ '*' ] ); |
|
| 80 | + return $value." ".Lang::get($this->language, $config[$type]['*']); |
|
| 81 | 81 | |
| 82 | 82 | } |
| 83 | 83 | |
@@ -89,12 +89,12 @@ discard block |
||
| 89 | 89 | * @param integer $date date index in ago config file |
| 90 | 90 | * @param string $type duration type on ago config file |
| 91 | 91 | */ |
| 92 | - public function priority( $date, $type ) |
|
| 92 | + public function priority($date, $type) |
|
| 93 | 93 | { |
| 94 | 94 | |
| 95 | - if( $date != 0 ) { |
|
| 95 | + if ($date != 0) { |
|
| 96 | 96 | |
| 97 | - return $this->read( $date, $type ); |
|
| 97 | + return $this->read($date, $type); |
|
| 98 | 98 | |
| 99 | 99 | } else { |
| 100 | 100 | |
@@ -121,11 +121,11 @@ discard block |
||
| 121 | 121 | 'second' => $this->second |
| 122 | 122 | ]; |
| 123 | 123 | |
| 124 | - foreach( $duration as $index => $value ) { |
|
| 124 | + foreach ($duration as $index => $value) { |
|
| 125 | 125 | |
| 126 | - if( $this->priority( $value, $index ) != false ) { |
|
| 126 | + if ($this->priority($value, $index) != false) { |
|
| 127 | 127 | |
| 128 | - return $this->priority( $value, $index ); |
|
| 128 | + return $this->priority($value, $index); |
|
| 129 | 129 | |
| 130 | 130 | } |
| 131 | 131 | |
@@ -20,9 +20,9 @@ |
||
| 20 | 20 | 'default_calendar' => 'gregorian', |
| 21 | 21 | |
| 22 | 22 | |
| 23 | - 'date_interval' => [ 'D', 'M', 'Y', 'HT', 'MT', 'ST' ], |
|
| 23 | + 'date_interval' => ['D', 'M', 'Y', 'HT', 'MT', 'ST'], |
|
| 24 | 24 | |
| 25 | 25 | |
| 26 | - 'date_simple' => [ 'day', ' month', ' year', ' hour', ' minute', ' second' ], |
|
| 26 | + 'date_simple' => ['day', ' month', ' year', ' hour', ' minute', ' second'], |
|
| 27 | 27 | |
| 28 | 28 | ]; |
@@ -111,9 +111,9 @@ discard block |
||
| 111 | 111 | |
| 112 | 112 | $this->config = include 'Config.php'; |
| 113 | 113 | |
| 114 | - $this->calendar_type = $this->config[ 'default_calendar' ]; |
|
| 114 | + $this->calendar_type = $this->config['default_calendar']; |
|
| 115 | 115 | |
| 116 | - date_default_timezone_set($this->config[ 'timezone' ]); |
|
| 116 | + date_default_timezone_set($this->config['timezone']); |
|
| 117 | 117 | |
| 118 | 118 | $this->calendar_type = 'gregorian'; |
| 119 | 119 | |
@@ -129,15 +129,15 @@ discard block |
||
| 129 | 129 | $this->date_time = new DateTime('now'); |
| 130 | 130 | |
| 131 | 131 | $this->date_time->setDate( |
| 132 | - self::$array_date[ 'year' ], |
|
| 133 | - self::$array_date[ 'month' ], |
|
| 134 | - self::$array_date[ 'day' ] |
|
| 132 | + self::$array_date['year'], |
|
| 133 | + self::$array_date['month'], |
|
| 134 | + self::$array_date['day'] |
|
| 135 | 135 | ); |
| 136 | 136 | |
| 137 | 137 | $this->date_time->setTime( |
| 138 | - self::$array_date[ 'hour' ], |
|
| 139 | - self::$array_date[ 'minute' ], |
|
| 140 | - self::$array_date[ 'second' ] |
|
| 138 | + self::$array_date['hour'], |
|
| 139 | + self::$array_date['minute'], |
|
| 140 | + self::$array_date['second'] |
|
| 141 | 141 | ); |
| 142 | 142 | |
| 143 | 143 | $this->gregorian_DayofWeek = $this->date_time->format('w'); |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | public function all() |
| 163 | 163 | { |
| 164 | 164 | |
| 165 | - return ( object ) array( |
|
| 165 | + return (object) array( |
|
| 166 | 166 | |
| 167 | 167 | 'second' => $this->date_time->format('s'), |
| 168 | 168 | |
@@ -353,15 +353,15 @@ discard block |
||
| 353 | 353 | { |
| 354 | 354 | |
| 355 | 355 | $this->date_interval_expression = str_replace( |
| 356 | - $this->config[ 'date_simple' ], |
|
| 357 | - $this->config[ 'date_interval' ], |
|
| 356 | + $this->config['date_simple'], |
|
| 357 | + $this->config['date_interval'], |
|
| 358 | 358 | $value |
| 359 | 359 | ); |
| 360 | 360 | |
| 361 | 361 | $unit = 'P'; |
| 362 | 362 | |
| 363 | 363 | if (strpos($this->date_interval_expression, 'T')) { |
| 364 | - $this->date_interval_expression= str_replace( |
|
| 364 | + $this->date_interval_expression = str_replace( |
|
| 365 | 365 | 'T', |
| 366 | 366 | '', |
| 367 | 367 | $this->date_interval_expression |
@@ -373,7 +373,7 @@ discard block |
||
| 373 | 373 | $this->date_interval_expression = str_replace( |
| 374 | 374 | ' ', |
| 375 | 375 | '', |
| 376 | - $unit . $this->date_interval_expression |
|
| 376 | + $unit.$this->date_interval_expression |
|
| 377 | 377 | ); |
| 378 | 378 | |
| 379 | 379 | $this->date_time->add( |
@@ -395,15 +395,15 @@ discard block |
||
| 395 | 395 | { |
| 396 | 396 | |
| 397 | 397 | $this->date_interval_expression = str_replace( |
| 398 | - $this->config[ 'date_simple' ], |
|
| 399 | - $this->config[ 'date_interval' ], |
|
| 398 | + $this->config['date_simple'], |
|
| 399 | + $this->config['date_interval'], |
|
| 400 | 400 | $value |
| 401 | 401 | ); |
| 402 | 402 | |
| 403 | 403 | $unit = 'P'; |
| 404 | 404 | |
| 405 | 405 | if (strpos($this->date_interval_expression, 'T')) { |
| 406 | - $this->date_interval_expression= str_replace( |
|
| 406 | + $this->date_interval_expression = str_replace( |
|
| 407 | 407 | 'T', |
| 408 | 408 | '', |
| 409 | 409 | $this->date_interval_expression |
@@ -415,7 +415,7 @@ discard block |
||
| 415 | 415 | $this->date_interval_expression = str_replace( |
| 416 | 416 | ' ', |
| 417 | 417 | '', |
| 418 | - $unit . $this->date_interval_expression |
|
| 418 | + $unit.$this->date_interval_expression |
|
| 419 | 419 | ); |
| 420 | 420 | |
| 421 | 421 | $this->date_time->sub( |
@@ -554,52 +554,52 @@ discard block |
||
| 554 | 554 | // $this->translate_to_file = include( 'Lang/' . $this->language . '/general.php' ); |
| 555 | 555 | |
| 556 | 556 | if (is_null($this->fromConfig)) { |
| 557 | - $this->fromConfig = include 'CalendarSettings/' . |
|
| 558 | - ucfirst($this->translate_from) . '.php'; |
|
| 557 | + $this->fromConfig = include 'CalendarSettings/'. |
|
| 558 | + ucfirst($this->translate_from).'.php'; |
|
| 559 | 559 | } |
| 560 | 560 | |
| 561 | 561 | |
| 562 | 562 | if (is_null($this->toConfig)) { |
| 563 | - $this->toConfig = include 'CalendarSettings/' . |
|
| 564 | - ucfirst($this->translate_to) . '.php'; |
|
| 563 | + $this->toConfig = include 'CalendarSettings/'. |
|
| 564 | + ucfirst($this->translate_to).'.php'; |
|
| 565 | 565 | } |
| 566 | 566 | |
| 567 | 567 | $string_date = $this->date_time->format($format); |
| 568 | 568 | |
| 569 | 569 | if ($this->translate_to != 'gregorian') { |
| 570 | 570 | $string_date = str_replace( |
| 571 | - $this->fromConfig[ 'month' ], |
|
| 572 | - $this->toConfig[ 'month' ], |
|
| 571 | + $this->fromConfig['month'], |
|
| 572 | + $this->toConfig['month'], |
|
| 573 | 573 | $string_date |
| 574 | 574 | ); |
| 575 | 575 | |
| 576 | 576 | $string_date = str_replace( |
| 577 | - $this->fromConfig[ 'days_of_week' ], |
|
| 578 | - $this->toConfig[ 'days_of_week' ][ $this->gregorian_DayofWeek ], |
|
| 577 | + $this->fromConfig['days_of_week'], |
|
| 578 | + $this->toConfig['days_of_week'][$this->gregorian_DayofWeek], |
|
| 579 | 579 | $string_date |
| 580 | 580 | ); |
| 581 | 581 | |
| 582 | 582 | $string_date = str_replace( |
| 583 | - $this->fromConfig[ 'numbers' ], |
|
| 584 | - $this->toConfig[ 'numbers' ], |
|
| 583 | + $this->fromConfig['numbers'], |
|
| 584 | + $this->toConfig['numbers'], |
|
| 585 | 585 | $string_date |
| 586 | 586 | ); |
| 587 | 587 | |
| 588 | 588 | $string_date = str_replace( |
| 589 | - $this->fromConfig[ 'am_time' ], |
|
| 590 | - $this->toConfig[ 'am_time' ], |
|
| 589 | + $this->fromConfig['am_time'], |
|
| 590 | + $this->toConfig['am_time'], |
|
| 591 | 591 | $string_date |
| 592 | 592 | ); |
| 593 | 593 | |
| 594 | 594 | $string_date = str_replace( |
| 595 | - $this->fromConfig[ 'pm_time' ], |
|
| 596 | - $this->toConfig[ 'pm_time' ], |
|
| 595 | + $this->fromConfig['pm_time'], |
|
| 596 | + $this->toConfig['pm_time'], |
|
| 597 | 597 | $string_date |
| 598 | 598 | ); |
| 599 | 599 | |
| 600 | 600 | $string_date = str_replace( |
| 601 | - $this->fromConfig[ 'end_of_days' ], |
|
| 602 | - $this->toConfig[ 'end_of_days' ], |
|
| 601 | + $this->fromConfig['end_of_days'], |
|
| 602 | + $this->toConfig['end_of_days'], |
|
| 603 | 603 | $string_date |
| 604 | 604 | ); |
| 605 | 605 | } |