Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
19 / 19 |
|
100.00% |
8 / 8 |
CRAP | |
100.00% |
1 / 1 |
| common_configuration_Report | |
100.00% |
19 / 19 |
|
100.00% |
8 / 8 |
12 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
4 / 4 |
|
100.00% |
1 / 1 |
2 | |||
| getStatus | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setStatus | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getStatusAsString | |
100.00% |
9 / 9 |
|
100.00% |
1 / 1 |
4 | |||
| getMessage | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setMessage | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getComponent | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setComponent | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 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_Report |
| 29 | * |
| 30 | * @access public |
| 31 | * @author Jerome Bogaerts, <jerome.bogaerts@tudor.lu> |
| 32 | * @package generis |
| 33 | |
| 34 | */ |
| 35 | class common_configuration_Report |
| 36 | { |
| 37 | // --- ASSOCIATIONS --- |
| 38 | // generateAssociationEnd : |
| 39 | |
| 40 | // --- ATTRIBUTES --- |
| 41 | |
| 42 | /** |
| 43 | * Short description of attribute status |
| 44 | * |
| 45 | * @access private |
| 46 | * @var int |
| 47 | */ |
| 48 | private $status = 0; |
| 49 | |
| 50 | /** |
| 51 | * Short description of attribute VALID |
| 52 | * |
| 53 | * @access public |
| 54 | * @var int |
| 55 | */ |
| 56 | public const VALID = 0; |
| 57 | |
| 58 | /** |
| 59 | * Short description of attribute INVALID |
| 60 | * |
| 61 | * @access public |
| 62 | * @var int |
| 63 | */ |
| 64 | public const INVALID = 1; |
| 65 | |
| 66 | /** |
| 67 | * Short description of attribute UNKNOWN |
| 68 | * |
| 69 | * @access public |
| 70 | * @var int |
| 71 | */ |
| 72 | public const UNKNOWN = 2; |
| 73 | |
| 74 | /** |
| 75 | * Short description of attribute message |
| 76 | * |
| 77 | * @access private |
| 78 | * @var string |
| 79 | */ |
| 80 | private $message = ''; |
| 81 | |
| 82 | /** |
| 83 | * Short description of attribute component |
| 84 | * |
| 85 | * @access private |
| 86 | * @var common_configuration_Component |
| 87 | */ |
| 88 | private $component; |
| 89 | |
| 90 | // --- OPERATIONS --- |
| 91 | |
| 92 | /** |
| 93 | * Short description of method __construct |
| 94 | * |
| 95 | * @access public |
| 96 | * @author Jerome Bogaerts, <jerome.bogaerts@tudor.lu> |
| 97 | * @param int $status |
| 98 | * @param string $message |
| 99 | * @param common_configuration_Component $component |
| 100 | * @return mixed |
| 101 | */ |
| 102 | public function __construct($status, $message, common_configuration_Component $component = null) |
| 103 | { |
| 104 | |
| 105 | $this->setStatus($status); |
| 106 | $this->setMessage($message); |
| 107 | |
| 108 | if (!empty($component)) { |
| 109 | $this->setComponent($component); |
| 110 | } |
| 111 | } |
| 112 | |
| 113 | /** |
| 114 | * Short description of method getStatus |
| 115 | * |
| 116 | * @access public |
| 117 | * @author Jerome Bogaerts, <jerome.bogaerts@tudor.lu> |
| 118 | * @return int |
| 119 | */ |
| 120 | public function getStatus() |
| 121 | { |
| 122 | return (int) $this->status; |
| 123 | } |
| 124 | |
| 125 | /** |
| 126 | * Short description of method setStatus |
| 127 | * |
| 128 | * @access public |
| 129 | * @author Jerome Bogaerts, <jerome.bogaerts@tudor.lu> |
| 130 | * @param int $status |
| 131 | * @return void |
| 132 | */ |
| 133 | public function setStatus($status) |
| 134 | { |
| 135 | |
| 136 | $this->status = $status; |
| 137 | } |
| 138 | |
| 139 | /** |
| 140 | * Short description of method getStatusAsString |
| 141 | * |
| 142 | * @access public |
| 143 | * @author Jerome Bogaerts, <jerome.bogaerts@tudor.lu> |
| 144 | * @return string |
| 145 | */ |
| 146 | public function getStatusAsString() |
| 147 | { |
| 148 | $returnValue = (string) ''; |
| 149 | |
| 150 | |
| 151 | switch ($this->getStatus()) { |
| 152 | case self::INVALID: |
| 153 | $returnValue = 'invalid'; |
| 154 | break; |
| 155 | |
| 156 | case self::UNKNOWN: |
| 157 | $returnValue = 'unknown'; |
| 158 | break; |
| 159 | |
| 160 | case self::VALID: |
| 161 | $returnValue = 'valid'; |
| 162 | break; |
| 163 | } |
| 164 | |
| 165 | |
| 166 | return (string) $returnValue; |
| 167 | } |
| 168 | |
| 169 | /** |
| 170 | * Short description of method getMessage |
| 171 | * |
| 172 | * @access public |
| 173 | * @author Jerome Bogaerts, <jerome.bogaerts@tudor.lu> |
| 174 | * @return string |
| 175 | */ |
| 176 | public function getMessage() |
| 177 | { |
| 178 | return (string) $this->message; |
| 179 | } |
| 180 | |
| 181 | /** |
| 182 | * Short description of method setMessage |
| 183 | * |
| 184 | * @access public |
| 185 | * @author Jerome Bogaerts, <jerome.bogaerts@tudor.lu> |
| 186 | * @param string $message |
| 187 | * @return void |
| 188 | */ |
| 189 | public function setMessage($message) |
| 190 | { |
| 191 | |
| 192 | $this->message = $message; |
| 193 | } |
| 194 | |
| 195 | /** |
| 196 | * Short description of method getComponent |
| 197 | * |
| 198 | * @access public |
| 199 | * @author Jerome Bogaerts, <jerome.bogaerts@tudor.lu> |
| 200 | * @return common_configuration_Component |
| 201 | */ |
| 202 | public function getComponent() |
| 203 | { |
| 204 | return $this->component; |
| 205 | } |
| 206 | |
| 207 | /** |
| 208 | * Short description of method setComponent |
| 209 | * |
| 210 | * @access protected |
| 211 | * @author Jerome Bogaerts, <jerome.bogaerts@tudor.lu> |
| 212 | * @param $component common_configuration_Component |
| 213 | * @return void |
| 214 | */ |
| 215 | public function setComponent(common_configuration_Component $component) |
| 216 | { |
| 217 | $this->component = $component; |
| 218 | } |
| 219 | } |