@@ -113,9 +113,9 @@ discard block |
||
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 | |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | |
127 | 127 | $this->date_time = new DateTime(); |
128 | 128 | |
129 | - $this->date_time->setTimestamp( self::$timestamp ); |
|
129 | + $this->date_time->setTimestamp(self::$timestamp); |
|
130 | 130 | |
131 | 131 | break; |
132 | 132 | |
@@ -141,15 +141,15 @@ discard block |
||
141 | 141 | $this->date_time = new DateTime('now'); |
142 | 142 | |
143 | 143 | $this->date_time->setDate( |
144 | - self::$array_date[ 'year' ], |
|
145 | - self::$array_date[ 'month' ], |
|
146 | - self::$array_date[ 'day' ] |
|
144 | + self::$array_date['year'], |
|
145 | + self::$array_date['month'], |
|
146 | + self::$array_date['day'] |
|
147 | 147 | ); |
148 | 148 | |
149 | 149 | $this->date_time->setTime( |
150 | - self::$array_date[ 'hour' ], |
|
151 | - self::$array_date[ 'minute' ], |
|
152 | - self::$array_date[ 'second' ] |
|
150 | + self::$array_date['hour'], |
|
151 | + self::$array_date['minute'], |
|
152 | + self::$array_date['second'] |
|
153 | 153 | ); |
154 | 154 | |
155 | 155 | break; |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | public function all() |
175 | 175 | { |
176 | 176 | |
177 | - return ( object ) array( |
|
177 | + return (object) array( |
|
178 | 178 | |
179 | 179 | 'second' => $this->date_time->format('s'), |
180 | 180 | |
@@ -259,10 +259,10 @@ discard block |
||
259 | 259 | * @param timestamp $timestamp Input timestamp value |
260 | 260 | * @return object |
261 | 261 | */ |
262 | - public static function createTimestamp( $timestamp ) |
|
262 | + public static function createTimestamp($timestamp) |
|
263 | 263 | { |
264 | 264 | |
265 | - if( $timestamp != null && is_int( $timestamp ) ) |
|
265 | + if ($timestamp != null && is_int($timestamp)) |
|
266 | 266 | { |
267 | 267 | |
268 | 268 | self::$call_type = 'create-timestamp'; |
@@ -392,15 +392,15 @@ discard block |
||
392 | 392 | { |
393 | 393 | |
394 | 394 | $this->date_interval_expression = str_replace( |
395 | - $this->config[ 'date_simple' ], |
|
396 | - $this->config[ 'date_interval' ], |
|
395 | + $this->config['date_simple'], |
|
396 | + $this->config['date_interval'], |
|
397 | 397 | $value |
398 | 398 | ); |
399 | 399 | |
400 | 400 | $unit = 'P'; |
401 | 401 | |
402 | 402 | if (strpos($this->date_interval_expression, 'T')) { |
403 | - $this->date_interval_expression= str_replace( |
|
403 | + $this->date_interval_expression = str_replace( |
|
404 | 404 | 'T', |
405 | 405 | '', |
406 | 406 | $this->date_interval_expression |
@@ -412,7 +412,7 @@ discard block |
||
412 | 412 | $this->date_interval_expression = str_replace( |
413 | 413 | ' ', |
414 | 414 | '', |
415 | - $unit . $this->date_interval_expression |
|
415 | + $unit.$this->date_interval_expression |
|
416 | 416 | ); |
417 | 417 | |
418 | 418 | $this->date_time->add( |
@@ -434,15 +434,15 @@ discard block |
||
434 | 434 | { |
435 | 435 | |
436 | 436 | $this->date_interval_expression = str_replace( |
437 | - $this->config[ 'date_simple' ], |
|
438 | - $this->config[ 'date_interval' ], |
|
437 | + $this->config['date_simple'], |
|
438 | + $this->config['date_interval'], |
|
439 | 439 | $value |
440 | 440 | ); |
441 | 441 | |
442 | 442 | $unit = 'P'; |
443 | 443 | |
444 | 444 | if (strpos($this->date_interval_expression, 'T')) { |
445 | - $this->date_interval_expression= str_replace( |
|
445 | + $this->date_interval_expression = str_replace( |
|
446 | 446 | 'T', |
447 | 447 | '', |
448 | 448 | $this->date_interval_expression |
@@ -454,7 +454,7 @@ discard block |
||
454 | 454 | $this->date_interval_expression = str_replace( |
455 | 455 | ' ', |
456 | 456 | '', |
457 | - $unit . $this->date_interval_expression |
|
457 | + $unit.$this->date_interval_expression |
|
458 | 458 | ); |
459 | 459 | |
460 | 460 | $this->date_time->sub( |
@@ -593,52 +593,52 @@ discard block |
||
593 | 593 | // $this->translate_to_file = include( 'Lang/' . $this->language . '/general.php' ); |
594 | 594 | |
595 | 595 | if (is_null($this->fromConfig)) { |
596 | - $this->fromConfig = include 'CalendarSettings/' . |
|
597 | - ucfirst($this->translate_from) . '.php'; |
|
596 | + $this->fromConfig = include 'CalendarSettings/'. |
|
597 | + ucfirst($this->translate_from).'.php'; |
|
598 | 598 | } |
599 | 599 | |
600 | 600 | |
601 | 601 | if (is_null($this->toConfig)) { |
602 | - $this->toConfig = include 'CalendarSettings/' . |
|
603 | - ucfirst($this->translate_to) . '.php'; |
|
602 | + $this->toConfig = include 'CalendarSettings/'. |
|
603 | + ucfirst($this->translate_to).'.php'; |
|
604 | 604 | } |
605 | 605 | |
606 | 606 | $string_date = $this->date_time->format($format); |
607 | 607 | |
608 | 608 | if ($this->translate_to != 'gregorian') { |
609 | 609 | $string_date = str_replace( |
610 | - $this->fromConfig[ 'month' ], |
|
611 | - $this->toConfig[ 'month' ], |
|
610 | + $this->fromConfig['month'], |
|
611 | + $this->toConfig['month'], |
|
612 | 612 | $string_date |
613 | 613 | ); |
614 | 614 | |
615 | 615 | $string_date = str_replace( |
616 | - $this->fromConfig[ 'days_of_week' ], |
|
617 | - $this->toConfig[ 'days_of_week' ][ $this->gregorian_DayofWeek ], |
|
616 | + $this->fromConfig['days_of_week'], |
|
617 | + $this->toConfig['days_of_week'][$this->gregorian_DayofWeek], |
|
618 | 618 | $string_date |
619 | 619 | ); |
620 | 620 | |
621 | 621 | $string_date = str_replace( |
622 | - $this->fromConfig[ 'numbers' ], |
|
623 | - $this->toConfig[ 'numbers' ], |
|
622 | + $this->fromConfig['numbers'], |
|
623 | + $this->toConfig['numbers'], |
|
624 | 624 | $string_date |
625 | 625 | ); |
626 | 626 | |
627 | 627 | $string_date = str_replace( |
628 | - $this->fromConfig[ 'am_time' ], |
|
629 | - $this->toConfig[ 'am_time' ], |
|
628 | + $this->fromConfig['am_time'], |
|
629 | + $this->toConfig['am_time'], |
|
630 | 630 | $string_date |
631 | 631 | ); |
632 | 632 | |
633 | 633 | $string_date = str_replace( |
634 | - $this->fromConfig[ 'pm_time' ], |
|
635 | - $this->toConfig[ 'pm_time' ], |
|
634 | + $this->fromConfig['pm_time'], |
|
635 | + $this->toConfig['pm_time'], |
|
636 | 636 | $string_date |
637 | 637 | ); |
638 | 638 | |
639 | 639 | $string_date = str_replace( |
640 | - $this->fromConfig[ 'end_of_days' ], |
|
641 | - $this->toConfig[ 'end_of_days' ], |
|
640 | + $this->fromConfig['end_of_days'], |
|
641 | + $this->toConfig['end_of_days'], |
|
642 | 642 | $string_date |
643 | 643 | ); |
644 | 644 | } |