| Conditions | 4 |
| Paths | 4 |
| Total Lines | 10 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 4.0466 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 47 | 3 | public function validate(IntrospectionResponse $response): void |
|
| 48 | { |
||
| 49 | 3 | if (empty($scopes = $response->scopes())) { |
|
| 50 | throw new AccessDeniedException("The introspection response has no scopes."); |
||
| 51 | } |
||
| 52 | |||
| 53 | 3 | foreach ($this->scopes as $scope) { |
|
| 54 | 3 | if (!in_array($scope, $scopes)) { |
|
| 55 | 2 | throw new AccessDeniedException( |
|
| 56 | 2 | "The scope '$scope' is not present in introspection response. Available scopes are " . implode(', ', $scopes) |
|
| 57 | ); |
||
| 62 |