Code Duplication    Length = 17-17 lines in 2 locations

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

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

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

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