Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
14 / 14 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| AbstractAttributesParser | |
100.00% |
14 / 14 |
|
100.00% |
2 / 2 |
9 | |
100.00% |
1 / 1 |
| parseTag | |
100.00% |
12 / 12 |
|
100.00% |
1 / 1 |
7 | |||
| parseWsdl | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace WsdlToPhp\PackageGenerator\Parser\Wsdl; |
| 6 | |
| 7 | use WsdlToPhp\PackageGenerator\Model\Struct; |
| 8 | use WsdlToPhp\PackageGenerator\Model\StructAttribute; |
| 9 | use WsdlToPhp\PackageGenerator\Model\Wsdl; |
| 10 | use WsdlToPhp\WsdlHandler\Tag\AbstractTag as Tag; |
| 11 | |
| 12 | abstract class AbstractAttributesParser extends AbstractTagParser |
| 13 | { |
| 14 | public function parseTag(Tag $tag): void |
| 15 | { |
| 16 | $parent = $tag->getSuitableParent(); |
| 17 | |
| 18 | if ($parent instanceof Tag) { |
| 19 | $model = $this->getModel($parent); |
| 20 | if ($model instanceof Struct) { |
| 21 | if ($tag->hasAttributeName() && ($modelAttribute = $model->getAttribute($tag->getAttributeName())) instanceof StructAttribute) { |
| 22 | $this->parseTagAttributes($tag, $model, $modelAttribute); |
| 23 | |
| 24 | return; |
| 25 | } |
| 26 | |
| 27 | if ($tag->hasAttributeRef() && ($modelAttribute = $model->getAttribute($tag->getAttributeRef())) instanceof StructAttribute) { |
| 28 | $this->parseTagAttributes($tag, $model, $modelAttribute); |
| 29 | |
| 30 | return; |
| 31 | } |
| 32 | |
| 33 | $this->parseTagAttributes($tag, $model); |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | $this->parseTagAttributes($tag); |
| 38 | } |
| 39 | |
| 40 | protected function parseWsdl(Wsdl $wsdl): void |
| 41 | { |
| 42 | foreach ($this->getTags() as $tag) { |
| 43 | $this->parseTag($tag); |
| 44 | } |
| 45 | } |
| 46 | } |