1 | <?php |
||
11 | class BasicAuth implements Authentication |
||
12 | { |
||
13 | /** |
||
14 | * Token. |
||
15 | * |
||
16 | * @var string |
||
17 | */ |
||
18 | private $token; |
||
19 | |||
20 | /** |
||
21 | * Access key. |
||
22 | * |
||
23 | * @var string |
||
24 | */ |
||
25 | private $key; |
||
26 | |||
27 | public function __construct($token, $key) |
||
32 | |||
33 | /** |
||
34 | * Register hooks as needed. |
||
35 | * |
||
36 | * This method is called in {@see Requests::request} when the user has set |
||
37 | * an instance as the 'auth' option. Use this callback to register all the |
||
38 | * hooks you'll need. |
||
39 | * |
||
40 | * @see \Requests_Hooks::register |
||
41 | * |
||
42 | * @param \Requests_Hooks $hooks Hook system |
||
43 | */ |
||
44 | public function register(Requests_Hooks &$hooks) |
||
48 | |||
49 | /** |
||
50 | * Sets the authentication header. |
||
51 | * |
||
52 | * @param string $url |
||
53 | * @param array $headers |
||
54 | * @param array|string $data |
||
55 | * @param string $type |
||
56 | * @param array $options |
||
57 | */ |
||
58 | public function before_request(&$url, &$headers, &$data, &$type, &$options) |
||
62 | } |
||
63 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.