Skip to content

Commit

Permalink
Merge pull request #24 from veewee/sequence-group
Browse files Browse the repository at this point in the history
Parse anonymous sequence containers
  • Loading branch information
veewee authored Apr 2, 2024
2 parents 11537a6 + e9fac18 commit 535251d
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
}

Expand Down
28 changes: 28 additions & 0 deletions tests/PhpCompatibility/schema1010.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
--TEST--
SOAP XML Schema 1010: Anonymous sequence element container
--FILE--
<?php
include __DIR__."/test_schema.inc";
$schema = <<<EOF
<complexType name="a">
<choice minOccurs="0">
<element name="flag" type="boolean" />
<sequence>
<element name="mandatory" type="string" />
<element minOccurs="0" name="optional" type="boolean" />
</sequence>
</choice>
</complexType>
EOF;
test_schema($schema,'type="tns:testType"');
?>
--EXPECTF--
Methods:
> test(testType $testParam): void

Types:
> http://test-uri/:a {
?boolean $flag
?string $mandatory
?boolean $optional
}

0 comments on commit 535251d

Please sign in to comment.