1 | <?php |
||
17 | class Client |
||
18 | { |
||
19 | const ENV_DEV = 'dev'; |
||
20 | const ENV_PRODUCTION = 'production'; |
||
21 | |||
22 | /** |
||
23 | * This URL is used for testing purposes |
||
24 | * |
||
25 | * @var string |
||
26 | */ |
||
27 | protected $testServerUrl = 'http://sstest.consignor.com/ship/ShipmentServerModule.dll'; |
||
28 | |||
29 | /** |
||
30 | * This URL is used for production requests |
||
31 | * |
||
32 | * @var string |
||
33 | */ |
||
34 | protected $productionServerUrl = 'https://www.shipmentserver.com/ship/ShipmentServerModule.dll'; |
||
35 | |||
36 | /** |
||
37 | * @var string |
||
38 | */ |
||
39 | protected $actor; |
||
40 | |||
41 | /** |
||
42 | * @var string |
||
43 | */ |
||
44 | protected $key; |
||
45 | |||
46 | /** |
||
47 | * Should be either 'dev' or 'production' |
||
48 | * |
||
49 | * @var string |
||
50 | */ |
||
51 | protected $environment; |
||
52 | |||
53 | /** |
||
54 | * @var ClientInterface |
||
55 | */ |
||
56 | protected $httpClient; |
||
57 | |||
58 | /** |
||
59 | * @var RequestFactoryInterface |
||
60 | */ |
||
61 | protected $requestFactory; |
||
62 | |||
63 | /** |
||
64 | * @var StreamFactoryInterface|null |
||
65 | */ |
||
66 | private $streamFactory; |
||
67 | |||
68 | /** |
||
69 | * This is the last psr request |
||
70 | * |
||
71 | * @var PsrRequestInterface|null |
||
72 | */ |
||
73 | protected $request; |
||
74 | |||
75 | /** |
||
76 | * This is the last PSR response |
||
77 | * |
||
78 | * @var PsrResponseInterface|null |
||
79 | */ |
||
80 | protected $response; |
||
81 | |||
82 | public function __construct( |
||
118 | |||
119 | public function doRequest(RequestInterface $request): ResponseInterface |
||
150 | |||
151 | public function getActor(): string |
||
155 | |||
156 | public function getRequest(): ?PsrRequestInterface |
||
160 | |||
161 | public function getResponse(): ?PsrResponseInterface |
||
165 | } |
||
166 |