| @@ 142-153 (lines=12) @@ | ||
| 139 | * @throws RestrictionException |
|
| 140 | * @return mixed |
|
| 141 | */ |
|
| 142 | public static function checkMaxExclusive($value, $maxExclusive) |
|
| 143 | { |
|
| 144 | $numeric = static::getNumeric($value); |
|
| 145 | if ($numeric >= $maxExclusive) { |
|
| 146 | throw new RestrictionException( |
|
| 147 | "The restriction max exclusive with '$maxExclusive' is not true", |
|
| 148 | RestrictionException::ERROR_CODE_MAX_EXCLUSIVE, |
|
| 149 | $value, |
|
| 150 | $maxExclusive); |
|
| 151 | } |
|
| 152 | return $numeric; |
|
| 153 | } |
|
| 154 | ||
| 155 | /** |
|
| 156 | * Specifies the upper bounds for numeric values (the value must be less than or equal to this value) |
|
| @@ 163-174 (lines=12) @@ | ||
| 160 | * @throws RestrictionException |
|
| 161 | * @return mixed |
|
| 162 | */ |
|
| 163 | public static function checkMaxInclusive($value, $maxInclusive) |
|
| 164 | { |
|
| 165 | $numeric = static::getNumeric($value); |
|
| 166 | if ($numeric > $maxInclusive) { |
|
| 167 | throw new RestrictionException( |
|
| 168 | "The restriction max inclusive with '$maxInclusive' is not true", |
|
| 169 | RestrictionException::ERROR_CODE_MAX_INCLUSIVE, |
|
| 170 | $value, |
|
| 171 | $maxInclusive); |
|
| 172 | } |
|
| 173 | return $numeric; |
|
| 174 | } |
|
| 175 | ||
| 176 | /** |
|
| 177 | * Retrive the number of characters or list items allowed. |
|
| @@ 275-286 (lines=12) @@ | ||
| 272 | * @throws RestrictionException |
|
| 273 | * @return mixed |
|
| 274 | */ |
|
| 275 | public static function checkMinExclusive($value, $minExclusive) |
|
| 276 | { |
|
| 277 | $numeric = static::getNumeric($value); |
|
| 278 | if ($numeric <= $minExclusive) { |
|
| 279 | throw new RestrictionException( |
|
| 280 | "The restriction min exclusive with '$minExclusive' is not true", |
|
| 281 | RestrictionException::ERROR_CODE_MIN_EXCLUSIVE, |
|
| 282 | $value, |
|
| 283 | $minExclusive); |
|
| 284 | } |
|
| 285 | return $numeric; |
|
| 286 | } |
|
| 287 | ||
| 288 | /** |
|
| 289 | * Specifies the lower bounds for numeric values (the value must be greater than or equal to this value) |
|
| @@ 296-307 (lines=12) @@ | ||
| 293 | * @throws RestrictionException |
|
| 294 | * @return mixed |
|
| 295 | */ |
|
| 296 | public static function checkMinInclusive($value, $minInclusive) |
|
| 297 | { |
|
| 298 | $numeric = static::getNumeric($value); |
|
| 299 | if ($numeric < $minInclusive) { |
|
| 300 | throw new RestrictionException( |
|
| 301 | "The restriction min inclusive with '$minInclusive' is not true", |
|
| 302 | RestrictionException::ERROR_CODE_MIN_INCLUSIVE, |
|
| 303 | $value, |
|
| 304 | $minInclusive); |
|
| 305 | } |
|
| 306 | return $numeric; |
|
| 307 | } |
|
| 308 | ||
| 309 | /** |
|
| 310 | * Specifies how white space (line feeds, tabs, spaces, and carriage returns) is handled |
|