Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
11 / 11 |
|
100.00% |
5 / 5 |
CRAP | |
100.00% |
1 / 1 |
common_configuration_BoundableComponent | |
100.00% |
11 / 11 |
|
100.00% |
5 / 5 |
6 | |
100.00% |
1 / 1 |
__construct | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
1 | |||
setMin | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getMin | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
setMax | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
2 | |||
getMax | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
getValue | n/a |
0 / 0 |
n/a |
0 / 0 |
0 |
1 | <?php |
2 | |
3 | /** |
4 | * This program is free software; you can redistribute it and/or |
5 | * modify it under the terms of the GNU General Public License |
6 | * as published by the Free Software Foundation; under version 2 |
7 | * of the License (non-upgradable). |
8 | * |
9 | * This program is distributed in the hope that it will be useful, |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | * GNU General Public License for more details. |
13 | * |
14 | * You should have received a copy of the GNU General Public License |
15 | * along with this program; if not, write to the Free Software |
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
17 | * |
18 | * Copyright (c) 2002-2008 (original work) Public Research Centre Henri Tudor & University of Luxembourg |
19 | * (under the project TAO & TAO2); |
20 | * 2008-2010 (update and modification) Deutsche Institut für Internationale Pädagogische Forschung |
21 | * (under the project TAO-TRANSFER); |
22 | * 2009-2012 (update and modification) Public Research Centre Henri Tudor |
23 | * (under the project TAO-SUSTAIN & TAO-DEV); |
24 | * |
25 | */ |
26 | |
27 | /** |
28 | * Short description of class common_configuration_BoundableComponent |
29 | * |
30 | * @abstract |
31 | * @access public |
32 | * @author Jerome Bogaerts, <jerome.bogaerts@tudor.lu> |
33 | * @package generis |
34 | |
35 | */ |
36 | abstract class common_configuration_BoundableComponent extends common_configuration_Component |
37 | { |
38 | // --- ASSOCIATIONS --- |
39 | |
40 | |
41 | // --- ATTRIBUTES --- |
42 | |
43 | /** |
44 | * Short description of attribute min |
45 | * |
46 | * @access private |
47 | * @var string |
48 | */ |
49 | private $min = ''; |
50 | |
51 | /** |
52 | * Short description of attribute max |
53 | * |
54 | * @access private |
55 | * @var string |
56 | */ |
57 | private $max = ''; |
58 | |
59 | // --- OPERATIONS --- |
60 | |
61 | /** |
62 | * Short description of method __construct |
63 | * |
64 | * @access public |
65 | * @author Jerome Bogaerts, <jerome.bogaerts@tudor.lu> |
66 | * @param string min |
67 | * @param string max |
68 | * @param string name |
69 | * @param boolean optional |
70 | * @return mixed |
71 | */ |
72 | public function __construct($min, $max, $name = 'unknown', $optional = false) |
73 | { |
74 | |
75 | parent::__construct($name, $optional); |
76 | $this->setMin($min); |
77 | $this->setMax($max); |
78 | } |
79 | |
80 | /** |
81 | * Short description of method setMin |
82 | * |
83 | * @access public |
84 | * @author Jerome Bogaerts, <jerome.bogaerts@tudor.lu> |
85 | * @param string min |
86 | * @return void |
87 | */ |
88 | public function setMin($min) |
89 | { |
90 | |
91 | $this->min = $min; |
92 | } |
93 | |
94 | /** |
95 | * Short description of method getMin |
96 | * |
97 | * @access public |
98 | * @author Jerome Bogaerts, <jerome.bogaerts@tudor.lu> |
99 | * @return string |
100 | */ |
101 | public function getMin() |
102 | { |
103 | $returnValue = (string) ''; |
104 | |
105 | |
106 | return $this->min; |
107 | |
108 | |
109 | return (string) $returnValue; |
110 | } |
111 | |
112 | /** |
113 | * Short description of method setMax |
114 | * |
115 | * @access public |
116 | * @author Jerome Bogaerts, <jerome.bogaerts@tudor.lu> |
117 | * @param string max |
118 | * @return void |
119 | */ |
120 | public function setMax($max) |
121 | { |
122 | |
123 | // Support .x notation. |
124 | if (!empty($max)) { |
125 | $this->max = preg_replace('/x/u', '99999', $max); |
126 | } else { |
127 | $this->max = null; |
128 | } |
129 | } |
130 | |
131 | /** |
132 | * Short description of method getMax |
133 | * |
134 | * @access public |
135 | * @author Jerome Bogaerts, <jerome.bogaerts@tudor.lu> |
136 | * @return string |
137 | */ |
138 | public function getMax() |
139 | { |
140 | $returnValue = (string) ''; |
141 | |
142 | |
143 | return $this->max; |
144 | |
145 | |
146 | return (string) $returnValue; |
147 | } |
148 | |
149 | /** |
150 | * Short description of method getValue |
151 | * |
152 | * @abstract |
153 | * @access public |
154 | * @author Jerome Bogaerts, <jerome.bogaerts@tudor.lu> |
155 | * @return string |
156 | */ |
157 | abstract public function getValue(); |
158 | } |