Code Duplication    Length = 10-21 lines in 2 locations

src/Networks/Ebay.php 1 location

@@ 33-53 (lines=21) @@
30
    /**
31
     * @method __construct
32
     */
33
    public function __construct(string $username, string $password, string $idSite='')
34
    {
35
        $this->_network = new  EbayEx;
36
        $this->_username = $username;
37
        $this->_password = $password;
38
        if (trim($idSite)!=''){
39
            // Ebay needs Site to filter countries
40
            $this->addAllowedSite($idSite);
41
        }
42
        /*
43
        $apiUrl = 'http://ws.webgains.com/aws.php';
44
        $this->_apiClient = new \SoapClient($apiUrl,
45
            array('login' => $this->_username,
46
                'encoding' => 'UTF-8',
47
                'password' => $this->_password,
48
                'compression' => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP | SOAP_COMPRESSION_DEFLATE,
49
                'soap_version' => SOAP_1_1)
50
        );
51
        */
52
        $this->login( $this->_username, $this->_password );
53
    }
54
55
    public function addAllowedSite($idSite){
56
        if (trim($idSite)!=''){

src/Networks/NetAffiliation.php 1 location

@@ 38-47 (lines=10) @@
35
    /**
36
     * @method __construct
37
     */
38
    public function __construct(string $username, string $password,string $idSite='')
39
    {
40
        $this->_network = new NetAffiliationEx();
41
        $this->_username = $username;
42
        $this->_password = $password;
43
        if (trim($idSite)!=''){
44
            $this->addAllowedSite($idSite);
45
        }
46
        $this->login( $this->_username, $this->_password );
47
    }
48
49
    public function addAllowedSite($idSite){
50
        if (trim($idSite)!=''){