Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
90.00% |
9 / 10 |
|
50.00% |
1 / 2 |
CRAP | |
0.00% |
0 / 1 |
TagElement | |
90.00% |
9 / 10 |
|
50.00% |
1 / 2 |
5.03 | |
0.00% |
0 / 1 |
parsingTag | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
parseTagAttributes | |
88.89% |
8 / 9 |
|
0.00% |
0 / 1 |
4.02 |
1 | <?php |
2 | |
3 | declare(strict_types=1); |
4 | |
5 | namespace WsdlToPhp\PackageGenerator\Parser\Wsdl; |
6 | |
7 | use WsdlToPhp\PackageGenerator\Model\AbstractModel; |
8 | use WsdlToPhp\PackageGenerator\Model\StructAttribute; |
9 | use WsdlToPhp\WsdlHandler\AbstractDocument; |
10 | use WsdlToPhp\WsdlHandler\Tag\AbstractTag as Tag; |
11 | use WsdlToPhp\WsdlHandler\Tag\TagSequence; |
12 | use WsdlToPhp\WsdlHandler\Wsdl as WsdlDocument; |
13 | |
14 | final class TagElement extends AbstractAttributesParser |
15 | { |
16 | protected function parsingTag(): string |
17 | { |
18 | return WsdlDocument::TAG_ELEMENT; |
19 | } |
20 | |
21 | protected function parseTagAttributes(Tag $tag, AbstractModel $model = null, StructAttribute $structAttribute = null): void |
22 | { |
23 | parent::parseTagAttributes($tag, $model, $structAttribute); |
24 | |
25 | if ($structAttribute instanceof StructAttribute) { |
26 | $structAttribute |
27 | ->setContainsElements($tag->canOccurSeveralTimes()) |
28 | ->setRemovableFromRequest($tag->isRemovable()) |
29 | ; |
30 | |
31 | $sequence = $tag->getSuitableParent(false, [AbstractDocument::TAG_SEQUENCE]); |
32 | if ($sequence instanceof TagSequence && $sequence->canOccurSeveralTimes()) { |
33 | $structAttribute->setContainsElements(); |
34 | } |
35 | } |
36 | } |
37 | } |