Conditions | 2 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
30 | 3 | public function isValid($value) |
|
31 | { |
||
32 | 3 | $cleanedValue = $this->cleanSearchValue($value); |
|
33 | 3 | $match = $this->objectRepository->findOneBy($cleanedValue); |
|
34 | |||
35 | 3 | if (is_object($match)) { |
|
36 | 2 | $this->error(self::ERROR_OBJECT_FOUND, $value); |
|
37 | |||
38 | 2 | return false; |
|
39 | } |
||
40 | |||
41 | 1 | return true; |
|
42 | } |
||
43 | } |
||
44 |