| Conditions | 4 |
| Paths | 4 |
| Total Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 12 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 27 | 2 | public function validate($value, Constraint $constraint) |
|
| 28 | { |
||
| 29 | 2 | if ($value instanceof RemoteClaimInterface) { |
|
| 30 | |||
| 31 | 2 | $host = $value->getName()->getAuthorityName(); |
|
| 32 | 2 | $provider = $value->getProvider(); |
|
| 33 | |||
| 34 | 2 | $redirectUris = $provider->getRedirectUris(); |
|
| 35 | 2 | foreach ($redirectUris as $redirectUri) { |
|
| 36 | 2 | $uri = HttpUri::parseUri($redirectUri); |
|
| 37 | 2 | if ($uri['host'] === $host) { |
|
| 38 | 2 | return; |
|
| 39 | } |
||
| 40 | } |
||
| 41 | |||
| 42 | |||
| 43 | 1 | $this->context->buildViolation($constraint->message) |
|
| 44 | 1 | ->setParameter('{{ host }}', $host) |
|
| 45 | 1 | ->addViolation(); |
|
| 46 | } |
||
| 49 |