| Total Complexity | 4 |
| Total Lines | 27 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | class LessThanCheck implements Check |
||
| 16 | { |
||
| 17 | const IDENTIFIER = 'base:basic:number:lessThan'; |
||
| 18 | |||
| 19 | private $maxValue; |
||
| 20 | private $currentValue; |
||
| 21 | private $valueName = ""; |
||
| 22 | |||
| 23 | public function init($currentValue, $maxValue, $valueName) |
||
| 28 | } |
||
| 29 | |||
| 30 | public function run() |
||
| 31 | { |
||
| 32 | if ($this->currentValue > $this->maxValue) { |
||
| 33 | return new Result(Result::STATUS_FAIL, 'The given value ("' . $this->valueName . '") is too big, it must be less than ' . $this->maxValue . '.'); |
||
| 34 | } else { |
||
| 35 | return new Result(Result::STATUS_PASS, 'The value ("' . $this->valueName . '") was within limits (< ' . $this->maxValue . ').'); |
||
| 36 | } |
||
| 37 | } |
||
| 38 | |||
| 39 | public function getIdentifier() |
||
| 42 | } |
||
| 43 | } |
||
| 44 |