From e9fac18855b4c1abcb954c7b6cc4da5dae27d804 Mon Sep 17 00:00:00 2001 From: Toon Verwerft Date: Sat, 30 Mar 2024 08:05:10 +0100 Subject: [PATCH] Parse anonymous sequence containers --- .../Types/Visitor/ElementContainerVisitor.php | 3 +- tests/PhpCompatibility/schema1010.phpt | 28 +++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 tests/PhpCompatibility/schema1010.phpt diff --git a/src/Metadata/Converter/Types/Visitor/ElementContainerVisitor.php b/src/Metadata/Converter/Types/Visitor/ElementContainerVisitor.php index e67aca8..b18acc2 100644 --- a/src/Metadata/Converter/Types/Visitor/ElementContainerVisitor.php +++ b/src/Metadata/Converter/Types/Visitor/ElementContainerVisitor.php @@ -8,6 +8,7 @@ use GoetasWebservices\XML\XSDReader\Schema\Element\ElementItem; use GoetasWebservices\XML\XSDReader\Schema\Element\ElementSingle; use GoetasWebservices\XML\XSDReader\Schema\Element\Group; +use GoetasWebservices\XML\XSDReader\Schema\Element\Sequence; use Soap\Engine\Metadata\Collection\PropertyCollection; use Soap\Engine\Metadata\Model\Property; use Soap\Engine\Metadata\Model\XsdType as EngineType; @@ -30,7 +31,7 @@ public function __invoke(ElementContainer $container, TypesConverterContext $con private function parseElementItem(ElementItem $element, TypesConverterContext $context): PropertyCollection { - if ($element instanceof Group || $element instanceof Choice) { + if ($element instanceof Group || $element instanceof Choice || $element instanceof Sequence) { return $this->__invoke($element, $context); } diff --git a/tests/PhpCompatibility/schema1010.phpt b/tests/PhpCompatibility/schema1010.phpt new file mode 100644 index 0000000..07f7de7 --- /dev/null +++ b/tests/PhpCompatibility/schema1010.phpt @@ -0,0 +1,28 @@ +--TEST-- +SOAP XML Schema 1010: Anonymous sequence element container +--FILE-- + + + + + + + + + +EOF; +test_schema($schema,'type="tns:testType"'); +?> +--EXPECTF-- +Methods: + > test(testType $testParam): void + +Types: + > http://test-uri/:a { + ?boolean $flag + ?string $mandatory + ?boolean $optional + }