diff --git a/src/Metadata/MethodsParser.php b/src/Metadata/MethodsParser.php index bb3d886..7ad232e 100644 --- a/src/Metadata/MethodsParser.php +++ b/src/Metadata/MethodsParser.php @@ -25,7 +25,7 @@ public function parse(SoapClient $client): MethodCollection { return new MethodCollection(...array_map( fn (string $methodString) => $this->parseMethodFromString($methodString), - array_values($client->__getFunctions()) + array_values((array)$client->__getFunctions()) )); } diff --git a/src/Metadata/TypesParser.php b/src/Metadata/TypesParser.php index a043298..373e328 100644 --- a/src/Metadata/TypesParser.php +++ b/src/Metadata/TypesParser.php @@ -27,7 +27,7 @@ public function __construct(XsdTypeCollection $xsdTypes) public function parse(SoapClient $client): TypeCollection { $collected = []; - $soapTypes = $client->__getTypes(); + $soapTypes = (array) $client->__getTypes(); foreach ($soapTypes as $soapType) { $properties = []; $lines = explode("\n", $soapType); diff --git a/src/Metadata/XsdTypesParser.php b/src/Metadata/XsdTypesParser.php index 93219a4..c18c6a9 100644 --- a/src/Metadata/XsdTypesParser.php +++ b/src/Metadata/XsdTypesParser.php @@ -36,7 +36,7 @@ public static function default(): self public function parse(SoapClient $client): XsdTypeCollection { $collected = []; - $soapTypes = $client->__getTypes(); + $soapTypes = (array) $client->__getTypes(); foreach ($soapTypes as $soapType) { if ($type = $this->detectXsdType($soapType)) { $collected[] = $type; diff --git a/stubs/SoapClient.phpstub b/stubs/SoapClient.phpstub index e74d67a..53157c2 100644 --- a/stubs/SoapClient.phpstub +++ b/stubs/SoapClient.phpstub @@ -8,4 +8,16 @@ class SoapClient * This can be removed once it is fixed in psalm */ public function __doRequest (string $request, string $location, string $action, int $version, bool $one_way = false): ?string {} + + /** + * @see https://github.com/vimeo/psalm/pull/7140 + * This can be removed once it is fixed in psalm + */ + public function __getTypes (): ?array {} + + /** + * @see https://github.com/vimeo/psalm/pull/7140 + * This can be removed once it is fixed in psalm + */ + public function __getFunctions (): ?array {} }