Code Duplication    Length = 21-21 lines in 2 locations

admin/gateways/pec24/nusoap.php 2 locations

@@ 5038-5058 (lines=21) @@
5035
            foreach ($this->schemas as $ns => $list) {
5036
                foreach ($list as $xs) {
5037
                    $wsdlparts = parse_url($this->wsdl);    // this is bogusly simple!
5038
                    foreach ($xs->imports as $ns2 => $list2) {
5039
                        for ($ii = 0; $ii < count($list2); ++$ii) {
5040
                            if (!$list2[$ii]['loaded']) {
5041
                                $this->schemas[$ns]->imports[$ns2][$ii]['loaded'] = true;
5042
                                $url                                              = $list2[$ii]['location'];
5043
                                if ($url != '') {
5044
                                    $urlparts = parse_url($url);
5045
                                    if (!isset($urlparts['host'])) {
5046
                                        $url = $wsdlparts['scheme'] . '://' . $wsdlparts['host'] . (isset($wsdlparts['port']) ? ':' . $wsdlparts['port'] : '') . substr($wsdlparts['path'], 0, strrpos($wsdlparts['path'], '/') + 1) . $urlparts['path'];
5047
                                    }
5048
                                    if (!in_array($url, $imported_urls)) {
5049
                                        $this->parseWSDL($url);
5050
                                        ++$imported;
5051
                                        $imported_urls[] = $url;
5052
                                    }
5053
                                } else {
5054
                                    $this->debug('Unexpected scenario: empty URL for unloaded import');
5055
                                }
5056
                            }
5057
                        }
5058
                    }
5059
                }
5060
            }
5061
            // WSDL imports
@@ 5063-5083 (lines=21) @@
5060
            }
5061
            // WSDL imports
5062
            $wsdlparts = parse_url($this->wsdl);    // this is bogusly simple!
5063
            foreach ($this->import as $ns => $list) {
5064
                for ($ii = 0; $ii < count($list); ++$ii) {
5065
                    if (!$list[$ii]['loaded']) {
5066
                        $this->import[$ns][$ii]['loaded'] = true;
5067
                        $url                              = $list[$ii]['location'];
5068
                        if ($url != '') {
5069
                            $urlparts = parse_url($url);
5070
                            if (!isset($urlparts['host'])) {
5071
                                $url = $wsdlparts['scheme'] . '://' . $wsdlparts['host'] . (isset($wsdlparts['port']) ? ':' . $wsdlparts['port'] : '') . substr($wsdlparts['path'], 0, strrpos($wsdlparts['path'], '/') + 1) . $urlparts['path'];
5072
                            }
5073
                            if (!in_array($url, $imported_urls)) {
5074
                                $this->parseWSDL($url);
5075
                                ++$imported;
5076
                                $imported_urls[] = $url;
5077
                            }
5078
                        } else {
5079
                            $this->debug('Unexpected scenario: empty URL for unloaded import');
5080
                        }
5081
                    }
5082
                }
5083
            }
5084
        }
5085
        // add new data to operation data
5086
        foreach ($this->bindings as $binding => $bindingData) {