Conditions | 4 |
Paths | 4 |
Total Lines | 10 |
Code Lines | 6 |
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. Available scopes are " . implode(', ', $scopes) |
||
57 | ); |
||
62 |