Conditions | 1 |
Paths | 1 |
Total Lines | 10 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 2 |
Changes | 2 | ||
Bugs | 1 | Features | 2 |
1 | <?php |
||
14 | public function applyRule($parameterName, $value, $itemType = false) |
||
15 | { |
||
16 | $this |
||
17 | ->getMethod() |
||
18 | ->addChild('// validation for constraint: minExclusive') |
||
19 | ->addChild(sprintf('if ($%s < %d) {', $parameterName, $value)) |
||
20 | ->addChild($this->getMethod()->getIndentedString(sprintf('throw new \InvalidArgumentException(sprintf(\'Invalid value, the value must be superior to %d\, "%%s" given\', %s), __LINE__);', $value, $parameterName), 1)) |
||
21 | ->addChild('}'); |
||
22 | return $this; |
||
23 | } |
||
24 | } |
||
25 |