Skip to content

Commit c7faff7

Browse files
committed
Psalm + PHP85 compatibility
1 parent 1eabab1 commit c7faff7

5 files changed

Lines changed: 14 additions & 11 deletions

File tree

src/AbusedClient.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ public function __doRequest(
4949
string $location,
5050
string $action,
5151
int $version,
52-
bool $one_way = false
52+
bool $one_way = false,
53+
?string $uriParserClass = null,
5354
): string {
5455
$this->storedRequest = new SoapRequest($request, $location, $action, $version, $one_way);
5556

src/Metadata/MethodsParser.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ private function parseMethodFromString(string $methodString): Method
4141

4242
private function transformListResponseToArray(string $methodString): string
4343
{
44-
return preg_replace('/^list\(([^\)]*)\)(.*)/i', 'array$2', $methodString);
44+
return (string) preg_replace('/^list\(([^\)]*)\)(.*)/i', 'array$2', $methodString);
4545
}
4646

4747
private function parseParameters(string $methodString): ParameterCollection
@@ -51,7 +51,7 @@ private function parseParameters(string $methodString): ParameterCollection
5151
return new ParameterCollection();
5252
}
5353

54-
$parameters = preg_split('/,\s?/', $properties[1]);
54+
$parameters = preg_split('/,\s?/', $properties[1]) ?: [];
5555

5656
return new ParameterCollection(...array_map(
5757
function (string $parameter): Parameter {

src/Transport/ExtSoapServerTransport.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public function request(SoapRequest $request): SoapResponse
2020
{
2121
ob_start();
2222
$this->server->handle($request->getRequest());
23-
$responseBody = ob_get_contents();
23+
$responseBody = (string) ob_get_contents();
2424
ob_end_clean();
2525

2626
return new SoapResponse($responseBody);

tests/Functional/ExtSoap/Encoding/DuplicateTypenamesTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
namespace SoapTest\ExtSoapEngine\Functional\ExtSoap\Encoding;
66

77
use DOMDocument;
8+
use PHPUnit\Framework\Attributes\RunInSeparateProcess;
89
use Soap\Engine\SimpleEngine;
910
use Soap\ExtSoapEngine\Configuration\ClassMap\ClassMap;
1011
use Soap\ExtSoapEngine\Configuration\ClassMap\ClassMapCollection;
@@ -52,7 +53,7 @@ public function test_it_registers_both_types()
5253
static::assertEquals([...$store2->getProperties()][0]->getName(), 'Attribute2');
5354
}
5455

55-
#[\PHPUnit\Framework\Attributes\RunInSeparateProcess]
56+
#[RunInSeparateProcess]
5657
public function test_it_knows_how_to_encode_both_types()
5758
{
5859
$engine = new SimpleEngine($this->driver, $this->transport);
@@ -71,7 +72,7 @@ public function test_it_knows_how_to_encode_both_types()
7172
static::assertStringContainsString('<output2 xsi:type="ns3:Store"><Attribute2 xsi:type="xsd:string">ok</Attribute2></output2>', $lastRequestInfo->getLastResponse());
7273
}
7374

74-
#[\PHPUnit\Framework\Attributes\RunInSeparateProcess]
75+
#[RunInSeparateProcess]
7576
public function test_it_uses_same_model_for_both_objects()
7677
{
7778
$this->driver = $this->configureSoapDriver($this->wsdl, [
@@ -110,7 +111,7 @@ public function validate($store1, $store2)
110111
static::assertStringContainsString('<output2 xsi:type="ns3:Store"><Attribute2 xsi:type="xsd:string">attr2</Attribute2></output2>', $lastRequestInfo->getLastResponse());
111112
}
112113

113-
#[\PHPUnit\Framework\Attributes\RunInSeparateProcess]
114+
#[RunInSeparateProcess]
114115
public function test_it_is_possible_to_override_a_single_instance_with_typemap()
115116
{
116117
$this->driver = $this->configureSoapDriver($this->wsdl, [

tests/Functional/ExtSoap/Encoding/EnumTest.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
use DOMDocument;
88
use Exception;
9+
use PHPUnit\Framework\Attributes\RunInSeparateProcess;
910
use Soap\Engine\SimpleEngine;
1011
use Soap\ExtSoapEngine\ExtSoapDriver;
1112
use Soap\ExtSoapEngine\Transport\TraceableTransport;
@@ -43,7 +44,7 @@ public function test_it_does_not_register_a_type()
4344
static::assertCount(0, $types);
4445
}
4546

46-
#[\PHPUnit\Framework\Attributes\RunInSeparateProcess]
47+
#[RunInSeparateProcess]
4748
public function test_it_knows_how_to_add_enums()
4849
{
4950
$input = 'Home';
@@ -56,7 +57,7 @@ public function test_it_knows_how_to_add_enums()
5657
static::assertStringContainsString('<output xsi:type="ns2:PhoneTypeEnum">Home</output>', $lastRequestInfo->getLastResponse());
5758
}
5859

59-
#[\PHPUnit\Framework\Attributes\RunInSeparateProcess]
60+
#[RunInSeparateProcess]
6061
public function test_it_does_not_validate_enums()
6162
{
6263
$input = 'INVALID';
@@ -68,7 +69,7 @@ public function test_it_does_not_validate_enums()
6869
static::assertStringContainsString('<output xsi:type="ns2:PhoneTypeEnum">INVALID</output>', $lastRequestInfo->getLastResponse());
6970
}
7071

71-
#[\PHPUnit\Framework\Attributes\RunInSeparateProcess]
72+
#[RunInSeparateProcess]
7273
public function test_it_does_not_validate_enum_types()
7374
{
7475
$input = 123;
@@ -80,7 +81,7 @@ public function test_it_does_not_validate_enum_types()
8081
static::assertStringContainsString('<output xsi:type="ns2:PhoneTypeEnum">123</output>', $lastRequestInfo->getLastResponse());
8182
}
8283

83-
#[\PHPUnit\Framework\Attributes\RunInSeparateProcess]
84+
#[RunInSeparateProcess]
8485
public function test_it_can_be_transformed_with_type_map()
8586
{
8687
$this->driver = $this->configureSoapDriver($this->wsdl, [

0 commit comments

Comments
 (0)