1
|
|
|
<?php |
2
|
|
|
/* |
3
|
|
|
* You may not change or alter any portion of this comment or credits |
4
|
|
|
* of supporting developers from this source code or any supporting source code |
5
|
|
|
* which is considered copyrighted (c) material of the original comment or credit authors. |
6
|
|
|
* |
7
|
|
|
* This program is distributed in the hope that it will be useful, |
8
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
9
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
10
|
|
|
*/ |
11
|
|
|
|
12
|
|
|
/** |
13
|
|
|
* @copyright {@link http://xoops.org/ XOOPS Project} |
14
|
|
|
* @license {@link http://www.fsf.org/copyleft/gpl.html GNU public license} |
15
|
|
|
* @package |
16
|
|
|
* @since |
17
|
|
|
* @author XOOPS Development Team, |
18
|
|
|
* @author GIJ=CHECKMATE (PEAK Corp. http://www.peak.ne.jp/) |
19
|
|
|
*/ |
20
|
|
|
|
21
|
|
|
$this->holidays = array( |
22
|
|
|
'2005-3-7' => 'Labour Day', |
23
|
|
|
'2005-3-25' => 'Good Friday', |
24
|
|
|
'2005-3-28' => 'Easter Monday', |
25
|
|
|
'2005-6-6' => 'Foundation Day', |
26
|
|
|
'2005-9-26' => 'Queens Birthday', |
27
|
|
|
'2005-12-26' => 'Christmas Day PH', |
28
|
|
|
'2005-12-27' => 'Boxing Day PH', |
29
|
|
|
'2006-1-2' => 'New Years PH', |
30
|
|
|
'2006-3-6' => 'Labour Day', |
31
|
|
|
'2006-4-14' => 'Good Friday', |
32
|
|
|
'2006-4-17' => 'Easter Monday', |
33
|
|
|
'2006-6-5' => 'Foundation Day', |
34
|
|
|
'2006-10-2' => 'Queens Birthday', |
35
|
|
|
'2007-3-5' => 'Labour Day', |
36
|
|
|
'2007-4-6' => 'Good Friday', |
37
|
|
|
'2007-4-9' => 'Easter Monday', |
38
|
|
|
'2007-6-4' => 'Foundation Day', |
39
|
|
|
'2007-10-1' => 'Queens Birthday' |
40
|
|
|
); |
41
|
|
|
|
42
|
|
View Code Duplication |
for ($y = 2001; $y < 2020; ++$y) { |
|
|
|
|
43
|
|
|
$this->holidays["$y-1-1"] = 'New Years Day'; |
44
|
|
|
$this->holidays["$y-1-26"] = 'Australia Day'; |
45
|
|
|
$this->holidays["$y-4-25"] = 'Anzac Day'; |
46
|
|
|
$this->holidays["$y-12-25"] = 'Christmas Day'; |
47
|
|
|
$this->holidays["$y-12-26"] = 'Boxing Day'; |
48
|
|
|
} |
49
|
|
|
|
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.