Conditions | 4 |
Paths | 4 |
Total Lines | 23 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
42 | public function handle(Request $request) |
||
43 | { |
||
44 | $headers = $request->getHeaders(); |
||
45 | |||
46 | if (array_key_exists('Authorization', $headers)) { |
||
47 | $authorization = $headers['Authorization']; |
||
48 | |||
49 | if (substr($authorization, 0, strlen('Basic ')) !== 'Basic ') { |
||
50 | return false; |
||
51 | } |
||
52 | |||
53 | $authentication = base64_decode(substr($authorization, strlen('Basic '))); |
||
54 | $parts = explode(':', $authentication); |
||
55 | |||
56 | if (count($parts) !== 2) { |
||
57 | return false; |
||
58 | } |
||
59 | |||
60 | return call_user_func($this->implementation, $parts[0], $parts[1]); |
||
61 | } |
||
62 | |||
63 | return false; |
||
64 | } |
||
65 | |||
80 |