1 | <?php |
||
9 | trait BaseClientTrait |
||
10 | { |
||
11 | abstract protected function getInternalCredential(); |
||
17 | |||
18 | 66 | public function __construct(array $credentials, array $options = []) |
|
24 | |||
25 | 10 | public function offsetGet($offset) |
|
26 | 10 | { |
|
27 | 10 | return $this->getInternalCredential()->offsetGet($offset); |
|
28 | } |
||
29 | |||
30 | public function offsetSet($offset, $value) |
||
34 | |||
35 | public function offsetUnset($offset) |
||
39 | |||
40 | public function offsetExists($offset) |
||
44 | |||
45 | public function __get($key) |
||
49 | |||
50 | public function __isset($key) |
||
54 | |||
55 | 12 | public function withCredentials(array $credentials) |
|
56 | 12 | { |
|
57 | 12 | return new static( |
|
58 | 12 | array_replace($this->getInternalCredential()->toArray(), $credentials), |
|
59 | 12 | $this->getInternalOptions() |
|
60 | ); |
||
61 | } |
||
62 | |||
63 | 6 | public function withOptions(array $options) |
|
70 | |||
71 | public function getCredentials($assoc = false) |
||
75 | |||
76 | public function getOptions($stringify = false) |
||
80 | |||
81 | 4 | public function getAuthorizeUrl($force_login = false) |
|
82 | 4 | { |
|
83 | 4 | return $this->getInternalCredential()->getAuthorizeUrl($force_login); |
|
84 | } |
||
85 | |||
86 | public function getAuthenticateUrl($force_login = false) |
||
90 | } |
||
91 |