| 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 | /** |
||
| 28 | * Create a new MoipBasic instance. |
||
| 29 | * |
||
| 30 | * @param string $token |
||
| 31 | * @param string $key |
||
| 32 | */ |
||
| 33 | public function __construct($token, $key) |
||
| 38 | |||
| 39 | /** |
||
| 40 | * Register hooks as needed. |
||
| 41 | * |
||
| 42 | * This method is called in {@see Requests::request} when the user has set |
||
| 43 | * an instance as the 'auth' option. Use this callback to register all the |
||
| 44 | * hooks you'll need. |
||
| 45 | * |
||
| 46 | * @see \Requests_Hooks::register |
||
| 47 | * |
||
| 48 | * @param \Requests_Hooks $hooks Hook system |
||
| 49 | */ |
||
| 50 | public function register(Requests_Hooks &$hooks) |
||
| 54 | |||
| 55 | /** |
||
| 56 | * Sets the authentication header. |
||
| 57 | * |
||
| 58 | * @param string $url |
||
| 59 | * @param array $headers |
||
| 60 | * @param array|string $data |
||
| 61 | * @param string $type |
||
| 62 | * @param array $options |
||
| 63 | */ |
||
| 64 | public function before_request(&$url, &$headers, &$data, &$type, &$options) |
||
| 68 | } |
||
| 69 |