1 | <?php |
||
11 | trait ProviderRedirectTrait |
||
12 | { |
||
13 | /** |
||
14 | * Maximum number of times to follow provider initiated redirects |
||
15 | * |
||
16 | * @var integer |
||
17 | */ |
||
18 | protected $redirectLimit = 2; |
||
19 | |||
20 | /** |
||
21 | * Returns the HTTP client instance. |
||
22 | * |
||
23 | * @return GuzzleHttp\ClientInterface |
||
24 | */ |
||
25 | abstract public function getHttpClient(); |
||
26 | |||
27 | /** |
||
28 | * Retrieves current redirect limit. |
||
29 | * |
||
30 | * @return integer |
||
31 | */ |
||
32 | 4 | public function getRedirectLimit() |
|
36 | |||
37 | /** |
||
38 | * Determines if a given response is a redirect. |
||
39 | * |
||
40 | * @param ResponseInterface $response |
||
41 | * |
||
42 | * @return boolean |
||
43 | */ |
||
44 | 6 | protected function isRedirect(ResponseInterface $response) |
|
50 | |||
51 | /** |
||
52 | * Sends a request instance and returns a response instance. |
||
53 | * |
||
54 | * @param RequestInterface $request |
||
55 | * @return ResponseInterface |
||
56 | */ |
||
57 | 8 | protected function sendRequest(RequestInterface $request) |
|
83 | |||
84 | /** |
||
85 | * Updates the redirect limit. |
||
86 | * |
||
87 | * @param integer $limit |
||
88 | * @return League\OAuth2\Client\Provider\AbstractProvider |
||
89 | * @throws InvalidArgumentException |
||
90 | */ |
||
91 | 10 | public function setRedirectLimit($limit) |
|
101 | } |
||
102 |