MimeFilters are now stateless

This commit is contained in:
Petr Bechyně
2016-11-02 09:55:12 +01:00
parent 969709cae5
commit bf494a42b5
10 changed files with 31 additions and 199 deletions

View File

@ -53,13 +53,14 @@ class SoapKernel
*
* @param SoapRequest $request Soap request
* @param SoapRequestFilter[]|SoapResponseFilter[] $filters
* @param int $attachmentType = SoapOptions::SOAP_ATTACHMENTS_TYPE_SWA|SoapOptions::ATTACHMENTS_TYPE_MTOM|SoapOptions::ATTACHMENTS_TYPE_BASE64
* @return SoapRequest
*/
public function filterRequest(SoapRequest $request, array $filters)
public function filterRequest(SoapRequest $request, array $filters, $attachmentType)
{
foreach ($filters as $filter) {
if ($filter instanceof SoapRequestFilter) {
$request = $filter->filterRequest($request);
$request = $filter->filterRequest($request, $attachmentType);
}
}
@ -71,13 +72,14 @@ class SoapKernel
*
* @param SoapResponse $response SOAP response
* @param SoapRequestFilter[]|SoapResponseFilter[] $filters
* @param int $attachmentType = SoapOptions::SOAP_ATTACHMENTS_TYPE_SWA|SoapOptions::ATTACHMENTS_TYPE_MTOM|SoapOptions::ATTACHMENTS_TYPE_BASE64
* @return SoapResponse
*/
public function filterResponse(SoapResponse $response, array $filters)
public function filterResponse(SoapResponse $response, array $filters, $attachmentType)
{
foreach ($filters as $filter) {
if ($filter instanceof SoapResponseFilter) {
$response = $filter->filterResponse($response);
$response = $filter->filterResponse($response, $attachmentType);
}
}

View File

@ -38,11 +38,11 @@ class SoapOptions
* @param string $encoding = SoapOptions::SOAP_ENCODING_UTF8
* @param SoapFeatures $features
* @param string $wsdlFile
* @param string $wsdlCacheType = SoapOptions::SOAP_CACHE_TYPE_NONE|SoapOptions::SOAP_CACHE_TYPE_MEMORY|SoapOptions::SOAP_CACHE_TYPE_DISK|SoapOptions::SOAP_CACHE_TYPE_DISK_MEMORY
* @param string $wsdlCacheDir = null
* @param int $wsdlCacheType = SoapOptions::SOAP_CACHE_TYPE_NONE|SoapOptions::SOAP_CACHE_TYPE_MEMORY|SoapOptions::SOAP_CACHE_TYPE_DISK|SoapOptions::SOAP_CACHE_TYPE_DISK_MEMORY
* @param string|null $wsdlCacheDir = null
* @param ClassMap $classMap
* @param TypeConverterCollection $typeConverterCollection
* @param string $attachmentType = SoapOptions::SOAP_ATTACHMENTS_OFF|SoapOptions::SOAP_ATTACHMENTS_TYPE_SWA|SoapOptions::ATTACHMENTS_TYPE_MTOM|SoapOptions::ATTACHMENTS_TYPE_BASE64
* @param int|null $attachmentType = SoapOptions::SOAP_ATTACHMENTS_OFF|SoapOptions::SOAP_ATTACHMENTS_TYPE_SWA|SoapOptions::ATTACHMENTS_TYPE_MTOM|SoapOptions::ATTACHMENTS_TYPE_BASE64
*/
public function __construct(
$soapVersion,

View File

@ -13,8 +13,6 @@
namespace BeSimple\SoapCommon;
use BeSimple\SoapCommon\SoapRequest;
/**
* SOAP request filter interface.
*
@ -26,6 +24,7 @@ interface SoapRequestFilter
* Modify SOAP response.
*
* @param SoapRequest $request SOAP request
* @param int $attachmentType = SoapOptions::SOAP_ATTACHMENTS_TYPE_SWA|SoapOptions::ATTACHMENTS_TYPE_MTOM|SoapOptions::ATTACHMENTS_TYPE_BASE64
*/
public function filterRequest(SoapRequest $request);
public function filterRequest(SoapRequest $request, $attachmentType);
}

View File

@ -26,6 +26,7 @@ interface SoapResponseFilter
* Modify SOAP response.
*
* @param SoapResponse $response SOAP response
* @param int $attachmentType = SoapOptions::SOAP_ATTACHMENTS_TYPE_SWA|SoapOptions::ATTACHMENTS_TYPE_MTOM|SoapOptions::ATTACHMENTS_TYPE_BASE64
*/
public function filterResponse(SoapResponse $response);
public function filterResponse(SoapResponse $response, $attachmentType);
}