| Conditions | 2 |
| Paths | 1 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 2.0078 |
| Changes | 2 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 28 | 13 | protected function initHasAcceptsMediaWithValidation() |
|
| 29 | { |
||
| 30 | 13 | $this->acceptsMedia(function ($file) { |
|
| 31 | /** @var AbstractValidator $validator */ |
||
| 32 | 2 | $validator = $this->getValidator(); |
|
| 33 | 2 | $constraint = $this->getConstraint(); |
|
| 34 | |||
| 35 | 2 | $violations = $validator->validate($file, $constraint); |
|
| 36 | 2 | if ($violations->count() < 1) { |
|
| 37 | 2 | return true; |
|
| 38 | } |
||
| 39 | |||
| 40 | return $violations; |
||
| 41 | 13 | }); |
|
| 63 |