| Conditions | 4 | 
| Paths | 4 | 
| Total Lines | 19 | 
| Code Lines | 11 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Tests | 0 | 
| CRAP Score | 20 | 
| Changes | 3 | ||
| Bugs | 0 | Features | 0 | 
| 1 | <?php | ||
| 21 | public function validate($value, Constraint $constraint) | ||
| 22 |     { | ||
| 23 |         if (! $constraint instanceof PageRendering) { | ||
| 24 | throw new UnexpectedTypeException($constraint, PageRendering::class); | ||
| 25 | } | ||
| 26 | |||
| 27 |         if (false !== $value->getRedirection()) { // si c'est une redir, on check rien | ||
| 28 | return; | ||
| 29 | } | ||
| 30 | |||
| 31 | //$template = App::load($value->getHost(), $this->apps)->getTemplate(); | ||
| 32 | |||
| 33 |         try { | ||
| 34 | $value->getContent()->getBody(); | ||
| 35 |         } catch (\Exception $exception) { | ||
| 36 | $this->context->buildViolation($constraint->message) | ||
| 37 | ->addViolation(); | ||
| 38 | $this->context->buildViolation($exception->getMessage()) | ||
| 39 | ->addViolation(); | ||
| 40 | } | ||
| 43 |