Skip to content

Commit c77e436

Browse files
authored
Apply fixes from StyleCI (#121)
Co-authored-by: Gregor Becker <[email protected]>
1 parent 825c04a commit c77e436

File tree

4 files changed

+11
-13
lines changed

4 files changed

+11
-13
lines changed

src/Handler/HttPlugHandle.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace CodeDredd\Soap\Handler;
44

5+
use CodeDredd\Soap\HttpBinding\Converter\Psr7Converter;
56
use Http\Client\Common\PluginClient;
67
use Http\Discovery\HttpClientDiscovery;
78
use Http\Discovery\MessageFactoryDiscovery;
@@ -11,7 +12,6 @@
1112
use Phpro\SoapClient\Middleware\MiddlewareSupportingInterface;
1213
use Phpro\SoapClient\Soap\Handler\HandlerInterface;
1314
use Phpro\SoapClient\Soap\Handler\LastRequestInfoCollectorInterface;
14-
use CodeDredd\Soap\HttpBinding\Converter\Psr7Converter;
1515
use Phpro\SoapClient\Soap\HttpBinding\LastRequestInfo;
1616
use Phpro\SoapClient\Soap\HttpBinding\SoapRequest;
1717
use Phpro\SoapClient\Soap\HttpBinding\SoapResponse;

src/HttpBinding/Builder/Psr7RequestBuilder.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -105,22 +105,21 @@ public function setHeaders(array $headers)
105105
}
106106

107107
/**
108-
* Mark as SOAP 1.1
108+
* Mark as SOAP 1.1.
109109
*/
110110
public function isSOAP11()
111111
{
112112
$this->soapVersion = self::SOAP11;
113113
}
114114

115115
/**
116-
* Mark as SOAP 1.2
116+
* Mark as SOAP 1.2.
117117
*/
118118
public function isSOAP12()
119119
{
120120
$this->soapVersion = self::SOAP12;
121121
}
122122

123-
124123
/**
125124
* @param string $soapAction
126125
*/
@@ -152,11 +151,11 @@ public function setHttpMethod(string $method)
152151
*/
153152
private function validate()
154153
{
155-
if (!$this->endpoint) {
154+
if (! $this->endpoint) {
156155
throw new RequestException('There is no endpoint specified.');
157156
}
158157

159-
if (!$this->hasSoapMessage && $this->httpMethod === 'POST') {
158+
if (! $this->hasSoapMessage && $this->httpMethod === 'POST') {
160159
throw new RequestException('There is no SOAP message specified.');
161160
}
162161

@@ -172,7 +171,7 @@ private function validate()
172171
* SOAP 1.2 only defines HTTP binding with POST and GET methods.
173172
* @link https://www.w3.org/TR/2007/REC-soap12-part0-20070427/#L10309
174173
*/
175-
if ($this->soapVersion === self::SOAP12 && !in_array($this->httpMethod, ['GET', 'POST'])) {
174+
if ($this->soapVersion === self::SOAP12 && ! in_array($this->httpMethod, ['GET', 'POST'])) {
176175
throw new RequestException('Invalid SOAP method specified for SOAP 1.2. Expeted: GET or POST.');
177176
}
178177
}
@@ -214,11 +213,12 @@ private function prepareSoap12Headers(): array
214213
$headers = [];
215214
if ($this->httpMethod !== 'POST') {
216215
$headers['Accept'] = 'application/soap+xml';
216+
217217
return $headers;
218218
}
219219

220220
$headers['Content-Length'] = (string) $this->soapMessage->getSize();
221-
$headers['Content-Type'] = 'application/soap+xml; charset="utf-8"' . '; action="' . $this->soapAction . '"';
221+
$headers['Content-Type'] = 'application/soap+xml; charset="utf-8"'.'; action="'.$this->soapAction.'"';
222222

223223
return $headers;
224224
}

src/HttpBinding/Converter/Psr7Converter.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,16 @@
22

33
namespace CodeDredd\Soap\HttpBinding\Converter;
44

5+
use CodeDredd\Soap\HttpBinding\Builder\Psr7RequestBuilder;
56
use Http\Message\MessageFactory;
67
use Http\Message\StreamFactory;
7-
use CodeDredd\Soap\HttpBinding\Builder\Psr7RequestBuilder;
88
use Phpro\SoapClient\Soap\HttpBinding\SoapRequest;
99
use Phpro\SoapClient\Soap\HttpBinding\SoapResponse;
1010
use Psr\Http\Message\RequestInterface;
1111
use Psr\Http\Message\ResponseInterface;
1212

1313
/**
14-
* Class Psr7Converter
15-
*
16-
* @package CodeDredd\Soap\HttpBinding\Converter
14+
* Class Psr7Converter.
1715
*/
1816
class Psr7Converter
1917
{

src/SoapClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use CodeDredd\Soap\Driver\ExtSoap\ExtSoapEngineFactory;
88
use CodeDredd\Soap\Exceptions\NotFoundConfigurationException;
99
use CodeDredd\Soap\Exceptions\SoapException;
10+
use CodeDredd\Soap\Handler\HttPlugHandle;
1011
use CodeDredd\Soap\Middleware\WsseMiddleware;
1112
use GuzzleHttp\Client;
1213
use GuzzleHttp\HandlerStack;
@@ -20,7 +21,6 @@
2021
use Phpro\SoapClient\Soap\Driver\ExtSoap\ExtSoapOptions;
2122
use Phpro\SoapClient\Soap\Engine\EngineInterface;
2223
use Phpro\SoapClient\Soap\Handler\HandlerInterface;
23-
use CodeDredd\Soap\Handler\HttPlugHandle;
2424
use Phpro\SoapClient\Type\ResultInterface;
2525
use Phpro\SoapClient\Type\ResultProviderInterface;
2626
use Phpro\SoapClient\Util\XmlFormatter;

0 commit comments

Comments
 (0)