Skip to content

Apply fixes from StyleCI #130

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Driver/ExtSoap/AbusedClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function __doRequest($request, $location, $action, $version, $oneWay = 0)

public function collectRequest(): SoapRequest
{
if (!$this->storedRequest) {
if (! $this->storedRequest) {
throw new \RuntimeException('No request has been registered yet.');
}

Expand All @@ -80,12 +80,12 @@ public function cleanUpTemporaryState()
$this->storedResponse = null;
}

public function __getLastRequest() : string
public function __getLastRequest(): string
{
return $this->__last_request;
}

public function __getLastResponse() : string
public function __getLastResponse(): string
{
return $this->__last_response;
}
Expand Down
1 change: 1 addition & 0 deletions src/Driver/ExtSoap/ExtSoapDecoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public function decode(string $method, SoapResponse $response)
} finally {
$this->client->cleanUpTemporaryState();
}

return $decoded;
}
}
1 change: 0 additions & 1 deletion src/Driver/ExtSoap/ExtSoapDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ public function __construct(
DecoderInterface $decoder,
MetadataInterface $metadata
) {

$this->client = $client;
$this->encoder = $encoder;
$this->decoder = $decoder;
Expand Down
5 changes: 3 additions & 2 deletions src/Driver/ExtSoap/Metadata/MethodsParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ function (string $methodString) {
private function parseMethodFromString(string $methodString): Method
{
$methodString = $this->transformListResponseToArray($methodString);

return new Method(
$this->parseName($methodString),
$this->parseParameters($methodString),
Expand All @@ -54,15 +55,15 @@ private function transformListResponseToArray(string $methodString): string
private function parseParameters(string $methodString): array
{
preg_match('/\((.*)\)/', $methodString, $properties);
if (!$properties[1]) {
if (! $properties[1]) {
return [];
}

$parameters = preg_split('/,\s?/', $properties[1]);

return array_map(
function (string $parameter): Parameter {
list($type, $name) = explode(' ', trim($parameter));
[$type, $name] = explode(' ', trim($parameter));

return new Parameter(
ltrim($name, '$'),
Expand Down
2 changes: 1 addition & 1 deletion src/Driver/ExtSoap/Metadata/TypesParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function parse(AbusedClient $abusedClient): TypeCollection
foreach ($soapTypes as $soapType) {
$properties = [];
$lines = explode("\n", $soapType);
if (!preg_match('/struct (?P<typeName>.*) {/', $lines[0], $matches)) {
if (! preg_match('/struct (?P<typeName>.*) {/', $lines[0], $matches)) {
continue;
}
$xsdType = XsdType::create($matches['typeName']);
Expand Down
7 changes: 2 additions & 5 deletions tests/Unit/SoapClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,20 +137,17 @@ public function testSoapOptions(): void
self::assertStringContainsString('application/soap+xml; charset="utf-8', $lastRequestInfo->getLastRequestHeaders());
}

/**
*
*/
public function testRealSoapCall(): void
{
$this->markTestSkipped('Real Soap Call Testing. Comment the line out for testing');
// location has to be set because the wsdl has a wrong location declaration
$client = Soap::baseWsdl('https://www.w3schools.com/xml/tempconvert.asmx?wsdl')
->withOptions([
'soap_version' => SOAP_1_2,
'location' => 'https://www.w3schools.com/xml/tempconvert.asmx?wsdl'
'location' => 'https://www.w3schools.com/xml/tempconvert.asmx?wsdl',
]);
$result = $client->call('FahrenheitToCelsius', [
'Fahrenheit' => 75
'Fahrenheit' => 75,
]);
self::assertArrayHasKey('FahrenheitToCelsiusResult', $result->json());
}
Expand Down