From 4f2452e5db910f7289ff2d68ab97826d0260b268 Mon Sep 17 00:00:00 2001 From: Toon Verwerft Date: Mon, 15 Nov 2021 08:36:25 +0100 Subject: [PATCH 1/2] Fix broken return type --- src/AbusedClient.php | 2 +- stubs/SoapClient.phpstub | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/AbusedClient.php b/src/AbusedClient.php index a8437b3..94fdaaf 100644 --- a/src/AbusedClient.php +++ b/src/AbusedClient.php @@ -63,7 +63,7 @@ public function doActualRequest( bool $oneWay = false ): string { $this->__last_request = $request; - $this->__last_response = parent::__doRequest($request, $location, $action, $version, $oneWay); + $this->__last_response = (string) parent::__doRequest($request, $location, $action, $version, $oneWay); return $this->__last_response; } diff --git a/stubs/SoapClient.phpstub b/stubs/SoapClient.phpstub index 250db4a..e74d67a 100644 --- a/stubs/SoapClient.phpstub +++ b/stubs/SoapClient.phpstub @@ -7,5 +7,5 @@ class SoapClient * @see https://github.com/vimeo/psalm/issues/6901 * This can be removed once it is fixed in psalm */ - public function __doRequest (string $request, string $location, string $action, int $version, bool $one_way = false) {} + public function __doRequest (string $request, string $location, string $action, int $version, bool $one_way = false): ?string {} } From c993e25a72224eeb84b89f5d6b31521de6fb1765 Mon Sep 17 00:00:00 2001 From: Toon Verwerft Date: Mon, 15 Nov 2021 09:01:33 +0100 Subject: [PATCH 2/2] Add example --- examples/ext-soap-transport.php | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 examples/ext-soap-transport.php diff --git a/examples/ext-soap-transport.php b/examples/ext-soap-transport.php new file mode 100644 index 0000000..d2b1bf2 --- /dev/null +++ b/examples/ext-soap-transport.php @@ -0,0 +1,29 @@ + 0, + ]) + ) + ), + $transport = new TraceableTransport( + $client, + new ExtSoapClientTransport($client) + ) +); + +$result = $engine->request('Add', [['intA' => 1, 'intB' => 2]]); + +var_dump($result); +var_dump($transport->collectLastRequestInfo());