| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | public function authorizeConsumerRequestToProvider(string $authType, string $credentials): array |
||
| 18 | { |
||
| 19 | switch ($authType) { |
||
| 20 | case 'http': |
||
| 21 | $headers = ['Authorization' => 'Basic ' . base64_encode($credentials)]; |
||
| 22 | break; |
||
| 23 | default: |
||
| 24 | throw new NoAuthTypeSupported('No authorization type:' . $authType . ' is supported'); |
||
| 25 | } |
||
| 26 | |||
| 27 | return $headers; |
||
| 28 | } |
||
| 29 | } |
||
| 30 |