@@ -13,7 +13,7 @@ |
||
| 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', |
@@ -12,9 +12,9 @@ |
||
| 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 | ); |
@@ -9,9 +9,9 @@ |
||
| 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 | |
@@ -35,9 +35,9 @@ |
||
| 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 | ); |
@@ -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,7 @@ discard block |
||
| 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 |
||
| 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 | } |
@@ -26,7 +26,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | |
@@ -20,7 +20,7 @@ discard block |
||
| 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 |
||
| 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 | |