| Conditions | 1 |
| Total Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 21 | public function getPlugin(): \Http\Client\Common\Plugin |
||
| 22 | { |
||
| 23 | return new \Http\Client\Common\Plugin\AuthenticationPlugin(new class($this->{'apiKey'}) implements \Http\Message\Authentication { |
||
| 24 | private $apiKey; |
||
| 25 | |||
| 26 | public function __construct(string $apiKey) |
||
| 27 | { |
||
| 28 | $this->{'apiKey'} = $apiKey; |
||
| 29 | } |
||
| 30 | |||
| 31 | public function authenticate(\Psr\Http\Message\RequestInterface $request) |
||
| 32 | { |
||
| 33 | return $request->withHeader('Authorization', $this->{'apiKey'}); |
||
| 34 | } |
||
| 38 |