From b9e36b4900d043646a1b7cc961bcfcfe7e8212a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Bechyn=C4=9B?= Date: Mon, 5 Jun 2017 10:50:53 +0200 Subject: [PATCH] Fix notice: attribute soapClientOptions defined in Trait and Client class --- src/BeSimple/SoapClient/SoapClient.php | 10 ++++++++++ .../SoapClient/SoapClientNativeMethodsTrait.php | 15 ++++++++++++--- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/BeSimple/SoapClient/SoapClient.php b/src/BeSimple/SoapClient/SoapClient.php index 4683cb0..0e68fc0 100644 --- a/src/BeSimple/SoapClient/SoapClient.php +++ b/src/BeSimple/SoapClient/SoapClient.php @@ -123,6 +123,16 @@ class SoapClient extends \SoapClient return $this->performHttpSoapRequest($soapRequest); } + protected function getSoapClientOptions() + { + return $this->soapClientOptions; + } + + protected function getSoapOptions() + { + return $this->soapOptions; + } + /** * @param string $location Location * @param string $action SOAP action diff --git a/src/BeSimple/SoapClient/SoapClientNativeMethodsTrait.php b/src/BeSimple/SoapClient/SoapClientNativeMethodsTrait.php index 8fb534d..e185cae 100644 --- a/src/BeSimple/SoapClient/SoapClientNativeMethodsTrait.php +++ b/src/BeSimple/SoapClient/SoapClientNativeMethodsTrait.php @@ -4,12 +4,11 @@ namespace BeSimple\SoapClient; use BeSimple\SoapBundle\Soap\SoapAttachment; use BeSimple\SoapClient\SoapOptions\SoapClientOptions; +use BeSimple\SoapCommon\SoapOptions\SoapOptions; use Exception; trait SoapClientNativeMethodsTrait { - /** @var SoapClientOptions */ - protected $soapClientOptions; /** @var SoapAttachment[] */ private $soapAttachmentsOnRequestStorage; /** @var SoapResponse */ @@ -36,6 +35,16 @@ trait SoapClientNativeMethodsTrait */ abstract protected function performSoapRequest($request, $location, $action, $version, array $soapAttachments = []); + /** + * @return SoapClientOptions + */ + abstract protected function getSoapClientOptions(); + + /** + * @return SoapOptions + */ + abstract protected function getSoapOptions(); + /** * Avoid using __call directly, it's deprecated even in \SoapClient. * @@ -130,7 +139,7 @@ trait SoapClientNativeMethodsTrait private function checkTracing() { - if ($this->soapClientOptions->getTrace() === false) { + if ($this->getSoapClientOptions()->getTrace() === false) { throw new Exception('SoapClientOptions tracing disabled, turn on trace attribute'); } }