Code Duplication    Length = 6-6 lines in 6 locations

src/Networks/Effiliation.php 1 location

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

src/Networks/NetAffiliation.php 1 location

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

src/Networks/Publicideas.php 1 location

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

src/Networks/TradeDoubler.php 1 location

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

src/Networks/WebGains.php 1 location

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

src/Networks/Zanox.php 1 location

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