1 | <?php |
||
8 | abstract class AbstractClient implements ClientInterface |
||
9 | { |
||
10 | /** |
||
11 | * @var string The user agent string passed to services |
||
12 | */ |
||
13 | protected $userAgent; |
||
14 | |||
15 | /** |
||
16 | * @var int The maximum number of redirects |
||
17 | */ |
||
18 | protected $maxRedirects = 5; |
||
19 | |||
20 | /** |
||
21 | * @var int The maximum timeout |
||
22 | */ |
||
23 | protected $timeout = 15; |
||
24 | |||
25 | /** |
||
26 | * Creates instance. |
||
27 | * |
||
28 | * @param string $userAgent The UA string the client will use |
||
29 | */ |
||
30 | public function __construct($userAgent = 'PHPoAuthLib') |
||
34 | |||
35 | /** |
||
36 | * @param int $redirects Maximum redirects for client |
||
37 | * |
||
38 | * @return ClientInterface |
||
39 | */ |
||
40 | public function setMaxRedirects($redirects) |
||
46 | |||
47 | /** |
||
48 | * @param int $timeout Request timeout time for client in seconds |
||
49 | * |
||
50 | * @return ClientInterface |
||
51 | */ |
||
52 | public function setTimeout($timeout) |
||
58 | |||
59 | /** |
||
60 | * @param array $headers |
||
61 | */ |
||
62 | public function normalizeHeaders(&$headers): void |
||
73 | } |
||
74 |