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/TradeDoubler.php 1 location

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