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