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 zANavAShi |
19
|
|
|
*/ |
20
|
|
|
|
21
|
|
|
$this->holidays = array( |
22
|
|
|
'2001-1-2' => 'Public Holiday', |
23
|
|
|
'2001-4-13' => 'Good Friday', |
24
|
|
|
'2001-4-16' => 'Easter Monday', |
25
|
|
|
'2001-6-4' => 'Queens Birthday', |
26
|
|
|
'2001-10-22' => 'Labour Day', |
27
|
|
|
'2002-3-29' => 'Good Friday', |
28
|
|
|
'2002-4-1' => 'Easter Monday', |
29
|
|
|
'2002-6-3' => 'Queens Birthday', |
30
|
|
|
'2002-10-28' => 'Labour Day', |
31
|
|
|
'2003-1-2' => 'Public Holiday', |
32
|
|
|
'2003-4-18' => 'Good Friday', |
33
|
|
|
'2003-4-21' => 'Easter Monday', |
34
|
|
|
'2003-6-2' => 'Queens Birthday', |
35
|
|
|
'2003-10-27' => 'Labour Day', |
36
|
|
|
'2004-1-2' => 'Public Holiday', |
37
|
|
|
'2004-4-9' => 'Good Friday', |
38
|
|
|
'2004-4-12' => 'Easter Monday', |
39
|
|
|
'2004-6-7' => 'Queens Birthday', |
40
|
|
|
'2004-10-25' => 'Labour Day', |
41
|
|
|
'2004-12-27' => 'Public Holiday', |
42
|
|
|
'2004-12-28' => 'Public Holiday', |
43
|
|
|
'2005-1-3' => 'Public Holiday', |
44
|
|
|
'2005-1-4' => 'Public Holiday', |
45
|
|
|
'2005-3-25' => 'Good Friday', |
46
|
|
|
'2005-3-28' => 'Easter Monday', |
47
|
|
|
'2005-6-6' => 'Queens Birthday', |
48
|
|
|
'2005-10-24' => 'Labour Day', |
49
|
|
|
'2005-12-27' => 'Public Holiday', |
50
|
|
|
'2006-1-2' => 'Public Holiday', |
51
|
|
|
'2006-1-3' => 'Public Holiday', |
52
|
|
|
'2006-4-14' => 'Good Friday', |
53
|
|
|
'2006-4-17' => 'Easter Monday', |
54
|
|
|
'2006-6-5' => 'Queens Birthday', |
55
|
|
|
'2006-10-23' => 'Labour Day', |
56
|
|
|
'2007-1-2' => 'Public Holiday', |
57
|
|
|
'2007-4-6' => 'Good Friday', |
58
|
|
|
'2007-4-9' => 'Easter Monday', |
59
|
|
|
'2007-6-4' => 'Queens Birthday', |
60
|
|
|
'2007-10-22' => 'Labour Day', |
61
|
|
|
'2008-1-2' => 'Public Holiday', |
62
|
|
|
'2008-3-21' => 'Good Friday', |
63
|
|
|
'2008-3-24' => 'Easter Monday', |
64
|
|
|
'2008-6-2' => 'Queens Birthday', |
65
|
|
|
'2008-10-27' => 'Labour Day', |
66
|
|
|
'2009-1-2' => 'Public Holiday', |
67
|
|
|
'2009-4-10' => 'Good Friday', |
68
|
|
|
'2009-4-13' => 'Easter Monday', |
69
|
|
|
'2009-6-1' => 'Queens Birthday', |
70
|
|
|
'2009-10-26' => 'Labour Day', |
71
|
|
|
'2009-12-28' => 'Public Holiday', |
72
|
|
|
'2010-1-4' => 'Public Holiday', |
73
|
|
|
'2010-4-2' => 'Good Friday', |
74
|
|
|
'2010-4-5' => 'Easter Monday', |
75
|
|
|
'2010-6-7' => 'Queens Birthday', |
76
|
|
|
'2010-10-25' => 'Labour Day', |
77
|
|
|
'2010-12-27' => 'Public Holiday', |
78
|
|
|
'2010-12-28' => 'Public Holiday' |
79
|
|
|
); |
80
|
|
|
|
81
|
|
View Code Duplication |
for ($y = 2001; $y < 2020; ++$y) { |
|
|
|
|
82
|
|
|
$this->holidays["$y-1-1"] = 'New Years Day'; |
83
|
|
|
$this->holidays["$y-2-6"] = 'Waitangi Day'; |
84
|
|
|
$this->holidays["$y-4-25"] = 'Anzac Day'; |
85
|
|
|
$this->holidays["$y-12-25"] = 'Christmas Day'; |
86
|
|
|
$this->holidays["$y-12-26"] = 'Boxing Day'; |
87
|
|
|
} |
88
|
|
|
|
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.