Skip to content

Commit 94e7f49

Browse files
author
Gregor Becker
committed
Merge remote-tracking branch 'origin/feature/laravel-soap-179' into feature/laravel-soap-179
# Conflicts: # src/SoapClient.php
2 parents 9f884a6 + f9442c4 commit 94e7f49

File tree

10 files changed

+24
-32
lines changed

10 files changed

+24
-32
lines changed

src/Client/Request.php

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

33
namespace CodeDredd\Soap\Client;
44

5-
use CodeDredd\Soap\Xml\SoapXml;
65
use CodeDredd\Soap\Xml\XMLSerializer;
76
use Illuminate\Support\Arr;
87
use Illuminate\Support\Str;

src/Driver/ExtSoap/ExtSoapEngineFactory.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ public static function fromOptionsWithHandler(
1919
): EngineFaker|SimpleEngine {
2020
$driver = ExtSoapDriver::createFromOptions($options);
2121
if ($withMocking) {
22-
2322
}
2423

2524
return $withMocking ? new EngineFaker($driver, $transport, $options) : new SimpleEngine($driver, $transport);

src/Faker/EngineFaker.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,4 @@ public function getMetadata(): Metadata
4343
{
4444
return $this->driver->getMetadata();
4545
}
46-
4746
}

src/Middleware/CisDhlMiddleware.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
use Http\Client\Common\Plugin;
66
use Http\Promise\Promise;
77
use Psr\Http\Message\RequestInterface;
8+
use Psr\Http\Message\ResponseInterface;
89
use Soap\Psr18Transport\Xml\XmlMessageManipulator;
910
use Soap\Xml\Builder\SoapHeader;
1011
use Soap\Xml\Builder\SoapHeaders;
1112
use Soap\Xml\Manipulator\PrependSoapHeaders;
12-
use VeeWee\Xml\Dom\Document;
13-
use Psr\Http\Message\ResponseInterface;
1413
use function VeeWee\Xml\Dom\Builder\children;
1514
use function VeeWee\Xml\Dom\Builder\namespaced_element;
1615
use function VeeWee\Xml\Dom\Builder\value;
16+
use VeeWee\Xml\Dom\Document;
1717

1818
class CisDhlMiddleware implements Plugin
1919
{
@@ -48,7 +48,7 @@ public function handleRequest(RequestInterface $request, callable $next, callabl
4848
return $next(
4949
(new XmlMessageManipulator)(
5050
$request,
51-
function (Document $document) use ($request) {
51+
function (Document $document) {
5252
$builder = new SoapHeaders(
5353
new SoapHeader(
5454
self::CIS_NS,

src/Middleware/WsseMiddleware.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,6 @@ function (Document $xml) {
120120
$wsse->attachTokentoSig($token);
121121
}
122122

123-
124-
125123
// Add end-to-end encryption if configured:
126124
if ($this->encrypt) {
127125
$key = new XMLSecurityKey(XMLSecurityKey::AES256_CBC);
@@ -131,7 +129,7 @@ function (Document $xml) {
131129
$wsse->encryptSoapDoc($siteKey, $key, [
132130
'KeyInfo' => [
133131
'X509SubjectKeyIdentifier' => $this->serverCertificateHasSubjectKeyIdentifier,
134-
]
132+
],
135133
]);
136134
}
137135
}
@@ -142,7 +140,7 @@ function (Document $xml) {
142140

143141
public function afterResponse(ResponseInterface $response): ResponseInterface
144142
{
145-
if (!$this->encrypt) {
143+
if (! $this->encrypt) {
146144
return $response;
147145
}
148146

@@ -158,8 +156,8 @@ function (Document $xml) {
158156
'key' => $this->privateKeyFile,
159157
'isFile' => true,
160158
'isCert' => false,
161-
]
162-
]
159+
],
160+
],
163161
]
164162
);
165163
}

src/SoapClient.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ function (Request $request, array $options) {
9696
]);
9797
}
9898

99-
public function refreshWsdlProvider(){
99+
public function refreshWsdlProvider()
100+
{
100101
$this->wsdlProvider = new FlatteningLoader(Psr18Loader::createForClient($this->pluginClient));
101102

102103
return $this;
@@ -129,7 +130,6 @@ protected function setTransport(Transport $handler = null): static
129130
$transport
130131
);
131132

132-
133133
return $this;
134134
}
135135

@@ -164,10 +164,10 @@ public function withGuzzleClientOptions($options)
164164
{
165165
$this->guzzleClientOptions = array_merge_recursive($this->guzzleClientOptions, $options);
166166
$this->client = new Client($this->guzzleClientOptions);
167+
167168
return $this;
168169
}
169170

170-
171171
public function getEngine(): Engine
172172
{
173173
return $this->engine;
@@ -328,7 +328,7 @@ public function __call($method, $parameters)
328328
public function call(string $method, $arguments = []): Response
329329
{
330330
try {
331-
if (!$this->isClientBuilded) {
331+
if (! $this->isClientBuilded) {
332332
$this->buildClient();
333333
}
334334
$this->refreshEngine();
@@ -343,7 +343,7 @@ public function call(string $method, $arguments = []): Response
343343
if ($result instanceof ResultProviderInterface) {
344344
$result = Response::fromSoapResponse($result->getResult());
345345
}
346-
if (!$result instanceof ResultInterface) {
346+
if (! $result instanceof ResultInterface) {
347347
$result = Response::fromSoapResponse($result);
348348
}
349349
} catch (\Exception $exception) {
@@ -389,9 +389,9 @@ public function buildClient(string $setup = '')
389389
*/
390390
public function byConfig(string $setup)
391391
{
392-
if (!empty($setup)) {
392+
if (! empty($setup)) {
393393
$setup = config()->get('soap.clients.'.$setup);
394-
if (!$setup) {
394+
if (! $setup) {
395395
throw new NotFoundConfigurationException($setup);
396396
}
397397
foreach ($setup as $setupItem => $setupItemConfig) {

tests/Unit/Commands/MakeValidationCommandTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
class MakeValidationCommandTest extends TestCase
88
{
9-
109
public function testConsoleCommand()
1110
{
1211
$this->markTestSkipped('wsdl2Php package has been removed. Needs refactoring');

tests/Unit/Middleware/CisDhlMiddlewareTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class CisDhlMiddlewareTest extends TestCase
1212
public function testCisDHLMiddleware()
1313
{
1414
Soap::fake();
15-
$client = Soap::withCisDHLAuth('test', 'dhl')->baseWsdl(dirname(__DIR__, 2) . '/Fixtures/Wsdl/weather.wsdl');
15+
$client = Soap::withCisDHLAuth('test', 'dhl')->baseWsdl(dirname(__DIR__, 2).'/Fixtures/Wsdl/weather.wsdl');
1616
$response = $client->call('GetWeatherInformation');
1717
Soap::assertSent(function (Request $request) {
1818
return Str::contains($request->xmlContent(), '<cis:Authentification');

tests/Unit/SoapClientTest.php

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
use CodeDredd\Soap\Tests\Fixtures\CustomSoapClient;
1111
use CodeDredd\Soap\Tests\TestCase;
1212
use GuzzleHttp\RedirectMiddleware;
13-
use Illuminate\Support\Arr;
1413
use Illuminate\Support\Str;
1514

1615
class SoapClientTest extends TestCase
@@ -24,7 +23,7 @@ public function testSimpleCall()
2423
{
2524
Soap::fake();
2625
Soap::assertNothingSent();
27-
$response = Soap::baseWsdl(dirname(__DIR__, 1) . '/Fixtures/Wsdl/weather.wsdl')
26+
$response = Soap::baseWsdl(dirname(__DIR__, 1).'/Fixtures/Wsdl/weather.wsdl')
2827
->call('GetWeatherInformation');
2928
self::assertTrue($response->ok());
3029
Soap::assertSent(function (Request $request) {
@@ -46,14 +45,14 @@ public function testMagicCallByConfig()
4645
public function testWsseWithWsaCall()
4746
{
4847
Soap::fake();
49-
$client = Soap::baseWsdl(dirname(__DIR__, 1) . '/Fixtures/Wsdl/weather.wsdl')->withWsse([
48+
$client = Soap::baseWsdl(dirname(__DIR__, 1).'/Fixtures/Wsdl/weather.wsdl')->withWsse([
5049
'userTokenName' => 'Test',
5150
'userTokenPassword' => 'passwordTest',
5251
'mustUnderstand' => false,
5352
])->withWsa();
5453
$response = $client->GetWeatherInformation();
5554
Soap::assertSent(function (Request $request) {
56-
return !Str::contains($request->xmlContent(), 'mustUnderstand');
55+
return ! Str::contains($request->xmlContent(), 'mustUnderstand');
5756
});
5857
self::assertTrue($response->ok());
5958
}
@@ -116,7 +115,7 @@ public function testSoapFake($action, $fake, $exspected)
116115
return Soap::response($item);
117116
})->all();
118117
Soap::fake($fake);
119-
$response = Soap::baseWsdl(dirname(__DIR__, 1) . '/Fixtures/Wsdl/weather.wsdl')
118+
$response = Soap::baseWsdl(dirname(__DIR__, 1).'/Fixtures/Wsdl/weather.wsdl')
120119
->call($action);
121120
self::assertEquals($exspected, $response->json());
122121
}
@@ -149,10 +148,10 @@ public function testSoapOptions(): void
149148
{
150149
Soap::fake();
151150
$client = Soap::withOptions(['soap_version' => SOAP_1_2])
152-
->baseWsdl(dirname(__DIR__, 1) . '/Fixtures/Wsdl/weather.wsdl');
151+
->baseWsdl(dirname(__DIR__, 1).'/Fixtures/Wsdl/weather.wsdl');
153152
$response = $client->call('GetWeatherInformation');
154153
self::assertTrue($response->ok());
155-
Soap::assertSent(function (Request $request) {
154+
Soap::assertSent(function (Request $request) {
156155
return Str::contains(
157156
$request->getRequest()->getHeaderLine('Content-Type'),
158157
'application/soap+xml; charset="utf-8"'
@@ -190,9 +189,9 @@ public function testRealSoapCall(): void
190189
public function testSoapWithDifferentHeaders($header, $exspected): void
191190
{
192191
Soap::fake();
193-
$client = Soap::withHeaders($header)->baseWsdl(dirname(__DIR__, 1) . '/Fixtures/Wsdl/weather.wsdl');
192+
$client = Soap::withHeaders($header)->baseWsdl(dirname(__DIR__, 1).'/Fixtures/Wsdl/weather.wsdl');
194193
$response = $client->call('GetWeatherInformation');
195-
Soap::assertSent(function (Request $request) use ($exspected) {
194+
Soap::assertSent(function (Request $request) use ($exspected) {
196195
return $request->getRequest()->getHeaderLine('test') === $exspected;
197196
});
198197
self::assertTrue($response->ok());
@@ -224,7 +223,7 @@ public function testSoapClientClassMayBeCustomized(): void
224223
public function testHandlerOptions(): void
225224
{
226225
Soap::fake();
227-
$client = Soap::baseWsdl(dirname(__DIR__, 1) . '/Fixtures/Wsdl/weather.wsdl');
226+
$client = Soap::baseWsdl(dirname(__DIR__, 1).'/Fixtures/Wsdl/weather.wsdl');
228227
$response = $client->call('GetWeatherInformation');
229228
self::assertTrue($response->ok());
230229
self::assertEquals(true, $client->getClient()->getConfig()['verify']);

tests/Unit/Xml/XmlSerializerTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace CodeDredd\Soap\Tests\Unit\Xml;
44

55
use CodeDredd\Soap\Tests\TestCase;
6-
use CodeDredd\Soap\Xml\SoapXml;
76
use CodeDredd\Soap\Xml\XMLSerializer;
87

98
class XmlSerializerTest extends TestCase

0 commit comments

Comments
 (0)