| 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 |
||
| 30 | 147 | public function validate(ValueObject $data) |
|
| 31 | { |
||
| 32 | 147 | $this->data = $data; |
|
| 33 | 147 | if (!$this->isValid($data)) { |
|
| 34 | 88 | $this->error = $this->getErrorMessage(); |
|
| 35 | 88 | $this->afterFailedValidation(); |
|
| 36 | 88 | return false; |
|
| 37 | } |
||
| 38 | 127 | $this->afterSuccessValidation(); |
|
| 39 | 127 | return true; |
|
| 40 | } |
||
| 75 | } |