| Conditions | 2 |
| Paths | 2 |
| Total Lines | 10 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 31 | 162 | public function validate(ValueObject $data) |
|
| 32 | { |
||
| 33 | 162 | $this->data = $data; |
|
| 34 | 162 | if (!$this->isValid($data)) { |
|
| 35 | 96 | $this->error = $this->getErrorMessage(); |
|
| 36 | 96 | $this->afterFailedValidation(); |
|
| 37 | 96 | return false; |
|
| 38 | } |
||
| 39 | 142 | $this->afterSuccessValidation(); |
|
| 40 | 142 | return true; |
|
| 41 | } |
||
| 76 | } |