Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| StaticTokenProvider | |
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| token | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace LambdaTwelve\OneRecord\Client; |
| 6 | |
| 7 | /** |
| 8 | * A fixed token: for tests, for tokens the host obtains itself, and for |
| 9 | * partners that hand out long-lived credentials. |
| 10 | */ |
| 11 | final class StaticTokenProvider implements TokenProvider |
| 12 | { |
| 13 | public function __construct(private readonly string $token) {} |
| 14 | |
| 15 | public function token(string $serverEndpoint): string |
| 16 | { |
| 17 | return $this->token; |
| 18 | } |
| 19 | } |