| Conditions | 5 |
| Paths | 5 |
| Total Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | public function validate($value) { |
||
| 20 | if (!parent::validate($value)) { |
||
| 21 | return false; |
||
| 22 | } |
||
| 23 | if(null==$value){ |
||
| 24 | return true; |
||
| 25 | } |
||
| 26 | if(!is_integer($value)){ |
||
| 27 | $this->violation="type"; |
||
| 28 | return false; |
||
| 29 | } |
||
| 30 | if($value<=0){ |
||
| 31 | $this->violation="positive"; |
||
| 32 | return false; |
||
| 33 | } |
||
| 34 | return true; |
||
| 35 | } |
||
| 36 | |||
| 47 |