| @@ 256-273 (lines=18) @@ | ||
| 253 | * |
|
| 254 | * @throws InvalidValueException |
|
| 255 | */ |
|
| 256 | public function parseValue($value) |
|
| 257 | { |
|
| 258 | $nullable = ($this->flags & self::NULLABLE); |
|
| 259 | ||
| 260 | if ($this->flags & self::BOOLEAN) { |
|
| 261 | return StringUtil::parseBoolean($value, $nullable); |
|
| 262 | } |
|
| 263 | ||
| 264 | if ($this->flags & self::INTEGER) { |
|
| 265 | return StringUtil::parseInteger($value, $nullable); |
|
| 266 | } |
|
| 267 | ||
| 268 | if ($this->flags & self::FLOAT) { |
|
| 269 | return StringUtil::parseFloat($value, $nullable); |
|
| 270 | } |
|
| 271 | ||
| 272 | return StringUtil::parseString($value, $nullable); |
|
| 273 | } |
|
| 274 | ||
| 275 | /** |
|
| 276 | * Returns the description text. |
|
| @@ 178-195 (lines=18) @@ | ||
| 175 | * |
|
| 176 | * @throws InvalidValueException |
|
| 177 | */ |
|
| 178 | public function parseValue($value) |
|
| 179 | { |
|
| 180 | $nullable = ($this->flags & self::NULLABLE); |
|
| 181 | ||
| 182 | if ($this->flags & self::BOOLEAN) { |
|
| 183 | return StringUtil::parseBoolean($value, $nullable); |
|
| 184 | } |
|
| 185 | ||
| 186 | if ($this->flags & self::INTEGER) { |
|
| 187 | return StringUtil::parseInteger($value, $nullable); |
|
| 188 | } |
|
| 189 | ||
| 190 | if ($this->flags & self::FLOAT) { |
|
| 191 | return StringUtil::parseFloat($value, $nullable); |
|
| 192 | } |
|
| 193 | ||
| 194 | return StringUtil::parseString($value, $nullable); |
|
| 195 | } |
|
| 196 | ||
| 197 | /** |
|
| 198 | * Returns whether the option requires a value. |
|