Total Complexity | 6 |
Total Lines | 43 |
Duplicated Lines | 0 % |
Coverage | 75% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
14 | final class RequiredScopeValidator extends AbstractEndPointTransformerExtension |
||
15 | { |
||
16 | use EndPointTransformerTrait; |
||
17 | |||
18 | /** |
||
19 | * @var string[] |
||
20 | */ |
||
21 | private $scopes; |
||
22 | |||
23 | |||
24 | /** |
||
25 | * @param string[] $scopes |
||
26 | */ |
||
27 | 3 | public function __construct(array $scopes) |
|
28 | { |
||
29 | 3 | $this->scopes = $scopes; |
|
30 | 3 | } |
|
31 | |||
32 | /** |
||
33 | * {@inheritdoc} |
||
34 | */ |
||
35 | public function onIntrospection(IntrospectionEndPoint $endPoint): IntrospectionEndPoint |
||
36 | { |
||
37 | return $endPoint->onResponse([$this, 'validate']); |
||
38 | } |
||
39 | |||
40 | /** |
||
41 | * Validate the all scopes are in the introspection response |
||
42 | * |
||
43 | * @param IntrospectionResponse $response |
||
44 | * |
||
45 | * @internal |
||
46 | */ |
||
47 | 3 | public function validate(IntrospectionResponse $response): void |
|
57 | ); |
||
58 | } |
||
59 | } |
||
62 |