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