1 | <?php |
||
12 | abstract class AbstractService implements ServiceInterface |
||
13 | { |
||
14 | /** |
||
15 | * Transport for the requests. |
||
16 | * |
||
17 | * @var TransportInterface |
||
18 | */ |
||
19 | protected $transport; |
||
20 | |||
21 | /** |
||
22 | * @var SerializerInterface |
||
23 | */ |
||
24 | protected $serializer; |
||
25 | |||
26 | /** |
||
27 | * Constructor. |
||
28 | * |
||
29 | * @param TransportInterface $transport Transport for the requests. |
||
30 | * @param SerializerInterface $serializer Serializer interface to serialize / deserialize the request / responses. |
||
31 | */ |
||
32 | 141 | public function __construct(TransportInterface $transport, SerializerInterface $serializer) |
|
37 | |||
38 | /** |
||
39 | * Send a request to fastbill. |
||
40 | * |
||
41 | * @param mixed $request The request to send. |
||
42 | * @param string $responseClass The class that should be used to unserialize the response. |
||
43 | * @return ApiResponseInterface |
||
44 | * @throws ApiResponseException If the API response has errors. |
||
45 | */ |
||
46 | 135 | protected function sendRequest(RequestInterface $request, $responseClass) |
|
66 | } |
||
67 |