1 | <?php |
||
22 | class Endpoint implements EndpointInterface |
||
23 | { |
||
24 | /** |
||
25 | * URI of WSDL file |
||
26 | * |
||
27 | * @var string URI of WSDL file |
||
28 | */ |
||
29 | private $wsdl = 'https://burze.dzis.net/soap.php?WSDL'; |
||
30 | |||
31 | /** |
||
32 | * API key. |
||
33 | * |
||
34 | * @var string API key |
||
35 | */ |
||
36 | private $apiKey; |
||
37 | |||
38 | /** |
||
39 | * Custom options |
||
40 | * |
||
41 | * @var array custom options |
||
42 | */ |
||
43 | private $options; |
||
44 | |||
45 | /** |
||
46 | * Constructor. |
||
47 | * |
||
48 | * Custom options will be used as an argument when calling {@see client} method |
||
49 | * |
||
50 | * @param string $apiKey API key |
||
51 | * @param array $options custom soap options |
||
52 | */ |
||
53 | public function __construct(string $apiKey, array $options = []) |
||
58 | |||
59 | /** |
||
60 | * Get Soap client in WSDL mode |
||
61 | * |
||
62 | * @see __construct() Customizing client with option parameter |
||
63 | * @see {@link \SoapClient http://php.net/manual/en/class.soapclient.php} SoapClient |
||
64 | * @return SoapClient SoapClient in WSDL mode |
||
65 | * @throws SoapFault if the WSDL URI cannot be loaded or parsed |
||
66 | */ |
||
67 | public function client(): SoapClient |
||
71 | |||
72 | /** |
||
73 | * Get URI of WSDL file |
||
74 | * |
||
75 | * @return string URI of WSDL file |
||
76 | */ |
||
77 | public function wsdl(): string |
||
81 | |||
82 | /** |
||
83 | * Get API key |
||
84 | * |
||
85 | * @return string API key |
||
86 | */ |
||
87 | public function apiKey(): string |
||
91 | |||
92 | /** |
||
93 | * Get options |
||
94 | * |
||
95 | * @return array endpoint options |
||
96 | */ |
||
97 | public function options(): array |
||
101 | } |
||
102 |