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