Code Duplication    Length = 17-17 lines in 2 locations

src/WSDL/XML/XMLStyle/XMLDocumentStyle.php 1 location

@@ 102-118 (lines=17) @@
99
            $elementPartElement = XMLAttributeHelper::forDOM($DOMDocument)->createElementWithAttributes('xsd:element', $attributes);
100
            $sequenceElement->appendChild($elementPartElement);
101
        }
102
        if ($node->isArray()) {
103
            $complexTypeElement = XMLAttributeHelper::forDOM($DOMDocument)
104
                ->createElementWithAttributes('xsd:complexType', ['name' => $node->getNameForArray()]);
105
            $complexContentElement = XMLAttributeHelper::forDOM($DOMDocument)->createElement('xsd:complexContent');
106
            $restrictionElement = XMLAttributeHelper::forDOM($DOMDocument)
107
                ->createElementWithAttributes('xsd:restriction', ['base' => 'soapenc:Array']);
108
            $type = $node->isObject() ? 'ns:' . $node->getNameForObject() . '[]' : 'xsd:' . $node->getType() . '[]';
109
            $attributeElement = XMLAttributeHelper::forDOM($DOMDocument)
110
                ->createElementWithAttributes('xsd:attribute', [
111
                    'ref' => 'soapenc:arrayType',
112
                    $soapVersion . ':arrayType' => $type
113
                ]);
114
            $restrictionElement->appendChild($attributeElement);
115
            $complexContentElement->appendChild($restrictionElement);
116
            $complexTypeElement->appendChild($complexContentElement);
117
            $result[] = $complexTypeElement;
118
        }
119
        if ($node->isObject()) {
120
            $complexTypeElement = XMLAttributeHelper::forDOM($DOMDocument)
121
                ->createElementWithAttributes('xsd:complexType', ['name' => $node->getNameForObject()]);

src/WSDL/XML/XMLStyle/XMLRpcStyle.php 1 location

@@ 91-107 (lines=17) @@
88
            $elementPartElement = XMLAttributeHelper::forDOM($DOMDocument)->createElementWithAttributes('xsd:element', $attributes);
89
            $sequenceElement->appendChild($elementPartElement);
90
        }
91
        if ($node->isArray()) {
92
            $complexTypeElement = XMLAttributeHelper::forDOM($DOMDocument)
93
                ->createElementWithAttributes('xsd:complexType', ['name' => $node->getNameForArray()]);
94
            $complexContentElement = XMLAttributeHelper::forDOM($DOMDocument)->createElement('xsd:complexContent');
95
            $restrictionElement = XMLAttributeHelper::forDOM($DOMDocument)
96
                ->createElementWithAttributes('xsd:restriction', ['base' => 'soapenc:Array']);
97
            $type = $node->isObject() ? 'ns:' . $node->getNameForObject() . '[]' : 'xsd:' . $node->getType() . '[]';
98
            $attributeElement = XMLAttributeHelper::forDOM($DOMDocument)
99
                ->createElementWithAttributes('xsd:attribute', [
100
                    'ref' => 'soapenc:arrayType',
101
                    $soapVersion . ':arrayType' => $type
102
                ]);
103
            $restrictionElement->appendChild($attributeElement);
104
            $complexContentElement->appendChild($restrictionElement);
105
            $complexTypeElement->appendChild($complexContentElement);
106
            $result[] = $complexTypeElement;
107
        }
108
        if ($node->isObject()) {
109
            $name = $node->getNameForObject();
110
            $element = XMLAttributeHelper::forDOM($DOMDocument)->createElementWithAttributes('xsd:element', [