1 | <?php |
||
20 | abstract class ServiceClientBase implements ServiceClientInterface |
||
21 | { |
||
22 | /** |
||
23 | * @var array |
||
24 | */ |
||
25 | protected $serviceURL; |
||
26 | |||
27 | /** |
||
28 | * @var CredentialsInterface |
||
29 | */ |
||
30 | protected $credentials; |
||
31 | |||
32 | /** |
||
33 | * @var Notification |
||
34 | */ |
||
35 | protected $notification; |
||
36 | |||
37 | /** |
||
38 | * @var mixed |
||
39 | */ |
||
40 | protected $serviceClient; |
||
41 | |||
42 | /** |
||
43 | * @param array $serviceUrl |
||
44 | * @param CredentialsInterface $credentials |
||
45 | */ |
||
46 | public function __construct($serviceUrl, CredentialsInterface $credentials) |
||
55 | |||
56 | abstract protected function createClient(); |
||
57 | |||
58 | /** |
||
59 | * @param array $serviceURL |
||
60 | * @return $this |
||
61 | */ |
||
62 | public function setServiceURL($serviceURL) |
||
67 | |||
68 | /** |
||
69 | * @return array |
||
70 | */ |
||
71 | public function getServiceURL() |
||
75 | |||
76 | /** |
||
77 | * @param CredentialsInterface $credentials |
||
78 | * @return $this |
||
79 | */ |
||
80 | public function setCredentials(CredentialsInterface $credentials) |
||
85 | |||
86 | /** |
||
87 | * @return CredentialsInterface |
||
88 | */ |
||
89 | public function getCredentials() |
||
93 | |||
94 | /** |
||
95 | * @param Notification $notification |
||
96 | * @return $this |
||
97 | */ |
||
98 | public function setNotification(Notification $notification) |
||
103 | |||
104 | /** |
||
105 | * @return Notification |
||
106 | */ |
||
107 | public function getNotificationOrThrowException() |
||
115 | |||
116 | /** |
||
117 | * @return mixed |
||
118 | */ |
||
119 | public function getClientConnection() |
||
123 | } |
||
124 |