| Total Complexity | 6 |
| Total Lines | 50 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | final class QueryParameter implements AuthenticationMethodInterface |
||
| 19 | { |
||
| 20 | private string $parameterName = 'access-token'; |
||
| 21 | private ?string $tokenType = null; |
||
| 22 | |||
| 23 | 10 | public function __construct(private IdentityWithTokenRepositoryInterface $identityRepository) |
|
| 24 | { |
||
| 25 | 10 | } |
|
| 26 | |||
| 27 | 7 | public function authenticate(ServerRequestInterface $request): ?IdentityInterface |
|
| 35 | } |
||
| 36 | |||
| 37 | 2 | public function challenge(ResponseInterface $response): ResponseInterface |
|
| 40 | } |
||
| 41 | |||
| 42 | /** |
||
| 43 | * @param string $name The parameter name for passing the access token. |
||
| 44 | * |
||
| 45 | * @return $this |
||
| 46 | * |
||
| 47 | * @psalm-immutable |
||
| 48 | */ |
||
| 49 | 2 | public function withParameterName(string $name): self |
|
| 54 | } |
||
| 55 | |||
| 56 | /** |
||
| 57 | * @param string|null $type Identity token type |
||
| 58 | * |
||
| 59 | * @return $this |
||
| 60 | * |
||
| 61 | * @psalm-immutable |
||
| 62 | */ |
||
| 63 | 2 | public function withTokenType(?string $type): self |
|
| 68 | } |
||
| 69 | } |
||
| 70 |