Code Duplication    Length = 21-21 lines in 2 locations

src/Networks/Affilinet.php 1 location

@@ 49-69 (lines=21) @@
46
    /**
47
     * @return bool
48
     */
49
    public function login(string $username, string $password,string $idSite=''): bool
50
    {
51
        $this->_logged = false;
52
        if (isNullOrEmpty( $username ) && isNullOrEmpty( $password )) {
53
54
            return false;
55
        }
56
        $this->_username = $username;
57
        $this->_password = $password;
58
        $this->_passwordApi= $password;
59
        $credentials = array();
60
        $credentials["user"] = $this->_username;
61
        $credentials["password"] = $this->_username;
62
        $credentials["apipassword"] = $this->_passwordApi;
63
        $this->_network->login($credentials);
64
        if ($this->_network->checkConnection()) {
65
            $this->_logged = true;
66
        }
67
68
        return $this->_logged;
69
    }
70
71
    /**
72
     * @return bool

src/Networks/CommissionJunction.php 1 location

@@ 50-70 (lines=21) @@
47
    /**
48
     * @return bool
49
     */
50
    public function login(string $username, string $password,string $idSite=''): bool
51
    {
52
        $this->_logged = false;
53
        if (isNullOrEmpty( $username ) && isNullOrEmpty( $password )) {
54
55
            return false;
56
        }
57
        $this->_username = $username;
58
        $this->_password = $password;
59
        $this->_passwordApi= $password;
60
        $credentials = array();
61
        $credentials["user"] = $this->_username;
62
        $credentials["password"] = $this->_username;
63
        $credentials["apipassword"] = $this->_passwordApi;
64
        $this->_network->login($credentials);
65
        if ($this->_network->checkConnection()) {
66
            $this->_logged = true;
67
        }
68
69
        return $this->_logged;
70
    }
71
72
    /**
73
     * @return bool