@@ -64,6 +64,10 @@ |
||
64 | 64 | * |
65 | 65 | *\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ |
66 | 66 | */ |
67 | + |
|
68 | + /** |
|
69 | + * @param \DateTime $date_time |
|
70 | + */ |
|
67 | 71 | public function __construct( $date_time = null ) |
68 | 72 | { |
69 | 73 |
@@ -143,9 +143,7 @@ |
||
143 | 143 | |
144 | 144 | $days_of_gregorain_years = $days_of_gregorain_years - intval(( ( $this->year + 621 ) / 4 )); |
145 | 145 | |
146 | - } |
|
147 | - |
|
148 | - elseif (( ( 10 == $this->month ) && ( $this->day > 10 ) ) || ( $this->month > 10 ) ) { |
|
146 | + } elseif (( ( 10 == $this->month ) && ( $this->day > 10 ) ) || ( $this->month > 10 ) ) { |
|
149 | 147 | |
150 | 148 | $days_of_gregorain_years = $days_of_gregorain_years - intval(( ( $this->year + 622 ) / 4 )); |
151 | 149 |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | * Get current datetime |
184 | 184 | * |
185 | 185 | * @since Aug 17 2015 |
186 | - * @return object |
|
186 | + * @return Datium |
|
187 | 187 | */ |
188 | 188 | public static function now() |
189 | 189 | { |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | * @param integer $minute minute number |
205 | 205 | * @param integer $second second number |
206 | 206 | * |
207 | - * @return object |
|
207 | + * @return Datium |
|
208 | 208 | */ |
209 | 209 | public static function create( $year = 2000, $month = 1, $day = 1, $hour = 0, $minute = 0, $second = 0 ) |
210 | 210 | { |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | * @param object $date_start Start of the DateTime |
244 | 244 | * @param object $date_end End of the DateTime |
245 | 245 | * |
246 | - * @return object |
|
246 | + * @return Datium |
|
247 | 247 | */ |
248 | 248 | public static function between( $date_start, $date_end ) |
249 | 249 | { |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | * |
290 | 290 | * @param object $calendar Assigned calendar to when calendar should start. |
291 | 291 | * |
292 | - * @return object |
|
292 | + * @return Datium |
|
293 | 293 | */ |
294 | 294 | public function to( $calendar ) |
295 | 295 | { |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | * |
331 | 331 | * @param string $value How much date should be added to current date |
332 | 332 | * |
333 | - * @return object |
|
333 | + * @return Datium |
|
334 | 334 | */ |
335 | 335 | public function add( $value ) |
336 | 336 | { |
@@ -360,7 +360,7 @@ discard block |
||
360 | 360 | * |
361 | 361 | * @param string $value How much date should increase from current date |
362 | 362 | * |
363 | - * @return obejct |
|
363 | + * @return Datium |
|
364 | 364 | */ |
365 | 365 | public function sub( $value ) |
366 | 366 | { |
@@ -390,7 +390,7 @@ discard block |
||
390 | 390 | * |
391 | 391 | * @param string $type Name of the calendar to caculate leap year |
392 | 392 | * |
393 | - * @return boolean |
|
393 | + * @return Leap |
|
394 | 394 | */ |
395 | 395 | public function leap( $type = 'gregorian' ) |
396 | 396 | { |
@@ -406,7 +406,7 @@ discard block |
||
406 | 406 | * |
407 | 407 | * @since Aug, 22 2015 |
408 | 408 | * |
409 | - * @return integer |
|
409 | + * @return DayOf |
|
410 | 410 | */ |
411 | 411 | public function dayOf() |
412 | 412 | { |
@@ -453,7 +453,7 @@ discard block |
||
453 | 453 | * |
454 | 454 | * @param string $language language short name fa, en, ar ... |
455 | 455 | * |
456 | - * @return object |
|
456 | + * @return Datium |
|
457 | 457 | */ |
458 | 458 | public function lang( $language = 'fa' ) |
459 | 459 | { |
@@ -58,6 +58,10 @@ |
||
58 | 58 | * |
59 | 59 | *\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ |
60 | 60 | */ |
61 | + |
|
62 | + /** |
|
63 | + * @param string $path |
|
64 | + */ |
|
61 | 65 | private function fetch( $path ) |
62 | 66 | { |
63 | 67 |
@@ -59,9 +59,7 @@ discard block |
||
59 | 59 | if (( $year - 1 ) % 4 == 0 ) { |
60 | 60 | |
61 | 61 | $temp_day = $temp_day + 11; |
62 | - } |
|
63 | - |
|
64 | - else { |
|
62 | + } else { |
|
65 | 63 | |
66 | 64 | $temp_day = $temp_day + 10; |
67 | 65 | } |
@@ -74,9 +72,7 @@ discard block |
||
74 | 72 | |
75 | 73 | $day = 30; |
76 | 74 | |
77 | - } |
|
78 | - |
|
79 | - else { |
|
75 | + } else { |
|
80 | 76 | |
81 | 77 | $month = ( $temp_day / 30 ) + 10; |
82 | 78 | |
@@ -84,9 +80,7 @@ discard block |
||
84 | 80 | |
85 | 81 | } |
86 | 82 | |
87 | - } |
|
88 | - |
|
89 | - else { |
|
83 | + } else { |
|
90 | 84 | |
91 | 85 | $year = $year - 621; |
92 | 86 | |
@@ -99,18 +93,14 @@ discard block |
||
99 | 93 | $month = ( $temp_day / 31 ); |
100 | 94 | |
101 | 95 | $day = 31; |
102 | - } |
|
103 | - |
|
104 | - else { |
|
96 | + } else { |
|
105 | 97 | |
106 | 98 | $month = ( $temp_day / 31 ) + 1; |
107 | 99 | |
108 | 100 | $day = ( $temp_day % 31 ); |
109 | 101 | } |
110 | 102 | |
111 | - } |
|
112 | - |
|
113 | - else { |
|
103 | + } else { |
|
114 | 104 | |
115 | 105 | $temp_day = $temp_day - 186; |
116 | 106 | |
@@ -120,9 +110,7 @@ discard block |
||
120 | 110 | |
121 | 111 | $day = 30; |
122 | 112 | |
123 | - } |
|
124 | - |
|
125 | - else { |
|
113 | + } else { |
|
126 | 114 | |
127 | 115 | $month = ( $temp_day / 30 ) + 7; |
128 | 116 | |
@@ -179,9 +167,7 @@ discard block |
||
179 | 167 | |
180 | 168 | $days_of_gregorain_years = $days_of_gregorain_years - intval(( ( $year + 621 ) / 4 )); |
181 | 169 | |
182 | - } |
|
183 | - |
|
184 | - elseif (( ( 10 == $month ) && ( $day > 10 ) ) || ( $month > 10 ) ) { |
|
170 | + } elseif (( ( 10 == $month ) && ( $day > 10 ) ) || ( $month > 10 ) ) { |
|
185 | 171 | |
186 | 172 | $days_of_gregorain_years = $days_of_gregorain_years - intval(( ( $year + 622 ) / 4 )); |
187 | 173 |