| Conditions | 5 |
| Paths | 4 |
| Total Lines | 15 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 45 | public function extract(Request $request) |
||
| 46 | { |
||
| 47 | if (!$request->headers->has($this->name)) { |
||
| 48 | return false; |
||
| 49 | } |
||
| 50 | $authorizationHeader = $request->headers->get($this->name); |
||
| 51 | if (empty($this->prefix)) { |
||
| 52 | return $authorizationHeader; |
||
| 53 | } |
||
| 54 | $headerParts = explode(' ', $authorizationHeader); |
||
| 55 | if (!(2 === count($headerParts) && $headerParts[0] === $this->prefix)) { |
||
| 56 | return false; |
||
| 57 | } |
||
| 58 | |||
| 59 | return $headerParts[1]; |
||
| 60 | } |
||
| 62 |