1 | <?php |
||
23 | final class BillogramClient |
||
24 | { |
||
25 | /** |
||
26 | * @var HttpClient |
||
27 | */ |
||
28 | private $httpClient; |
||
29 | |||
30 | /** |
||
31 | * @var Hydrator |
||
32 | */ |
||
33 | private $hydrator; |
||
34 | |||
35 | /** |
||
36 | * @var RequestBuilder |
||
37 | */ |
||
38 | private $requestBuilder; |
||
39 | |||
40 | /** |
||
41 | * The constructor accepts already configured HTTP clients. |
||
42 | * Use the configure method to pass a configuration to the Client and create an HTTP Client. |
||
43 | * |
||
44 | * @param HttpClient $httpClient |
||
45 | * @param Hydrator|null $hydrator |
||
46 | * @param RequestBuilder|null $requestBuilder |
||
47 | */ |
||
48 | 9 | public function __construct( |
|
57 | |||
58 | /** |
||
59 | * @param HttpClientConfigurator $httpClientConfigurator |
||
60 | * @param Hydrator|null $hydrator |
||
61 | * @param RequestBuilder|null $requestBuilder |
||
62 | * |
||
63 | * @return BillogramClient |
||
64 | */ |
||
65 | 9 | public static function configure( |
|
74 | |||
75 | /** |
||
76 | * @param string $apiKey |
||
77 | * |
||
78 | * @return BillogramClient |
||
79 | */ |
||
80 | public static function create(string $username, string $apiKey): BillogramClient |
||
86 | |||
87 | /** |
||
88 | * @return Api\Customer |
||
89 | */ |
||
90 | public function customers(): Customer |
||
94 | |||
95 | /** |
||
96 | * @return Api\Item |
||
97 | */ |
||
98 | 5 | public function items(): Item |
|
102 | |||
103 | /** |
||
104 | * @return Api\Invoice |
||
105 | */ |
||
106 | public function invoices(): Invoice |
||
110 | |||
111 | /** |
||
112 | * @return Api\Report |
||
113 | */ |
||
114 | 2 | public function report(): Report |
|
118 | |||
119 | /** |
||
120 | * @return Api\Settings |
||
121 | */ |
||
122 | 2 | public function settings(): Settings |
|
126 | } |
||
127 |