|
13 | 13 | use bdk\Debug; |
14 | 14 | use bdk\Debug\Abstraction\Abstraction; |
15 | 15 | use bdk\Debug\Abstraction\Type; |
| 16 | +use bdk\Debug\Collector\SoapClient\CompatTrait; |
16 | 17 | use DOMDocument; |
17 | 18 | use Exception; |
18 | 19 | use ReflectionClass; |
|
28 | 29 | */ |
29 | 30 | class SoapClient extends SoapClientBase |
30 | 31 | { |
| 32 | + use CompatTrait; |
| 33 | + |
31 | 34 | /** @var Debug */ |
32 | 35 | private $debug; |
33 | 36 |
|
@@ -101,32 +104,6 @@ public function __call($name, $args) |
101 | 104 | return $return; |
102 | 105 | } |
103 | 106 |
|
104 | | - /** |
105 | | - * {@inheritDoc} |
106 | | - */ |
107 | | - #[\ReturnTypeWillChange] |
108 | | - public function __doRequest($request, $location, $action, $version, $oneWay = 0, $uriParserClass = null) |
109 | | - { |
110 | | - $exception = null; |
111 | | - try { |
112 | | - $xmlResponse = PHP_VERSION_ID >= 80500 |
113 | | - ? parent::__doRequest($request, $location, $action, $version, $oneWay, $uriParserClass) |
114 | | - : parent::__doRequest($request, $location, $action, $version, $oneWay); |
115 | | - } catch (SoapFault $e) { |
116 | | - // we'll rethrow bellow |
117 | | - } |
118 | | - $this->setLastRequest($request); |
119 | | - $this->setLastResponse($xmlResponse); |
120 | | - if ($this->isViaCall() === false) { |
121 | | - // __doRequest called directly |
122 | | - $this->logReqRes($action, $exception, true); |
123 | | - } |
124 | | - if ($exception) { |
125 | | - throw $exception; |
126 | | - } |
127 | | - return $xmlResponse; |
128 | | - } |
129 | | - |
130 | 107 | /** |
131 | 108 | * Get defined types keyed by name |
132 | 109 | * |
@@ -239,6 +216,44 @@ private function debugGetXmlResponse(&$faultInfo) |
239 | 216 | return $this->dom->saveXML(); |
240 | 217 | } |
241 | 218 |
|
| 219 | + /** |
| 220 | + * Handle __doRequest |
| 221 | + * |
| 222 | + * @param string $request The XML SOAP request. |
| 223 | + * @param string $location The URL to request. |
| 224 | + * @param string $action The SOAP action. |
| 225 | + * @param int $version The SOAP version. |
| 226 | + * @param bool $oneWay If set to true, this method returns nothing. |
| 227 | + * Use this where a response is not expected. |
| 228 | + * @param string|null $uriParserClass (PHP 8.5+) URI parser class |
| 229 | + * |
| 230 | + * @return string|null The XML SOAP response. |
| 231 | + * |
| 232 | + * @throws Exception |
| 233 | + */ |
| 234 | + #[\ReturnTypeWillChange] |
| 235 | + private function doDoRequest($request, $location, $action, $version, $oneWay = false, $uriParserClass = null) |
| 236 | + { |
| 237 | + $exception = null; |
| 238 | + try { |
| 239 | + $xmlResponse = PHP_VERSION_ID >= 80500 |
| 240 | + ? parent::__doRequest($request, $location, $action, $version, $oneWay, $uriParserClass) |
| 241 | + : parent::__doRequest($request, $location, $action, $version, $oneWay); |
| 242 | + } catch (SoapFault $e) { |
| 243 | + // we'll rethrow bellow |
| 244 | + } |
| 245 | + $this->setLastRequest($request); |
| 246 | + $this->setLastResponse($xmlResponse); |
| 247 | + if ($this->isViaCall() === false) { |
| 248 | + // __doRequest called directly |
| 249 | + $this->logReqRes($action, $exception, true); |
| 250 | + } |
| 251 | + if ($exception) { |
| 252 | + throw $exception; |
| 253 | + } |
| 254 | + return $xmlResponse; |
| 255 | + } |
| 256 | + |
242 | 257 | /** |
243 | 258 | * Check if __call is in backtrace |
244 | 259 | * |
|
0 commit comments