| 1 | <?php |
||
| 11 | class OAuth implements Authentication |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * Access Token. |
||
| 15 | * |
||
| 16 | * @var string |
||
| 17 | */ |
||
| 18 | private $accessToken; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * Create a new OAuth instance. |
||
| 22 | * |
||
| 23 | * @param string $accessToken |
||
| 24 | */ |
||
| 25 | public function __construct($accessToken) |
||
| 29 | |||
| 30 | /** |
||
| 31 | * Register hooks as needed. |
||
| 32 | * |
||
| 33 | * This method is called in {@see Requests::request} when the user has set |
||
| 34 | * an instance as the 'auth' option. Use this callback to register all the |
||
| 35 | * hooks you'll need. |
||
| 36 | * |
||
| 37 | * @see \Requests_Hooks::register |
||
| 38 | * |
||
| 39 | * @param \Requests_Hooks $hooks Hook system |
||
| 40 | */ |
||
| 41 | public function register(Requests_Hooks &$hooks) |
||
| 45 | |||
| 46 | /** |
||
| 47 | * Sets the authentication header. |
||
| 48 | * |
||
| 49 | * @param string $url |
||
| 50 | * @param array $headers |
||
| 51 | * @param array|string $data |
||
| 52 | * @param string $type |
||
| 53 | * @param array $options |
||
| 54 | */ |
||
| 55 | public function before_request(&$url, &$headers, &$data, &$type, &$options) |
||
| 59 | } |
||
| 60 |