Code Duplication    Length = 13-14 lines in 2 locations

src/Networks/CommissionJunction.php 1 location

@@ 36-49 (lines=14) @@
33
    /**
34
     * @method __construct
35
     */
36
    public function __construct(string $username, string $passwordApi, $idSite)
37
    {
38
        $this->_network = new \Oara\Network\Publisher\CommissionJunctionGraphQL();
39
        $this->_username = $username;
40
        $this->_password = $passwordApi;
41
        $this->_passwordApi = $passwordApi;
42
        $this->_publisher_id = $idSite;
43
44
        if (trim($idSite) != '') {
45
            $this->addAllowedSite($idSite);
46
        }
47
48
        $this->login($this->_username, $this->_password, $this->_publisher_id);
49
    }
50
51
    /**
52
     * @return bool

src/Networks/Skimlinks.php 1 location

@@ 35-47 (lines=13) @@
32
    /**
33
     * @method __construct
34
     */
35
    public function __construct(string $username, string $password, string $idSite = '', string $country = '')
36
    {
37
        $this->_network = new \Oara\Network\Publisher\Skimlinks;
38
        $this->_username = $username;
39
        $this->_password = $password;
40
        $this->_country = $country;
41
        $this->login( $this->_username, $this->_password, $idSite, $this->_country);
42
        $this->_apiClient = null;
43
44
        if (trim($idSite)!=''){
45
            $this->addAllowedSite($idSite);
46
        }
47
    }
48
49
    public function login(string $username, string $password, string $idSite = '', string $country = ''): bool{
50
        $this->_logged = false;