Code Duplication    Length = 13-16 lines in 3 locations

src/Networks/NetAffiliation.php 1 location

@@ 54-66 (lines=13) @@
51
    /**
52
     * @return array of Merchants
53
     */
54
    public function getMerchants() : array
55
    {
56
        $arrResult = array();
57
        $merchantList = $this->_network->getMerchantList();
58
        foreach($merchantList as $merchant) {
59
            $Merchant = Merchant::createInstance();
60
            $Merchant->merchant_ID = $merchant['cid'];
61
            $Merchant->name = $merchant['name'];
62
            $arrResult[] = $Merchant;
63
        }
64
65
        return $arrResult;
66
    }
67
68
    /**
69
     * @param int $merchantID

src/Networks/Zanox.php 1 location

@@ 76-91 (lines=16) @@
73
    /**
74
     * @return array of Merchants
75
     */
76
    public function getMerchants(): array
77
    {
78
        if (!$this->checkLogin()) {
79
            return array();
80
        }
81
        $arrResult = array();
82
        $merchantList = $this->_network->getMerchantList();
83
        foreach ($merchantList as $merchant) {
84
            $Merchant = Merchant::createInstance();
85
            $Merchant->merchant_ID = $merchant['cid'];
86
            $Merchant->name = $merchant['name'];
87
            $arrResult[] = $Merchant;
88
        }
89
90
        return $arrResult;
91
    }
92
93
    /**
94
     * @param int|null $merchantID

src/Networks/TradeDoubler.php 1 location

@@ 73-88 (lines=16) @@
70
    /**
71
     * @return array of Merchants
72
     */
73
    public function getMerchants() : array
74
    {
75
        if (!$this->checkLogin()) {
76
            return array();
77
        }
78
        $arrResult = array();
79
        $merchantList = $this->_network->getMerchantList();
80
        foreach($merchantList as $merchant) {
81
            $Merchant = Merchant::createInstance();
82
            $Merchant->merchant_ID = $merchant['cid'];
83
            $Merchant->name = $merchant['name'];
84
            $arrResult[] = $Merchant;
85
        }
86
87
        return $arrResult;
88
    }
89
90
    /**
91
     * @param int|null $merchantID