1 | <?php |
||
12 | class Client |
||
13 | { |
||
14 | |||
15 | const VERSION = '1.0.0'; |
||
16 | |||
17 | const HEADER_SIGNATURE = 'X-Hele-Signature'; |
||
18 | const HEADER_SIGNATURE_ALGORITHM = 'X-Hele-Signature-Algorithm'; |
||
19 | |||
20 | const SIGNATURE_ALGORITHM = 'sha1'; |
||
21 | |||
22 | /** |
||
23 | * @var string |
||
24 | */ |
||
25 | private $secret; |
||
26 | |||
27 | /** |
||
28 | * @var Method[] |
||
29 | */ |
||
30 | private $methods; |
||
31 | |||
32 | /** |
||
33 | * @var RequestFactory |
||
34 | */ |
||
35 | private $requestFactory; |
||
36 | |||
37 | /** |
||
38 | * @param string $secret |
||
39 | * @param RequestFactory $requestFactory |
||
40 | */ |
||
41 | public function __construct($secret, RequestFactory $requestFactory) |
||
48 | |||
49 | public function registerMethod(Method $method) |
||
53 | |||
54 | /** |
||
55 | * @return SuccessResponse|ErrorResponse |
||
56 | */ |
||
57 | public function run() |
||
82 | |||
83 | /** |
||
84 | * @param string $method |
||
85 | * @return Method |
||
86 | * @throws ClientException |
||
87 | */ |
||
88 | private function getMethod($method) |
||
96 | |||
97 | } |
||
98 |