Total Complexity | 4 |
Total Lines | 35 |
Duplicated Lines | 0 % |
Coverage | 86.67% |
Changes | 6 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | class SoapFactory implements LoggerAwareInterface |
||
13 | { |
||
14 | /** @var LoggerInterface */ |
||
15 | private $logger; |
||
16 | |||
17 | 99 | public function __construct(LoggerInterface $logger = null) |
|
20 | } |
||
21 | |||
22 | 65 | public function createSoapClient(string $wsdlLocation): SoapClient |
|
23 | { |
||
24 | 65 | return new SoapClient($wsdlLocation, [ |
|
25 | 65 | 'features' => SOAP_SINGLE_ELEMENT_ARRAYS, |
|
26 | 65 | 'cache_wsdl' => WSDL_CACHE_MEMORY, |
|
27 | 65 | 'exceptions' => true, |
|
28 | 65 | 'trace' => true, |
|
29 | 65 | ]); |
|
30 | } |
||
31 | |||
32 | /** |
||
33 | * @param string $wsdlLocation |
||
34 | * @param array<mixed> $defaultOptions |
||
35 | * @return SoapCaller |
||
36 | */ |
||
37 | 65 | public function createSoapCaller(string $wsdlLocation, array $defaultOptions): SoapCaller |
|
38 | { |
||
39 | 65 | $caller = new SoapCaller($this->createSoapClient($wsdlLocation), $defaultOptions); |
|
40 | 65 | $caller->setLogger($this->logger); |
|
41 | 65 | return $caller; |
|
42 | } |
||
43 | |||
44 | public function setLogger(LoggerInterface $logger): void |
||
47 | } |
||
48 | } |
||
49 |