Code Duplication    Length = 6-6 lines in 7 locations

src/Networks/TradeDoubler.php 1 location

@@ 155-160 (lines=6) @@
152
            return array();
153
        }
154
        $arrResult = array();
155
        if (count( $arrMerchantID ) < 1) {
156
            $merchants = $this->getMerchants();
157
            foreach ($merchants as $merchant) {
158
                $arrMerchantID[$merchant->merchant_ID] = ['cid' => $merchant->merchant_ID, 'name' => $merchant->name];
159
            }
160
        }
161
        $transcationList = $this->_network->getTransactionList($arrMerchantID, $dateFrom, $dateTo);
162
        foreach($transcationList as $transaction) {
163
            $Transaction = Transaction::createInstance();

src/Networks/Effiliation.php 1 location

@@ 129-134 (lines=6) @@
126
    public function getSales(\DateTime $dateFrom, \DateTime $dateTo, array $arrMerchantID = array()) : array
127
    {
128
        $arrResult = array();
129
        if (count( $arrMerchantID ) < 1) {
130
            $merchants = $this->getMerchants();
131
            foreach ($merchants as $merchant) {
132
                $arrMerchantID[$merchant->merchant_ID] = ['cid' => $merchant->merchant_ID, 'name' => $merchant->name];
133
            }
134
        }
135
        $transcationList = $this->_network->getTransactionList($arrMerchantID, $dateFrom, $dateTo);
136
        foreach($transcationList as $transaction) {
137
            $Transaction = Transaction::createInstance();

src/Networks/NetAffiliation.php 1 location

@@ 159-164 (lines=6) @@
156
            return array();
157
        }
158
        $arrResult = array();
159
        if (count( $arrMerchantID ) < 1) {
160
            $merchants = $this->getMerchants();
161
            foreach ($merchants as $merchant) {
162
                $arrMerchantID[$merchant->merchant_ID] = ['cid' => $merchant->merchant_ID, 'name' => $merchant->name];
163
            }
164
        }
165
166
        $transcationList = $this->_network->getTransactionList($arrMerchantID, $dateFrom, $dateTo);
167
        foreach($transcationList as $transaction) {

src/Networks/WebGains.php 1 location

@@ 134-139 (lines=6) @@
131
     */
132
    public function getSales(\DateTime $dateFrom, \DateTime $dateTo, array $arrMerchantID = array()) : array
133
    {
134
        if (count( $arrMerchantID ) < 1) {
135
            $merchants = $this->getMerchants();
136
            foreach ($merchants as $merchant) {
137
                $arrMerchantID[$merchant->merchant_ID] = ['cid' => $merchant->merchant_ID, 'name' => $merchant->name];
138
            }
139
        }
140
        $arrResult = array();
141
        $transcationList = $this->_network->getTransactionList($arrMerchantID, $dateFrom, $dateTo);
142
        foreach($transcationList as $transaction) {

src/Networks/Zanox.php 1 location

@@ 197-202 (lines=6) @@
194
        }
195
196
        $arrResult = array();
197
        if (count( $arrMerchantID ) < 1) {
198
            $merchants = $this->getMerchants();
199
            foreach ($merchants as $merchant) {
200
                $arrMerchantID[$merchant->merchant_ID] = ['cid' => $merchant->merchant_ID, 'name' => $merchant->name];
201
            }
202
        }
203
        $transcationList = $this->_network->getTransactionList( $arrMerchantID, $dateFrom2, $dateTo );
204
        foreach ($transcationList as $transaction) {
205
            $Transaction = Transaction::createInstance();

src/Networks/CommissionJunction.php 1 location

@@ 140-145 (lines=6) @@
137
    public function getSales(\DateTime $dateFrom, \DateTime $dateTo, array $arrMerchantID = array()) : array
138
    {
139
        $arrResult = array();
140
        if (count( $arrMerchantID ) < 1) {
141
            $merchants = $this->getMerchants();
142
            foreach ($merchants as $merchant) {
143
                $arrMerchantID[$merchant->merchant_ID] = ['cid' => $merchant->merchant_ID, 'name' => $merchant->name];
144
            }
145
        }
146
        $transcationList = $this->_network->getTransactionList($arrMerchantID, $dateFrom,$dateTo);
147
        foreach($transcationList as $transaction) {
148
            $Transaction = Transaction::createInstance();

src/Networks/Publicideas.php 1 location

@@ 164-169 (lines=6) @@
161
            return array();
162
        }
163
        $arrResult = array();
164
        if (count( $arrMerchantID ) < 1) {
165
            $merchants = $this->getMerchants();
166
            foreach ($merchants as $merchant) {
167
                $arrMerchantID[$merchant->merchant_ID] = ['cid' => $merchant->merchant_ID, 'name' => $merchant->name];
168
            }
169
        }
170
        $transcationList = $this->_network->getTransactionList($arrMerchantID, $dateTo, $dateFrom);
171
        foreach($transcationList as $transaction) {
172
            $Transaction = Transaction::createInstance();